Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Two easily resolvable overlapping change conflicts, one in TCP and one in the eBPF verifier. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
375ca548f7
|
@ -7,7 +7,7 @@ Intro
|
|||
=====
|
||||
|
||||
The MSG_ZEROCOPY flag enables copy avoidance for socket send calls.
|
||||
The feature is currently implemented for TCP sockets.
|
||||
The feature is currently implemented for TCP and UDP sockets.
|
||||
|
||||
|
||||
Opportunity and Caveats
|
||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
|||
VERSION = 5
|
||||
PATCHLEVEL = 0
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc6
|
||||
EXTRAVERSION = -rc7
|
||||
NAME = Shy Crocodile
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
@ -1400,6 +1400,7 @@ config NR_CPUS
|
|||
config HOTPLUG_CPU
|
||||
bool "Support for hot-pluggable CPUs"
|
||||
depends on SMP
|
||||
select GENERIC_IRQ_MIGRATION
|
||||
help
|
||||
Say Y here to experiment with turning CPUs off and on. CPUs
|
||||
can be controlled through /sys/devices/system/cpu.
|
||||
|
|
|
@ -644,6 +644,17 @@
|
|||
};
|
||||
};
|
||||
|
||||
/* Configure pwm clock source for timers 8 & 9 */
|
||||
&timer8 {
|
||||
assigned-clocks = <&abe_clkctrl OMAP4_TIMER8_CLKCTRL 24>;
|
||||
assigned-clock-parents = <&sys_clkin_ck>;
|
||||
};
|
||||
|
||||
&timer9 {
|
||||
assigned-clocks = <&l4_per_clkctrl OMAP4_TIMER9_CLKCTRL 24>;
|
||||
assigned-clock-parents = <&sys_clkin_ck>;
|
||||
};
|
||||
|
||||
/*
|
||||
* As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for
|
||||
* uart1 wakeirq.
|
||||
|
|
|
@ -317,7 +317,8 @@
|
|||
|
||||
palmas_sys_nirq_pins: pinmux_palmas_sys_nirq_pins {
|
||||
pinctrl-single,pins = <
|
||||
OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0) /* sys_nirq1 */
|
||||
/* sys_nirq1 is pulled down as the SoC is inverting it for GIC */
|
||||
OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0)
|
||||
>;
|
||||
};
|
||||
|
||||
|
@ -385,7 +386,8 @@
|
|||
|
||||
palmas: palmas@48 {
|
||||
compatible = "ti,palmas";
|
||||
interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */
|
||||
/* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */
|
||||
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_LOW>;
|
||||
reg = <0x48>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
@ -651,7 +653,8 @@
|
|||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&twl6040_pins>;
|
||||
|
||||
interrupts = <GIC_SPI 119 IRQ_TYPE_NONE>; /* IRQ_SYS_2N cascaded to gic */
|
||||
/* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */
|
||||
interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_LOW>;
|
||||
|
||||
/* audpwron gpio defined in the board specific dts */
|
||||
|
||||
|
|
|
@ -181,6 +181,13 @@
|
|||
OMAP5_IOPAD(0x0042, PIN_INPUT_PULLDOWN | MUX_MODE6) /* llib_wakereqin.gpio1_wk15 */
|
||||
>;
|
||||
};
|
||||
|
||||
palmas_sys_nirq_pins: pinmux_palmas_sys_nirq_pins {
|
||||
pinctrl-single,pins = <
|
||||
/* sys_nirq1 is pulled down as the SoC is inverting it for GIC */
|
||||
OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0)
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
||||
&omap5_pmx_core {
|
||||
|
@ -414,8 +421,11 @@
|
|||
|
||||
palmas: palmas@48 {
|
||||
compatible = "ti,palmas";
|
||||
interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */
|
||||
reg = <0x48>;
|
||||
pinctrl-0 = <&palmas_sys_nirq_pins>;
|
||||
pinctrl-names = "default";
|
||||
/* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */
|
||||
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_LOW>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
ti,system-power-controller;
|
||||
|
|
|
@ -719,7 +719,6 @@
|
|||
pm_qos = <&qos_lcdc0>,
|
||||
<&qos_lcdc1>,
|
||||
<&qos_cif0>,
|
||||
<&qos_cif1>,
|
||||
<&qos_ipp>,
|
||||
<&qos_rga>;
|
||||
};
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#ifndef __ASSEMBLY__
|
||||
struct irqaction;
|
||||
struct pt_regs;
|
||||
extern void migrate_irqs(void);
|
||||
|
||||
extern void asm_do_IRQ(unsigned int, struct pt_regs *);
|
||||
void handle_IRQ(unsigned int, struct pt_regs *);
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#define KVM_REQ_SLEEP \
|
||||
KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
|
||||
#define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1)
|
||||
#define KVM_REQ_VCPU_RESET KVM_ARCH_REQ(2)
|
||||
|
||||
DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
|
||||
|
||||
|
@ -147,6 +148,13 @@ struct kvm_cpu_context {
|
|||
|
||||
typedef struct kvm_cpu_context kvm_cpu_context_t;
|
||||
|
||||
struct vcpu_reset_state {
|
||||
unsigned long pc;
|
||||
unsigned long r0;
|
||||
bool be;
|
||||
bool reset;
|
||||
};
|
||||
|
||||
struct kvm_vcpu_arch {
|
||||
struct kvm_cpu_context ctxt;
|
||||
|
||||
|
@ -186,6 +194,8 @@ struct kvm_vcpu_arch {
|
|||
/* Cache some mmu pages needed inside spinlock regions */
|
||||
struct kvm_mmu_memory_cache mmu_page_cache;
|
||||
|
||||
struct vcpu_reset_state reset_state;
|
||||
|
||||
/* Detect first run of a vcpu */
|
||||
bool has_run_once;
|
||||
};
|
||||
|
|
|
@ -76,4 +76,9 @@ static inline bool kvm_stage2_has_pud(struct kvm *kvm)
|
|||
#define S2_PMD_MASK PMD_MASK
|
||||
#define S2_PMD_SIZE PMD_SIZE
|
||||
|
||||
static inline bool kvm_stage2_has_pmd(struct kvm *kvm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* __ARM_S2_PGTABLE_H_ */
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <linux/smp.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/ratelimit.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/kallsyms.h>
|
||||
|
@ -109,64 +108,3 @@ int __init arch_probe_nr_irqs(void)
|
|||
return nr_irqs;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
static bool migrate_one_irq(struct irq_desc *desc)
|
||||
{
|
||||
struct irq_data *d = irq_desc_get_irq_data(desc);
|
||||
const struct cpumask *affinity = irq_data_get_affinity_mask(d);
|
||||
struct irq_chip *c;
|
||||
bool ret = false;
|
||||
|
||||
/*
|
||||
* If this is a per-CPU interrupt, or the affinity does not
|
||||
* include this CPU, then we have nothing to do.
|
||||
*/
|
||||
if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))
|
||||
return false;
|
||||
|
||||
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
|
||||
affinity = cpu_online_mask;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
c = irq_data_get_irq_chip(d);
|
||||
if (!c->irq_set_affinity)
|
||||
pr_debug("IRQ%u: unable to set affinity\n", d->irq);
|
||||
else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
|
||||
cpumask_copy(irq_data_get_affinity_mask(d), affinity);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* The current CPU has been marked offline. Migrate IRQs off this CPU.
|
||||
* If the affinity settings do not allow other CPUs, force them onto any
|
||||
* available CPU.
|
||||
*
|
||||
* Note: we must iterate over all IRQs, whether they have an attached
|
||||
* action structure or not, as we need to get chained interrupts too.
|
||||
*/
|
||||
void migrate_irqs(void)
|
||||
{
|
||||
unsigned int i;
|
||||
struct irq_desc *desc;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
for_each_irq_desc(i, desc) {
|
||||
bool affinity_broken;
|
||||
|
||||
raw_spin_lock(&desc->lock);
|
||||
affinity_broken = migrate_one_irq(desc);
|
||||
raw_spin_unlock(&desc->lock);
|
||||
|
||||
if (affinity_broken)
|
||||
pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n",
|
||||
i, smp_processor_id());
|
||||
}
|
||||
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
#endif /* CONFIG_HOTPLUG_CPU */
|
||||
|
|
|
@ -254,7 +254,7 @@ int __cpu_disable(void)
|
|||
/*
|
||||
* OK - migrate IRQs away from this CPU
|
||||
*/
|
||||
migrate_irqs();
|
||||
irq_migrate_all_off_this_cpu();
|
||||
|
||||
/*
|
||||
* Flush user cache and TLB mappings, and then remove this CPU
|
||||
|
|
|
@ -1450,6 +1450,6 @@ void kvm_reset_coprocs(struct kvm_vcpu *vcpu)
|
|||
reset_coproc_regs(vcpu, table, num);
|
||||
|
||||
for (num = 1; num < NR_CP15_REGS; num++)
|
||||
if (vcpu_cp15(vcpu, num) == 0x42424242)
|
||||
panic("Didn't reset vcpu_cp15(vcpu, %zi)", num);
|
||||
WARN(vcpu_cp15(vcpu, num) == 0x42424242,
|
||||
"Didn't reset vcpu_cp15(vcpu, %zi)", num);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <asm/cputype.h>
|
||||
#include <asm/kvm_arm.h>
|
||||
#include <asm/kvm_coproc.h>
|
||||
#include <asm/kvm_emulate.h>
|
||||
|
||||
#include <kvm/arm_arch_timer.h>
|
||||
|
||||
|
@ -69,6 +70,29 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
|
|||
/* Reset CP15 registers */
|
||||
kvm_reset_coprocs(vcpu);
|
||||
|
||||
/*
|
||||
* Additional reset state handling that PSCI may have imposed on us.
|
||||
* Must be done after all the sys_reg reset.
|
||||
*/
|
||||
if (READ_ONCE(vcpu->arch.reset_state.reset)) {
|
||||
unsigned long target_pc = vcpu->arch.reset_state.pc;
|
||||
|
||||
/* Gracefully handle Thumb2 entry point */
|
||||
if (target_pc & 1) {
|
||||
target_pc &= ~1UL;
|
||||
vcpu_set_thumb(vcpu);
|
||||
}
|
||||
|
||||
/* Propagate caller endianness */
|
||||
if (vcpu->arch.reset_state.be)
|
||||
kvm_vcpu_set_be(vcpu);
|
||||
|
||||
*vcpu_pc(vcpu) = target_pc;
|
||||
vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0);
|
||||
|
||||
vcpu->arch.reset_state.reset = false;
|
||||
}
|
||||
|
||||
/* Reset arch_timer context */
|
||||
return kvm_timer_vcpu_reset(vcpu);
|
||||
}
|
||||
|
|
|
@ -152,6 +152,10 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev,
|
|||
mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) &&
|
||||
(cx->mpu_logic_state == PWRDM_POWER_OFF);
|
||||
|
||||
/* Enter broadcast mode for periodic timers */
|
||||
tick_broadcast_enable();
|
||||
|
||||
/* Enter broadcast mode for one-shot timers */
|
||||
tick_broadcast_enter();
|
||||
|
||||
/*
|
||||
|
@ -218,15 +222,6 @@ fail:
|
|||
return index;
|
||||
}
|
||||
|
||||
/*
|
||||
* For each cpu, setup the broadcast timer because local timers
|
||||
* stops for the states above C1.
|
||||
*/
|
||||
static void omap_setup_broadcast_timer(void *arg)
|
||||
{
|
||||
tick_broadcast_enable();
|
||||
}
|
||||
|
||||
static struct cpuidle_driver omap4_idle_driver = {
|
||||
.name = "omap4_idle",
|
||||
.owner = THIS_MODULE,
|
||||
|
@ -319,8 +314,5 @@ int __init omap4_idle_init(void)
|
|||
if (!cpu_clkdm[0] || !cpu_clkdm[1])
|
||||
return -ENODEV;
|
||||
|
||||
/* Configure the broadcast timer on each cpu */
|
||||
on_each_cpu(omap_setup_broadcast_timer, NULL, 1);
|
||||
|
||||
return cpuidle_register(idle_driver, cpu_online_mask);
|
||||
}
|
||||
|
|
|
@ -83,6 +83,7 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
|
|||
u32 enable_mask, enable_shift;
|
||||
u32 pipd_mask, pipd_shift;
|
||||
u32 reg;
|
||||
int ret;
|
||||
|
||||
if (dsi_id == 0) {
|
||||
enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
|
||||
|
@ -98,7 +99,11 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®);
|
||||
ret = regmap_read(omap4_dsi_mux_syscon,
|
||||
OMAP4_DSIPHY_SYSCON_OFFSET,
|
||||
®);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
reg &= ~enable_mask;
|
||||
reg &= ~pipd_mask;
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#define OMAP4_NR_BANKS 4
|
||||
#define OMAP4_NR_IRQS 128
|
||||
|
||||
#define SYS_NIRQ1_EXT_SYS_IRQ_1 7
|
||||
#define SYS_NIRQ2_EXT_SYS_IRQ_2 119
|
||||
|
||||
static void __iomem *wakeupgen_base;
|
||||
static void __iomem *sar_base;
|
||||
static DEFINE_RAW_SPINLOCK(wakeupgen_lock);
|
||||
|
@ -153,6 +156,37 @@ static void wakeupgen_unmask(struct irq_data *d)
|
|||
irq_chip_unmask_parent(d);
|
||||
}
|
||||
|
||||
/*
|
||||
* The sys_nirq pins bypass peripheral modules and are wired directly
|
||||
* to MPUSS wakeupgen. They get automatically inverted for GIC.
|
||||
*/
|
||||
static int wakeupgen_irq_set_type(struct irq_data *d, unsigned int type)
|
||||
{
|
||||
bool inverted = false;
|
||||
|
||||
switch (type) {
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
type &= ~IRQ_TYPE_LEVEL_MASK;
|
||||
type |= IRQ_TYPE_LEVEL_HIGH;
|
||||
inverted = true;
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
type &= ~IRQ_TYPE_EDGE_BOTH;
|
||||
type |= IRQ_TYPE_EDGE_RISING;
|
||||
inverted = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (inverted && d->hwirq != SYS_NIRQ1_EXT_SYS_IRQ_1 &&
|
||||
d->hwirq != SYS_NIRQ2_EXT_SYS_IRQ_2)
|
||||
pr_warn("wakeupgen: irq%li polarity inverted in dts\n",
|
||||
d->hwirq);
|
||||
|
||||
return irq_chip_set_type_parent(d, type);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
static DEFINE_PER_CPU(u32 [MAX_NR_REG_BANKS], irqmasks);
|
||||
|
||||
|
@ -446,7 +480,7 @@ static struct irq_chip wakeupgen_chip = {
|
|||
.irq_mask = wakeupgen_mask,
|
||||
.irq_unmask = wakeupgen_unmask,
|
||||
.irq_retrigger = irq_chip_retrigger_hierarchy,
|
||||
.irq_set_type = irq_chip_set_type_parent,
|
||||
.irq_set_type = wakeupgen_irq_set_type,
|
||||
.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND,
|
||||
#ifdef CONFIG_SMP
|
||||
.irq_set_affinity = irq_chip_set_affinity_parent,
|
||||
|
|
|
@ -2390,4 +2390,6 @@ void arch_teardown_dma_ops(struct device *dev)
|
|||
return;
|
||||
|
||||
arm_teardown_iommu_dma_ops(dev);
|
||||
/* Let arch_setup_dma_ops() start again from scratch upon re-probe */
|
||||
set_dma_ops(dev, NULL);
|
||||
}
|
||||
|
|
|
@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
|
|||
}
|
||||
|
||||
/* Copy arch-dep-instance from template. */
|
||||
memcpy(code, (unsigned char *)optprobe_template_entry,
|
||||
memcpy(code, (unsigned long *)&optprobe_template_entry,
|
||||
TMPL_END_IDX * sizeof(kprobe_opcode_t));
|
||||
|
||||
/* Adjust buffer according to instruction. */
|
||||
|
|
|
@ -227,34 +227,34 @@
|
|||
|
||||
pinctrl_usdhc1_100mhz: usdhc1-100grp {
|
||||
fsl,pins = <
|
||||
MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x85
|
||||
MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xc5
|
||||
MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xc5
|
||||
MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x85
|
||||
MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x8d
|
||||
MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xcd
|
||||
MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xcd
|
||||
MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x8d
|
||||
MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B 0xc1
|
||||
>;
|
||||
};
|
||||
|
||||
pinctrl_usdhc1_200mhz: usdhc1-200grp {
|
||||
fsl,pins = <
|
||||
MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x87
|
||||
MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xc7
|
||||
MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xc7
|
||||
MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x87
|
||||
MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x9f
|
||||
MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xdf
|
||||
MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xdf
|
||||
MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x9f
|
||||
MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B 0xc1
|
||||
>;
|
||||
};
|
||||
|
|
|
@ -360,6 +360,8 @@
|
|||
<&clk IMX8MQ_CLK_NAND_USDHC_BUS>,
|
||||
<&clk IMX8MQ_CLK_USDHC1_ROOT>;
|
||||
clock-names = "ipg", "ahb", "per";
|
||||
assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
|
||||
assigned-clock-rates = <400000000>;
|
||||
fsl,tuning-start-tap = <20>;
|
||||
fsl,tuning-step = <2>;
|
||||
bus-width = <4>;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
pinctrl-0 = <&usb30_host_drv>;
|
||||
regulator-name = "vcc_host_5v";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
vin-supply = <&vcc_sys>;
|
||||
};
|
||||
|
||||
|
@ -51,6 +52,7 @@
|
|||
pinctrl-0 = <&usb20_host_drv>;
|
||||
regulator-name = "vcc_host1_5v";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
vin-supply = <&vcc_sys>;
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
backlight = <&backlight>;
|
||||
power-supply = <&pp3300_disp>;
|
||||
|
||||
ports {
|
||||
port {
|
||||
panel_in_edp: endpoint {
|
||||
remote-endpoint = <&edp_out_panel>;
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
backlight = <&backlight>;
|
||||
power-supply = <&pp3300_disp>;
|
||||
|
||||
ports {
|
||||
port {
|
||||
panel_in_edp: endpoint {
|
||||
remote-endpoint = <&edp_out_panel>;
|
||||
};
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
pinctrl-0 = <&lcd_panel_reset>;
|
||||
power-supply = <&vcc3v3_s0>;
|
||||
|
||||
ports {
|
||||
port {
|
||||
panel_in_edp: endpoint {
|
||||
remote-endpoint = <&edp_out_panel>;
|
||||
};
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#define KVM_REQ_SLEEP \
|
||||
KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
|
||||
#define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1)
|
||||
#define KVM_REQ_VCPU_RESET KVM_ARCH_REQ(2)
|
||||
|
||||
DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
|
||||
|
||||
|
@ -208,6 +209,13 @@ struct kvm_cpu_context {
|
|||
|
||||
typedef struct kvm_cpu_context kvm_cpu_context_t;
|
||||
|
||||
struct vcpu_reset_state {
|
||||
unsigned long pc;
|
||||
unsigned long r0;
|
||||
bool be;
|
||||
bool reset;
|
||||
};
|
||||
|
||||
struct kvm_vcpu_arch {
|
||||
struct kvm_cpu_context ctxt;
|
||||
|
||||
|
@ -297,6 +305,9 @@ struct kvm_vcpu_arch {
|
|||
/* Virtual SError ESR to restore when HCR_EL2.VSE is set */
|
||||
u64 vsesr_el2;
|
||||
|
||||
/* Additional reset state */
|
||||
struct vcpu_reset_state reset_state;
|
||||
|
||||
/* True when deferrable sysregs are loaded on the physical CPU,
|
||||
* see kvm_vcpu_load_sysregs and kvm_vcpu_put_sysregs. */
|
||||
bool sysregs_loaded_on_cpu;
|
||||
|
|
|
@ -332,6 +332,17 @@ static inline void *phys_to_virt(phys_addr_t x)
|
|||
#define virt_addr_valid(kaddr) \
|
||||
(_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr))
|
||||
|
||||
/*
|
||||
* Given that the GIC architecture permits ITS implementations that can only be
|
||||
* configured with a LPI table address once, GICv3 systems with many CPUs may
|
||||
* end up reserving a lot of different regions after a kexec for their LPI
|
||||
* tables (one per CPU), as we are forced to reuse the same memory after kexec
|
||||
* (and thus reserve it persistently with EFI beforehand)
|
||||
*/
|
||||
#if defined(CONFIG_EFI) && defined(CONFIG_ARM_GIC_V3_ITS)
|
||||
# define INIT_MEMBLOCK_RESERVED_REGIONS (INIT_MEMBLOCK_REGIONS + NR_CPUS + 1)
|
||||
#endif
|
||||
|
||||
#include <asm-generic/memory_model.h>
|
||||
|
||||
#endif
|
||||
|
|
|
@ -313,7 +313,6 @@ void __init setup_arch(char **cmdline_p)
|
|||
arm64_memblock_init();
|
||||
|
||||
paging_init();
|
||||
efi_apply_persistent_mem_reservations();
|
||||
|
||||
acpi_table_upgrade();
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <kvm/arm_psci.h>
|
||||
|
||||
#include <asm/cpufeature.h>
|
||||
#include <asm/kprobes.h>
|
||||
#include <asm/kvm_asm.h>
|
||||
#include <asm/kvm_emulate.h>
|
||||
#include <asm/kvm_host.h>
|
||||
|
@ -107,6 +108,7 @@ static void activate_traps_vhe(struct kvm_vcpu *vcpu)
|
|||
|
||||
write_sysreg(kvm_get_hyp_vector(), vbar_el1);
|
||||
}
|
||||
NOKPROBE_SYMBOL(activate_traps_vhe);
|
||||
|
||||
static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
|
@ -154,6 +156,7 @@ static void deactivate_traps_vhe(void)
|
|||
write_sysreg(CPACR_EL1_DEFAULT, cpacr_el1);
|
||||
write_sysreg(vectors, vbar_el1);
|
||||
}
|
||||
NOKPROBE_SYMBOL(deactivate_traps_vhe);
|
||||
|
||||
static void __hyp_text __deactivate_traps_nvhe(void)
|
||||
{
|
||||
|
@ -513,6 +516,7 @@ int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
|
|||
|
||||
return exit_code;
|
||||
}
|
||||
NOKPROBE_SYMBOL(kvm_vcpu_run_vhe);
|
||||
|
||||
/* Switch to the guest for legacy non-VHE systems */
|
||||
int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)
|
||||
|
@ -620,6 +624,7 @@ static void __hyp_call_panic_vhe(u64 spsr, u64 elr, u64 par,
|
|||
read_sysreg_el2(esr), read_sysreg_el2(far),
|
||||
read_sysreg(hpfar_el2), par, vcpu);
|
||||
}
|
||||
NOKPROBE_SYMBOL(__hyp_call_panic_vhe);
|
||||
|
||||
void __hyp_text __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt)
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/compiler.h>
|
||||
#include <linux/kvm_host.h>
|
||||
|
||||
#include <asm/kprobes.h>
|
||||
#include <asm/kvm_asm.h>
|
||||
#include <asm/kvm_emulate.h>
|
||||
#include <asm/kvm_hyp.h>
|
||||
|
@ -98,12 +99,14 @@ void sysreg_save_host_state_vhe(struct kvm_cpu_context *ctxt)
|
|||
{
|
||||
__sysreg_save_common_state(ctxt);
|
||||
}
|
||||
NOKPROBE_SYMBOL(sysreg_save_host_state_vhe);
|
||||
|
||||
void sysreg_save_guest_state_vhe(struct kvm_cpu_context *ctxt)
|
||||
{
|
||||
__sysreg_save_common_state(ctxt);
|
||||
__sysreg_save_el2_return_state(ctxt);
|
||||
}
|
||||
NOKPROBE_SYMBOL(sysreg_save_guest_state_vhe);
|
||||
|
||||
static void __hyp_text __sysreg_restore_common_state(struct kvm_cpu_context *ctxt)
|
||||
{
|
||||
|
@ -188,12 +191,14 @@ void sysreg_restore_host_state_vhe(struct kvm_cpu_context *ctxt)
|
|||
{
|
||||
__sysreg_restore_common_state(ctxt);
|
||||
}
|
||||
NOKPROBE_SYMBOL(sysreg_restore_host_state_vhe);
|
||||
|
||||
void sysreg_restore_guest_state_vhe(struct kvm_cpu_context *ctxt)
|
||||
{
|
||||
__sysreg_restore_common_state(ctxt);
|
||||
__sysreg_restore_el2_return_state(ctxt);
|
||||
}
|
||||
NOKPROBE_SYMBOL(sysreg_restore_guest_state_vhe);
|
||||
|
||||
void __hyp_text __sysreg32_save_state(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <asm/kvm_arm.h>
|
||||
#include <asm/kvm_asm.h>
|
||||
#include <asm/kvm_coproc.h>
|
||||
#include <asm/kvm_emulate.h>
|
||||
#include <asm/kvm_mmu.h>
|
||||
|
||||
/* Maximum phys_shift supported for any VM on this host */
|
||||
|
@ -105,16 +106,33 @@ int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext)
|
|||
* This function finds the right table above and sets the registers on
|
||||
* the virtual CPU struct to their architecturally defined reset
|
||||
* values.
|
||||
*
|
||||
* Note: This function can be called from two paths: The KVM_ARM_VCPU_INIT
|
||||
* ioctl or as part of handling a request issued by another VCPU in the PSCI
|
||||
* handling code. In the first case, the VCPU will not be loaded, and in the
|
||||
* second case the VCPU will be loaded. Because this function operates purely
|
||||
* on the memory-backed valus of system registers, we want to do a full put if
|
||||
* we were loaded (handling a request) and load the values back at the end of
|
||||
* the function. Otherwise we leave the state alone. In both cases, we
|
||||
* disable preemption around the vcpu reset as we would otherwise race with
|
||||
* preempt notifiers which also call put/load.
|
||||
*/
|
||||
int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
const struct kvm_regs *cpu_reset;
|
||||
int ret = -EINVAL;
|
||||
bool loaded;
|
||||
|
||||
preempt_disable();
|
||||
loaded = (vcpu->cpu != -1);
|
||||
if (loaded)
|
||||
kvm_arch_vcpu_put(vcpu);
|
||||
|
||||
switch (vcpu->arch.target) {
|
||||
default:
|
||||
if (test_bit(KVM_ARM_VCPU_EL1_32BIT, vcpu->arch.features)) {
|
||||
if (!cpu_has_32bit_el1())
|
||||
return -EINVAL;
|
||||
goto out;
|
||||
cpu_reset = &default_regs_reset32;
|
||||
} else {
|
||||
cpu_reset = &default_regs_reset;
|
||||
|
@ -129,6 +147,29 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
|
|||
/* Reset system registers */
|
||||
kvm_reset_sys_regs(vcpu);
|
||||
|
||||
/*
|
||||
* Additional reset state handling that PSCI may have imposed on us.
|
||||
* Must be done after all the sys_reg reset.
|
||||
*/
|
||||
if (vcpu->arch.reset_state.reset) {
|
||||
unsigned long target_pc = vcpu->arch.reset_state.pc;
|
||||
|
||||
/* Gracefully handle Thumb2 entry point */
|
||||
if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) {
|
||||
target_pc &= ~1UL;
|
||||
vcpu_set_thumb(vcpu);
|
||||
}
|
||||
|
||||
/* Propagate caller endianness */
|
||||
if (vcpu->arch.reset_state.be)
|
||||
kvm_vcpu_set_be(vcpu);
|
||||
|
||||
*vcpu_pc(vcpu) = target_pc;
|
||||
vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0);
|
||||
|
||||
vcpu->arch.reset_state.reset = false;
|
||||
}
|
||||
|
||||
/* Reset PMU */
|
||||
kvm_pmu_vcpu_reset(vcpu);
|
||||
|
||||
|
@ -137,7 +178,12 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
|
|||
vcpu->arch.workaround_flags |= VCPU_WORKAROUND_2_FLAG;
|
||||
|
||||
/* Reset timer */
|
||||
return kvm_timer_vcpu_reset(vcpu);
|
||||
ret = kvm_timer_vcpu_reset(vcpu);
|
||||
out:
|
||||
if (loaded)
|
||||
kvm_arch_vcpu_load(vcpu, smp_processor_id());
|
||||
preempt_enable();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void kvm_set_ipa_limit(void)
|
||||
|
|
|
@ -314,12 +314,29 @@ static bool trap_raz_wi(struct kvm_vcpu *vcpu,
|
|||
return read_zero(vcpu, p);
|
||||
}
|
||||
|
||||
static bool trap_undef(struct kvm_vcpu *vcpu,
|
||||
struct sys_reg_params *p,
|
||||
const struct sys_reg_desc *r)
|
||||
/*
|
||||
* ARMv8.1 mandates at least a trivial LORegion implementation, where all the
|
||||
* RW registers are RES0 (which we can implement as RAZ/WI). On an ARMv8.0
|
||||
* system, these registers should UNDEF. LORID_EL1 being a RO register, we
|
||||
* treat it separately.
|
||||
*/
|
||||
static bool trap_loregion(struct kvm_vcpu *vcpu,
|
||||
struct sys_reg_params *p,
|
||||
const struct sys_reg_desc *r)
|
||||
{
|
||||
kvm_inject_undefined(vcpu);
|
||||
return false;
|
||||
u64 val = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
|
||||
u32 sr = sys_reg((u32)r->Op0, (u32)r->Op1,
|
||||
(u32)r->CRn, (u32)r->CRm, (u32)r->Op2);
|
||||
|
||||
if (!(val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))) {
|
||||
kvm_inject_undefined(vcpu);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p->is_write && sr == SYS_LORID_EL1)
|
||||
return write_to_read_only(vcpu, p, r);
|
||||
|
||||
return trap_raz_wi(vcpu, p, r);
|
||||
}
|
||||
|
||||
static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
|
||||
|
@ -1048,11 +1065,6 @@ static u64 read_id_reg(struct sys_reg_desc const *r, bool raz)
|
|||
if (val & ptrauth_mask)
|
||||
kvm_debug("ptrauth unsupported for guests, suppressing\n");
|
||||
val &= ~ptrauth_mask;
|
||||
} else if (id == SYS_ID_AA64MMFR1_EL1) {
|
||||
if (val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))
|
||||
kvm_debug("LORegions unsupported for guests, suppressing\n");
|
||||
|
||||
val &= ~(0xfUL << ID_AA64MMFR1_LOR_SHIFT);
|
||||
}
|
||||
|
||||
return val;
|
||||
|
@ -1338,11 +1350,11 @@ static const struct sys_reg_desc sys_reg_descs[] = {
|
|||
{ SYS_DESC(SYS_MAIR_EL1), access_vm_reg, reset_unknown, MAIR_EL1 },
|
||||
{ SYS_DESC(SYS_AMAIR_EL1), access_vm_reg, reset_amair_el1, AMAIR_EL1 },
|
||||
|
||||
{ SYS_DESC(SYS_LORSA_EL1), trap_undef },
|
||||
{ SYS_DESC(SYS_LOREA_EL1), trap_undef },
|
||||
{ SYS_DESC(SYS_LORN_EL1), trap_undef },
|
||||
{ SYS_DESC(SYS_LORC_EL1), trap_undef },
|
||||
{ SYS_DESC(SYS_LORID_EL1), trap_undef },
|
||||
{ SYS_DESC(SYS_LORSA_EL1), trap_loregion },
|
||||
{ SYS_DESC(SYS_LOREA_EL1), trap_loregion },
|
||||
{ SYS_DESC(SYS_LORN_EL1), trap_loregion },
|
||||
{ SYS_DESC(SYS_LORC_EL1), trap_loregion },
|
||||
{ SYS_DESC(SYS_LORID_EL1), trap_loregion },
|
||||
|
||||
{ SYS_DESC(SYS_VBAR_EL1), NULL, reset_val, VBAR_EL1, 0 },
|
||||
{ SYS_DESC(SYS_DISR_EL1), NULL, reset_val, DISR_EL1, 0 },
|
||||
|
@ -2596,7 +2608,9 @@ void kvm_reset_sys_regs(struct kvm_vcpu *vcpu)
|
|||
table = get_target_table(vcpu->arch.target, true, &num);
|
||||
reset_sys_reg_descs(vcpu, table, num);
|
||||
|
||||
for (num = 1; num < NR_SYS_REGS; num++)
|
||||
if (__vcpu_sys_reg(vcpu, num) == 0x4242424242424242)
|
||||
panic("Didn't reset __vcpu_sys_reg(%zi)", num);
|
||||
for (num = 1; num < NR_SYS_REGS; num++) {
|
||||
if (WARN(__vcpu_sys_reg(vcpu, num) == 0x4242424242424242,
|
||||
"Didn't reset __vcpu_sys_reg(%zi)\n", num))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset_t(address))
|
||||
#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
|
||||
#define pte_clear(mm, addr, ptep) set_pte((ptep), \
|
||||
(((unsigned int)addr&0x80000000)?__pte(1):__pte(0)))
|
||||
#define pte_none(pte) (!(pte_val(pte)&0xfffffffe))
|
||||
(((unsigned int) addr & PAGE_OFFSET) ? __pte(_PAGE_GLOBAL) : __pte(0)))
|
||||
#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
|
||||
#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
|
||||
#define pte_pfn(x) ((unsigned long)((x).pte_low >> PAGE_SHIFT))
|
||||
#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) \
|
||||
|
@ -241,6 +241,11 @@ static inline pte_t pte_mkyoung(pte_t pte)
|
|||
|
||||
#define pgd_index(address) ((address) >> PGDIR_SHIFT)
|
||||
|
||||
#define __HAVE_PHYS_MEM_ACCESS_PROT
|
||||
struct file;
|
||||
extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
|
||||
unsigned long size, pgprot_t vma_prot);
|
||||
|
||||
/*
|
||||
* Macro to make mark a page protection value as "uncacheable". Note
|
||||
* that "protection" is really a misnomer here as the protection value
|
||||
|
|
|
@ -49,7 +49,7 @@ struct thread_struct {
|
|||
};
|
||||
|
||||
#define INIT_THREAD { \
|
||||
.ksp = (unsigned long) init_thread_union.stack + THREAD_SIZE, \
|
||||
.ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
|
||||
.sr = DEFAULT_PSR_VALUE, \
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ unsigned long get_wchan(struct task_struct *p);
|
|||
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->usp)
|
||||
|
||||
#define task_pt_regs(p) \
|
||||
((struct pt_regs *)(THREAD_SIZE + p->stack) - 1)
|
||||
((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
|
||||
|
||||
#define cpu_relax() barrier()
|
||||
|
||||
|
|
|
@ -38,7 +38,11 @@ void show_stack(struct task_struct *task, unsigned long *stack)
|
|||
if (task)
|
||||
stack = (unsigned long *)thread_saved_fp(task);
|
||||
else
|
||||
#ifdef CONFIG_STACKTRACE
|
||||
asm volatile("mov %0, r8\n":"=r"(stack)::"memory");
|
||||
#else
|
||||
stack = (unsigned long *)&stack;
|
||||
#endif
|
||||
}
|
||||
|
||||
show_trace(stack);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/ptrace.h>
|
||||
#include <linux/regset.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
@ -159,7 +160,7 @@ static int fpr_set(struct task_struct *target,
|
|||
static const struct user_regset csky_regsets[] = {
|
||||
[REGSET_GPR] = {
|
||||
.core_note_type = NT_PRSTATUS,
|
||||
.n = ELF_NGREG,
|
||||
.n = sizeof(struct pt_regs) / sizeof(u32),
|
||||
.size = sizeof(u32),
|
||||
.align = sizeof(u32),
|
||||
.get = &gpr_get,
|
||||
|
|
|
@ -160,7 +160,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
|
|||
{
|
||||
unsigned long mask = 1 << cpu;
|
||||
|
||||
secondary_stack = (unsigned int)tidle->stack + THREAD_SIZE - 8;
|
||||
secondary_stack =
|
||||
(unsigned int) task_stack_page(tidle) + THREAD_SIZE - 8;
|
||||
secondary_hint = mfcr("cr31");
|
||||
secondary_ccr = mfcr("cr18");
|
||||
|
||||
|
|
|
@ -46,3 +46,17 @@ void iounmap(void __iomem *addr)
|
|||
vunmap((void *)((unsigned long)addr & PAGE_MASK));
|
||||
}
|
||||
EXPORT_SYMBOL(iounmap);
|
||||
|
||||
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
|
||||
unsigned long size, pgprot_t vma_prot)
|
||||
{
|
||||
if (!pfn_valid(pfn)) {
|
||||
vma_prot.pgprot |= _PAGE_SO;
|
||||
return pgprot_noncached(vma_prot);
|
||||
} else if (file->f_flags & O_SYNC) {
|
||||
return pgprot_noncached(vma_prot);
|
||||
}
|
||||
|
||||
return vma_prot;
|
||||
}
|
||||
EXPORT_SYMBOL(phys_mem_access_prot);
|
||||
|
|
|
@ -79,8 +79,6 @@ enum reg_val_type {
|
|||
REG_64BIT_32BIT,
|
||||
/* 32-bit compatible, need truncation for 64-bit ops. */
|
||||
REG_32BIT,
|
||||
/* 32-bit zero extended. */
|
||||
REG_32BIT_ZERO_EX,
|
||||
/* 32-bit no sign/zero extension needed. */
|
||||
REG_32BIT_POS
|
||||
};
|
||||
|
@ -343,12 +341,15 @@ static int build_int_epilogue(struct jit_ctx *ctx, int dest_reg)
|
|||
const struct bpf_prog *prog = ctx->skf;
|
||||
int stack_adjust = ctx->stack_size;
|
||||
int store_offset = stack_adjust - 8;
|
||||
enum reg_val_type td;
|
||||
int r0 = MIPS_R_V0;
|
||||
|
||||
if (dest_reg == MIPS_R_RA &&
|
||||
get_reg_val_type(ctx, prog->len, BPF_REG_0) == REG_32BIT_ZERO_EX)
|
||||
if (dest_reg == MIPS_R_RA) {
|
||||
/* Don't let zero extended value escape. */
|
||||
emit_instr(ctx, sll, r0, r0, 0);
|
||||
td = get_reg_val_type(ctx, prog->len, BPF_REG_0);
|
||||
if (td == REG_64BIT)
|
||||
emit_instr(ctx, sll, r0, r0, 0);
|
||||
}
|
||||
|
||||
if (ctx->flags & EBPF_SAVE_RA) {
|
||||
emit_instr(ctx, ld, MIPS_R_RA, store_offset, MIPS_R_SP);
|
||||
|
@ -692,7 +693,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
|||
if (dst < 0)
|
||||
return dst;
|
||||
td = get_reg_val_type(ctx, this_idx, insn->dst_reg);
|
||||
if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) {
|
||||
if (td == REG_64BIT) {
|
||||
/* sign extend */
|
||||
emit_instr(ctx, sll, dst, dst, 0);
|
||||
}
|
||||
|
@ -707,7 +708,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
|||
if (dst < 0)
|
||||
return dst;
|
||||
td = get_reg_val_type(ctx, this_idx, insn->dst_reg);
|
||||
if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) {
|
||||
if (td == REG_64BIT) {
|
||||
/* sign extend */
|
||||
emit_instr(ctx, sll, dst, dst, 0);
|
||||
}
|
||||
|
@ -721,7 +722,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
|||
if (dst < 0)
|
||||
return dst;
|
||||
td = get_reg_val_type(ctx, this_idx, insn->dst_reg);
|
||||
if (td == REG_64BIT || td == REG_32BIT_ZERO_EX)
|
||||
if (td == REG_64BIT)
|
||||
/* sign extend */
|
||||
emit_instr(ctx, sll, dst, dst, 0);
|
||||
if (insn->imm == 1) {
|
||||
|
@ -860,13 +861,13 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
|||
if (src < 0 || dst < 0)
|
||||
return -EINVAL;
|
||||
td = get_reg_val_type(ctx, this_idx, insn->dst_reg);
|
||||
if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) {
|
||||
if (td == REG_64BIT) {
|
||||
/* sign extend */
|
||||
emit_instr(ctx, sll, dst, dst, 0);
|
||||
}
|
||||
did_move = false;
|
||||
ts = get_reg_val_type(ctx, this_idx, insn->src_reg);
|
||||
if (ts == REG_64BIT || ts == REG_32BIT_ZERO_EX) {
|
||||
if (ts == REG_64BIT) {
|
||||
int tmp_reg = MIPS_R_AT;
|
||||
|
||||
if (bpf_op == BPF_MOV) {
|
||||
|
@ -1254,8 +1255,7 @@ jeq_common:
|
|||
if (insn->imm == 64 && td == REG_32BIT)
|
||||
emit_instr(ctx, dinsu, dst, MIPS_R_ZERO, 32, 32);
|
||||
|
||||
if (insn->imm != 64 &&
|
||||
(td == REG_64BIT || td == REG_32BIT_ZERO_EX)) {
|
||||
if (insn->imm != 64 && td == REG_64BIT) {
|
||||
/* sign extend */
|
||||
emit_instr(ctx, sll, dst, dst, 0);
|
||||
}
|
||||
|
|
|
@ -904,7 +904,7 @@ static inline int pud_none(pud_t pud)
|
|||
|
||||
static inline int pud_present(pud_t pud)
|
||||
{
|
||||
return (pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT));
|
||||
return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT));
|
||||
}
|
||||
|
||||
extern struct page *pud_page(pud_t pud);
|
||||
|
@ -951,7 +951,7 @@ static inline int pgd_none(pgd_t pgd)
|
|||
|
||||
static inline int pgd_present(pgd_t pgd)
|
||||
{
|
||||
return (pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
|
||||
return !!(pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
|
||||
}
|
||||
|
||||
static inline pte_t pgd_pte(pgd_t pgd)
|
||||
|
|
|
@ -2278,6 +2278,19 @@ void perf_check_microcode(void)
|
|||
x86_pmu.check_microcode();
|
||||
}
|
||||
|
||||
static int x86_pmu_check_period(struct perf_event *event, u64 value)
|
||||
{
|
||||
if (x86_pmu.check_period && x86_pmu.check_period(event, value))
|
||||
return -EINVAL;
|
||||
|
||||
if (value && x86_pmu.limit_period) {
|
||||
if (x86_pmu.limit_period(event, value) > value)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct pmu pmu = {
|
||||
.pmu_enable = x86_pmu_enable,
|
||||
.pmu_disable = x86_pmu_disable,
|
||||
|
@ -2302,6 +2315,7 @@ static struct pmu pmu = {
|
|||
.event_idx = x86_pmu_event_idx,
|
||||
.sched_task = x86_pmu_sched_task,
|
||||
.task_ctx_size = sizeof(struct x86_perf_task_context),
|
||||
.check_period = x86_pmu_check_period,
|
||||
};
|
||||
|
||||
void arch_perf_update_userpage(struct perf_event *event,
|
||||
|
|
|
@ -3587,6 +3587,11 @@ static void intel_pmu_sched_task(struct perf_event_context *ctx,
|
|||
intel_pmu_lbr_sched_task(ctx, sched_in);
|
||||
}
|
||||
|
||||
static int intel_pmu_check_period(struct perf_event *event, u64 value)
|
||||
{
|
||||
return intel_pmu_has_bts_period(event, value) ? -EINVAL : 0;
|
||||
}
|
||||
|
||||
PMU_FORMAT_ATTR(offcore_rsp, "config1:0-63");
|
||||
|
||||
PMU_FORMAT_ATTR(ldlat, "config1:0-15");
|
||||
|
@ -3667,6 +3672,8 @@ static __initconst const struct x86_pmu core_pmu = {
|
|||
.cpu_starting = intel_pmu_cpu_starting,
|
||||
.cpu_dying = intel_pmu_cpu_dying,
|
||||
.cpu_dead = intel_pmu_cpu_dead,
|
||||
|
||||
.check_period = intel_pmu_check_period,
|
||||
};
|
||||
|
||||
static struct attribute *intel_pmu_attrs[];
|
||||
|
@ -3711,6 +3718,8 @@ static __initconst const struct x86_pmu intel_pmu = {
|
|||
|
||||
.guest_get_msrs = intel_guest_get_msrs,
|
||||
.sched_task = intel_pmu_sched_task,
|
||||
|
||||
.check_period = intel_pmu_check_period,
|
||||
};
|
||||
|
||||
static __init void intel_clovertown_quirk(void)
|
||||
|
|
|
@ -646,6 +646,11 @@ struct x86_pmu {
|
|||
* Intel host/guest support (KVM)
|
||||
*/
|
||||
struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr);
|
||||
|
||||
/*
|
||||
* Check period value for PERF_EVENT_IOC_PERIOD ioctl.
|
||||
*/
|
||||
int (*check_period) (struct perf_event *event, u64 period);
|
||||
};
|
||||
|
||||
struct x86_perf_task_context {
|
||||
|
@ -857,7 +862,7 @@ static inline int amd_pmu_init(void)
|
|||
|
||||
#ifdef CONFIG_CPU_SUP_INTEL
|
||||
|
||||
static inline bool intel_pmu_has_bts(struct perf_event *event)
|
||||
static inline bool intel_pmu_has_bts_period(struct perf_event *event, u64 period)
|
||||
{
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
unsigned int hw_event, bts_event;
|
||||
|
@ -868,7 +873,14 @@ static inline bool intel_pmu_has_bts(struct perf_event *event)
|
|||
hw_event = hwc->config & INTEL_ARCH_EVENT_MASK;
|
||||
bts_event = x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS);
|
||||
|
||||
return hw_event == bts_event && hwc->sample_period == 1;
|
||||
return hw_event == bts_event && period == 1;
|
||||
}
|
||||
|
||||
static inline bool intel_pmu_has_bts(struct perf_event *event)
|
||||
{
|
||||
struct hw_perf_event *hwc = &event->hw;
|
||||
|
||||
return intel_pmu_has_bts_period(event, hwc->sample_period);
|
||||
}
|
||||
|
||||
int intel_pmu_save_and_restart(struct perf_event *event);
|
||||
|
|
|
@ -51,7 +51,7 @@ static unsigned long get_dr(int n)
|
|||
/*
|
||||
* fill in the user structure for a core dump..
|
||||
*/
|
||||
static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
|
||||
static void fill_dump(struct pt_regs *regs, struct user32 *dump)
|
||||
{
|
||||
u32 fs, gs;
|
||||
memset(dump, 0, sizeof(*dump));
|
||||
|
@ -157,10 +157,12 @@ static int aout_core_dump(struct coredump_params *cprm)
|
|||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
has_dumped = 1;
|
||||
|
||||
fill_dump(cprm->regs, &dump);
|
||||
|
||||
strncpy(dump.u_comm, current->comm, sizeof(current->comm));
|
||||
dump.u_ar0 = offsetof(struct user32, regs);
|
||||
dump.signal = cprm->siginfo->si_signo;
|
||||
dump_thread32(cprm->regs, &dump);
|
||||
|
||||
/*
|
||||
* If the size of the dump file exceeds the rlimit, then see
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
|
||||
#define INTEL_FAM6_CANNONLAKE_MOBILE 0x66
|
||||
|
||||
#define INTEL_FAM6_ICELAKE_MOBILE 0x7E
|
||||
|
||||
/* "Small Core" Processors (Atom) */
|
||||
|
||||
#define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
|
||||
|
|
|
@ -48,7 +48,8 @@ enum {
|
|||
BIOS_STATUS_SUCCESS = 0,
|
||||
BIOS_STATUS_UNIMPLEMENTED = -ENOSYS,
|
||||
BIOS_STATUS_EINVAL = -EINVAL,
|
||||
BIOS_STATUS_UNAVAIL = -EBUSY
|
||||
BIOS_STATUS_UNAVAIL = -EBUSY,
|
||||
BIOS_STATUS_ABORT = -EINTR,
|
||||
};
|
||||
|
||||
/* Address map parameters */
|
||||
|
@ -167,4 +168,9 @@ extern long system_serial_number;
|
|||
|
||||
extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */
|
||||
|
||||
/*
|
||||
* EFI runtime lock; cf. firmware/efi/runtime-wrappers.c for details
|
||||
*/
|
||||
extern struct semaphore __efi_uv_runtime_lock;
|
||||
|
||||
#endif /* _ASM_X86_UV_BIOS_H */
|
||||
|
|
|
@ -2473,6 +2473,10 @@ static int nested_check_vm_execution_controls(struct kvm_vcpu *vcpu,
|
|||
(nested_cpu_has_vpid(vmcs12) && !vmcs12->virtual_processor_id))
|
||||
return -EINVAL;
|
||||
|
||||
if (!nested_cpu_has_preemption_timer(vmcs12) &&
|
||||
nested_cpu_has_save_preemption_timer(vmcs12))
|
||||
return -EINVAL;
|
||||
|
||||
if (nested_cpu_has_ept(vmcs12) &&
|
||||
!valid_ept_address(vcpu, vmcs12->ept_pointer))
|
||||
return -EINVAL;
|
||||
|
@ -5557,9 +5561,11 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,
|
|||
* secondary cpu-based controls. Do not include those that
|
||||
* depend on CPUID bits, they are added later by vmx_cpuid_update.
|
||||
*/
|
||||
rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,
|
||||
msrs->secondary_ctls_low,
|
||||
msrs->secondary_ctls_high);
|
||||
if (msrs->procbased_ctls_high & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
|
||||
rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,
|
||||
msrs->secondary_ctls_low,
|
||||
msrs->secondary_ctls_high);
|
||||
|
||||
msrs->secondary_ctls_low = 0;
|
||||
msrs->secondary_ctls_high &=
|
||||
SECONDARY_EXEC_DESC |
|
||||
|
|
|
@ -863,7 +863,8 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,
|
|||
if (!entry_only)
|
||||
j = find_msr(&m->host, msr);
|
||||
|
||||
if (i == NR_AUTOLOAD_MSRS || j == NR_AUTOLOAD_MSRS) {
|
||||
if ((i < 0 && m->guest.nr == NR_AUTOLOAD_MSRS) ||
|
||||
(j < 0 && m->host.nr == NR_AUTOLOAD_MSRS)) {
|
||||
printk_once(KERN_WARNING "Not enough msr switch entries. "
|
||||
"Can't add msr %x\n", msr);
|
||||
return;
|
||||
|
@ -1193,21 +1194,6 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu)
|
|||
if (!pi_test_sn(pi_desc) && vcpu->cpu == cpu)
|
||||
return;
|
||||
|
||||
/*
|
||||
* First handle the simple case where no cmpxchg is necessary; just
|
||||
* allow posting non-urgent interrupts.
|
||||
*
|
||||
* If the 'nv' field is POSTED_INTR_WAKEUP_VECTOR, do not change
|
||||
* PI.NDST: pi_post_block will do it for us and the wakeup_handler
|
||||
* expects the VCPU to be on the blocked_vcpu_list that matches
|
||||
* PI.NDST.
|
||||
*/
|
||||
if (pi_desc->nv == POSTED_INTR_WAKEUP_VECTOR ||
|
||||
vcpu->cpu == cpu) {
|
||||
pi_clear_sn(pi_desc);
|
||||
return;
|
||||
}
|
||||
|
||||
/* The full case. */
|
||||
do {
|
||||
old.control = new.control = pi_desc->control;
|
||||
|
@ -1222,6 +1208,17 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu)
|
|||
new.sn = 0;
|
||||
} while (cmpxchg64(&pi_desc->control, old.control,
|
||||
new.control) != old.control);
|
||||
|
||||
/*
|
||||
* Clear SN before reading the bitmap. The VT-d firmware
|
||||
* writes the bitmap and reads SN atomically (5.2.3 in the
|
||||
* spec), so it doesn't really have a memory barrier that
|
||||
* pairs with this, but we cannot do that and we need one.
|
||||
*/
|
||||
smp_mb__after_atomic();
|
||||
|
||||
if (!bitmap_empty((unsigned long *)pi_desc->pir, NR_VECTORS))
|
||||
pi_set_on(pi_desc);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -337,18 +337,18 @@ static inline int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
|
|||
return test_and_set_bit(vector, (unsigned long *)pi_desc->pir);
|
||||
}
|
||||
|
||||
static inline void pi_clear_sn(struct pi_desc *pi_desc)
|
||||
{
|
||||
return clear_bit(POSTED_INTR_SN,
|
||||
(unsigned long *)&pi_desc->control);
|
||||
}
|
||||
|
||||
static inline void pi_set_sn(struct pi_desc *pi_desc)
|
||||
{
|
||||
return set_bit(POSTED_INTR_SN,
|
||||
(unsigned long *)&pi_desc->control);
|
||||
}
|
||||
|
||||
static inline void pi_set_on(struct pi_desc *pi_desc)
|
||||
{
|
||||
set_bit(POSTED_INTR_ON,
|
||||
(unsigned long *)&pi_desc->control);
|
||||
}
|
||||
|
||||
static inline void pi_clear_on(struct pi_desc *pi_desc)
|
||||
{
|
||||
clear_bit(POSTED_INTR_ON,
|
||||
|
|
|
@ -7801,7 +7801,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
|
|||
* 1) We should set ->mode before checking ->requests. Please see
|
||||
* the comment in kvm_vcpu_exiting_guest_mode().
|
||||
*
|
||||
* 2) For APICv, we should set ->mode before checking PIR.ON. This
|
||||
* 2) For APICv, we should set ->mode before checking PID.ON. This
|
||||
* pairs with the memory barrier implicit in pi_test_and_set_on
|
||||
* (see vmx_deliver_posted_interrupt).
|
||||
*
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
|
||||
struct uv_systab *uv_systab;
|
||||
|
||||
s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
|
||||
static s64 __uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
|
||||
u64 a4, u64 a5)
|
||||
{
|
||||
struct uv_systab *tab = uv_systab;
|
||||
s64 ret;
|
||||
|
@ -51,6 +52,19 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
|
||||
{
|
||||
s64 ret;
|
||||
|
||||
if (down_interruptible(&__efi_uv_runtime_lock))
|
||||
return BIOS_STATUS_ABORT;
|
||||
|
||||
ret = __uv_bios_call(which, a1, a2, a3, a4, a5);
|
||||
up(&__efi_uv_runtime_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(uv_bios_call);
|
||||
|
||||
s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
|
||||
|
@ -59,10 +73,15 @@ s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
|
|||
unsigned long bios_flags;
|
||||
s64 ret;
|
||||
|
||||
if (down_interruptible(&__efi_uv_runtime_lock))
|
||||
return BIOS_STATUS_ABORT;
|
||||
|
||||
local_irq_save(bios_flags);
|
||||
ret = uv_bios_call(which, a1, a2, a3, a4, a5);
|
||||
ret = __uv_bios_call(which, a1, a2, a3, a4, a5);
|
||||
local_irq_restore(bios_flags);
|
||||
|
||||
up(&__efi_uv_runtime_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,8 +122,10 @@ static void alg_do_release(const struct af_alg_type *type, void *private)
|
|||
|
||||
int af_alg_release(struct socket *sock)
|
||||
{
|
||||
if (sock->sk)
|
||||
if (sock->sk) {
|
||||
sock_put(sock->sk);
|
||||
sock->sk = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(af_alg_release);
|
||||
|
|
|
@ -509,7 +509,7 @@ static int ht16k33_remove(struct i2c_client *client)
|
|||
struct ht16k33_priv *priv = i2c_get_clientdata(client);
|
||||
struct ht16k33_fbdev *fbdev = &priv->fbdev;
|
||||
|
||||
cancel_delayed_work(&fbdev->work);
|
||||
cancel_delayed_work_sync(&fbdev->work);
|
||||
unregister_framebuffer(fbdev->info);
|
||||
framebuffer_release(fbdev->info);
|
||||
free_page((unsigned long) fbdev->buffer);
|
||||
|
|
|
@ -781,12 +781,12 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
|
|||
SYSC_QUIRK("smartreflex", 0, -1, 0x38, -1, 0x00000000, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
0),
|
||||
/* Some timers on omap4 and later */
|
||||
SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x50002100, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
0),
|
||||
SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
0),
|
||||
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
/* Uarts on omap4 and later */
|
||||
|
|
|
@ -154,6 +154,10 @@ static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer)
|
|||
if (IS_ERR(parent))
|
||||
return -ENODEV;
|
||||
|
||||
/* Bail out if both clocks point to fck */
|
||||
if (clk_is_match(parent, timer->fclk))
|
||||
return 0;
|
||||
|
||||
ret = clk_set_parent(timer->fclk, parent);
|
||||
if (ret < 0)
|
||||
pr_err("%s: failed to set parent\n", __func__);
|
||||
|
@ -864,7 +868,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
|
|||
timer->pdev = pdev;
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
pm_runtime_irq_safe(dev);
|
||||
|
||||
if (!timer->reserved) {
|
||||
ret = pm_runtime_get_sync(dev);
|
||||
|
|
|
@ -592,11 +592,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz,
|
|||
|
||||
early_memunmap(tbl, sizeof(*tbl));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __init efi_apply_persistent_mem_reservations(void)
|
||||
{
|
||||
if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) {
|
||||
unsigned long prsv = efi.mem_reserve;
|
||||
|
||||
|
|
|
@ -75,9 +75,6 @@ void install_memreserve_table(efi_system_table_t *sys_table_arg)
|
|||
efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;
|
||||
efi_status_t status;
|
||||
|
||||
if (IS_ENABLED(CONFIG_ARM))
|
||||
return;
|
||||
|
||||
status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv),
|
||||
(void **)&rsv);
|
||||
if (status != EFI_SUCCESS) {
|
||||
|
|
|
@ -146,6 +146,13 @@ void efi_call_virt_check_flags(unsigned long flags, const char *call)
|
|||
*/
|
||||
static DEFINE_SEMAPHORE(efi_runtime_lock);
|
||||
|
||||
/*
|
||||
* Expose the EFI runtime lock to the UV platform
|
||||
*/
|
||||
#ifdef CONFIG_X86_UV
|
||||
extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Calls the appropriate efi_runtime_service() with the appropriate
|
||||
* arguments.
|
||||
|
|
|
@ -183,6 +183,15 @@ static void bcm2835_i2c_start_transfer(struct bcm2835_i2c_dev *i2c_dev)
|
|||
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, c);
|
||||
}
|
||||
|
||||
static void bcm2835_i2c_finish_transfer(struct bcm2835_i2c_dev *i2c_dev)
|
||||
{
|
||||
i2c_dev->curr_msg = NULL;
|
||||
i2c_dev->num_msgs = 0;
|
||||
|
||||
i2c_dev->msg_buf = NULL;
|
||||
i2c_dev->msg_buf_remaining = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note about I2C_C_CLEAR on error:
|
||||
* The I2C_C_CLEAR on errors will take some time to resolve -- if you were in
|
||||
|
@ -283,6 +292,9 @@ static int bcm2835_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
|
|||
|
||||
time_left = wait_for_completion_timeout(&i2c_dev->completion,
|
||||
adap->timeout);
|
||||
|
||||
bcm2835_i2c_finish_transfer(i2c_dev);
|
||||
|
||||
if (!time_left) {
|
||||
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,
|
||||
BCM2835_I2C_C_CLEAR);
|
||||
|
|
|
@ -382,8 +382,10 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
|
|||
* Check for the message size against FIFO depth and set the
|
||||
* 'hold bus' bit if it is greater than FIFO depth.
|
||||
*/
|
||||
if (id->recv_count > CDNS_I2C_FIFO_DEPTH)
|
||||
if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
|
||||
ctrl_reg |= CDNS_I2C_CR_HOLD;
|
||||
else
|
||||
ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
|
||||
|
||||
cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
|
||||
|
||||
|
@ -440,8 +442,11 @@ static void cdns_i2c_msend(struct cdns_i2c *id)
|
|||
* Check for the message size against FIFO depth and set the
|
||||
* 'hold bus' bit if it is greater than FIFO depth.
|
||||
*/
|
||||
if (id->send_count > CDNS_I2C_FIFO_DEPTH)
|
||||
if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
|
||||
ctrl_reg |= CDNS_I2C_CR_HOLD;
|
||||
else
|
||||
ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
|
||||
|
||||
cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
|
||||
|
||||
/* Clear the interrupts in interrupt status register. */
|
||||
|
|
|
@ -420,7 +420,7 @@ config KEYBOARD_MPR121
|
|||
|
||||
config KEYBOARD_SNVS_PWRKEY
|
||||
tristate "IMX SNVS Power Key Driver"
|
||||
depends on SOC_IMX6SX
|
||||
depends on SOC_IMX6SX || SOC_IMX7D
|
||||
depends on OF
|
||||
help
|
||||
This is the snvs powerkey driver for the Freescale i.MX application
|
||||
|
|
|
@ -75,9 +75,7 @@
|
|||
struct cap11xx_led {
|
||||
struct cap11xx_priv *priv;
|
||||
struct led_classdev cdev;
|
||||
struct work_struct work;
|
||||
u32 reg;
|
||||
enum led_brightness new_brightness;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -233,30 +231,21 @@ static void cap11xx_input_close(struct input_dev *idev)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_LEDS_CLASS
|
||||
static void cap11xx_led_work(struct work_struct *work)
|
||||
{
|
||||
struct cap11xx_led *led = container_of(work, struct cap11xx_led, work);
|
||||
struct cap11xx_priv *priv = led->priv;
|
||||
int value = led->new_brightness;
|
||||
|
||||
/*
|
||||
* All LEDs share the same duty cycle as this is a HW limitation.
|
||||
* Brightness levels per LED are either 0 (OFF) and 1 (ON).
|
||||
*/
|
||||
regmap_update_bits(priv->regmap, CAP11XX_REG_LED_OUTPUT_CONTROL,
|
||||
BIT(led->reg), value ? BIT(led->reg) : 0);
|
||||
}
|
||||
|
||||
static void cap11xx_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness value)
|
||||
static int cap11xx_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness value)
|
||||
{
|
||||
struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
|
||||
struct cap11xx_priv *priv = led->priv;
|
||||
|
||||
if (led->new_brightness == value)
|
||||
return;
|
||||
|
||||
led->new_brightness = value;
|
||||
schedule_work(&led->work);
|
||||
/*
|
||||
* All LEDs share the same duty cycle as this is a HW
|
||||
* limitation. Brightness levels per LED are either
|
||||
* 0 (OFF) and 1 (ON).
|
||||
*/
|
||||
return regmap_update_bits(priv->regmap,
|
||||
CAP11XX_REG_LED_OUTPUT_CONTROL,
|
||||
BIT(led->reg),
|
||||
value ? BIT(led->reg) : 0);
|
||||
}
|
||||
|
||||
static int cap11xx_init_leds(struct device *dev,
|
||||
|
@ -299,7 +288,7 @@ static int cap11xx_init_leds(struct device *dev,
|
|||
led->cdev.default_trigger =
|
||||
of_get_property(child, "linux,default-trigger", NULL);
|
||||
led->cdev.flags = 0;
|
||||
led->cdev.brightness_set = cap11xx_led_set;
|
||||
led->cdev.brightness_set_blocking = cap11xx_led_set;
|
||||
led->cdev.max_brightness = 1;
|
||||
led->cdev.brightness = LED_OFF;
|
||||
|
||||
|
@ -312,8 +301,6 @@ static int cap11xx_init_leds(struct device *dev,
|
|||
led->reg = reg;
|
||||
led->priv = priv;
|
||||
|
||||
INIT_WORK(&led->work, cap11xx_led_work);
|
||||
|
||||
error = devm_led_classdev_register(dev, &led->cdev);
|
||||
if (error) {
|
||||
of_node_put(child);
|
||||
|
|
|
@ -222,7 +222,7 @@ static void matrix_keypad_stop(struct input_dev *dev)
|
|||
keypad->stopped = true;
|
||||
spin_unlock_irq(&keypad->lock);
|
||||
|
||||
flush_work(&keypad->work.work);
|
||||
flush_delayed_work(&keypad->work);
|
||||
/*
|
||||
* matrix_keypad_scan() will leave IRQs enabled;
|
||||
* we should disable them now.
|
||||
|
|
|
@ -58,10 +58,9 @@ static unsigned char qt2160_key2code[] = {
|
|||
struct qt2160_led {
|
||||
struct qt2160_data *qt2160;
|
||||
struct led_classdev cdev;
|
||||
struct work_struct work;
|
||||
char name[32];
|
||||
int id;
|
||||
enum led_brightness new_brightness;
|
||||
enum led_brightness brightness;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -74,7 +73,6 @@ struct qt2160_data {
|
|||
u16 key_matrix;
|
||||
#ifdef CONFIG_LEDS_CLASS
|
||||
struct qt2160_led leds[QT2160_NUM_LEDS_X];
|
||||
struct mutex led_lock;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -83,46 +81,39 @@ static int qt2160_write(struct i2c_client *client, u8 reg, u8 data);
|
|||
|
||||
#ifdef CONFIG_LEDS_CLASS
|
||||
|
||||
static void qt2160_led_work(struct work_struct *work)
|
||||
{
|
||||
struct qt2160_led *led = container_of(work, struct qt2160_led, work);
|
||||
struct qt2160_data *qt2160 = led->qt2160;
|
||||
struct i2c_client *client = qt2160->client;
|
||||
int value = led->new_brightness;
|
||||
u32 drive, pwmen;
|
||||
|
||||
mutex_lock(&qt2160->led_lock);
|
||||
|
||||
drive = qt2160_read(client, QT2160_CMD_DRIVE_X);
|
||||
pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X);
|
||||
if (value != LED_OFF) {
|
||||
drive |= (1 << led->id);
|
||||
pwmen |= (1 << led->id);
|
||||
|
||||
} else {
|
||||
drive &= ~(1 << led->id);
|
||||
pwmen &= ~(1 << led->id);
|
||||
}
|
||||
qt2160_write(client, QT2160_CMD_DRIVE_X, drive);
|
||||
qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen);
|
||||
|
||||
/*
|
||||
* Changing this register will change the brightness
|
||||
* of every LED in the qt2160. It's a HW limitation.
|
||||
*/
|
||||
if (value != LED_OFF)
|
||||
qt2160_write(client, QT2160_CMD_PWM_DUTY, value);
|
||||
|
||||
mutex_unlock(&qt2160->led_lock);
|
||||
}
|
||||
|
||||
static void qt2160_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness value)
|
||||
static int qt2160_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness value)
|
||||
{
|
||||
struct qt2160_led *led = container_of(cdev, struct qt2160_led, cdev);
|
||||
struct qt2160_data *qt2160 = led->qt2160;
|
||||
struct i2c_client *client = qt2160->client;
|
||||
u32 drive, pwmen;
|
||||
|
||||
led->new_brightness = value;
|
||||
schedule_work(&led->work);
|
||||
if (value != led->brightness) {
|
||||
drive = qt2160_read(client, QT2160_CMD_DRIVE_X);
|
||||
pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X);
|
||||
if (value != LED_OFF) {
|
||||
drive |= BIT(led->id);
|
||||
pwmen |= BIT(led->id);
|
||||
|
||||
} else {
|
||||
drive &= ~BIT(led->id);
|
||||
pwmen &= ~BIT(led->id);
|
||||
}
|
||||
qt2160_write(client, QT2160_CMD_DRIVE_X, drive);
|
||||
qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen);
|
||||
|
||||
/*
|
||||
* Changing this register will change the brightness
|
||||
* of every LED in the qt2160. It's a HW limitation.
|
||||
*/
|
||||
if (value != LED_OFF)
|
||||
qt2160_write(client, QT2160_CMD_PWM_DUTY, value);
|
||||
|
||||
led->brightness = value;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_LEDS_CLASS */
|
||||
|
@ -293,20 +284,16 @@ static int qt2160_register_leds(struct qt2160_data *qt2160)
|
|||
int ret;
|
||||
int i;
|
||||
|
||||
mutex_init(&qt2160->led_lock);
|
||||
|
||||
for (i = 0; i < QT2160_NUM_LEDS_X; i++) {
|
||||
struct qt2160_led *led = &qt2160->leds[i];
|
||||
|
||||
snprintf(led->name, sizeof(led->name), "qt2160:x%d", i);
|
||||
led->cdev.name = led->name;
|
||||
led->cdev.brightness_set = qt2160_led_set;
|
||||
led->cdev.brightness_set_blocking = qt2160_led_set;
|
||||
led->cdev.brightness = LED_OFF;
|
||||
led->id = i;
|
||||
led->qt2160 = qt2160;
|
||||
|
||||
INIT_WORK(&led->work, qt2160_led_work);
|
||||
|
||||
ret = led_classdev_register(&client->dev, &led->cdev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -324,10 +311,8 @@ static void qt2160_unregister_leds(struct qt2160_data *qt2160)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < QT2160_NUM_LEDS_X; i++) {
|
||||
for (i = 0; i < QT2160_NUM_LEDS_X; i++)
|
||||
led_classdev_unregister(&qt2160->leds[i].cdev);
|
||||
cancel_work_sync(&qt2160->leds[i].work);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev)
|
|||
|
||||
input_dev->id.bustype = BUS_HOST;
|
||||
|
||||
keypad_data->input_dev = input_dev;
|
||||
|
||||
error = keypad_matrix_key_parse_dt(keypad_data);
|
||||
if (error)
|
||||
return error;
|
||||
|
@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev)
|
|||
|
||||
input_set_drvdata(input_dev, keypad_data);
|
||||
|
||||
keypad_data->input_dev = input_dev;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(keypad_data->base))
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/input-polldev.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
#define APANEL_NAME "Fujitsu Application Panel"
|
||||
|
@ -59,8 +58,6 @@ struct apanel {
|
|||
struct i2c_client *client;
|
||||
unsigned short keymap[MAX_PANEL_KEYS];
|
||||
u16 nkeys;
|
||||
u16 led_bits;
|
||||
struct work_struct led_work;
|
||||
struct led_classdev mail_led;
|
||||
};
|
||||
|
||||
|
@ -109,25 +106,13 @@ static void apanel_poll(struct input_polled_dev *ipdev)
|
|||
report_key(idev, ap->keymap[i]);
|
||||
}
|
||||
|
||||
/* Track state changes of LED */
|
||||
static void led_update(struct work_struct *work)
|
||||
{
|
||||
struct apanel *ap = container_of(work, struct apanel, led_work);
|
||||
|
||||
i2c_smbus_write_word_data(ap->client, 0x10, ap->led_bits);
|
||||
}
|
||||
|
||||
static void mail_led_set(struct led_classdev *led,
|
||||
static int mail_led_set(struct led_classdev *led,
|
||||
enum led_brightness value)
|
||||
{
|
||||
struct apanel *ap = container_of(led, struct apanel, mail_led);
|
||||
u16 led_bits = value != LED_OFF ? 0x8000 : 0x0000;
|
||||
|
||||
if (value != LED_OFF)
|
||||
ap->led_bits |= 0x8000;
|
||||
else
|
||||
ap->led_bits &= ~0x8000;
|
||||
|
||||
schedule_work(&ap->led_work);
|
||||
return i2c_smbus_write_word_data(ap->client, 0x10, led_bits);
|
||||
}
|
||||
|
||||
static int apanel_remove(struct i2c_client *client)
|
||||
|
@ -179,7 +164,7 @@ static struct apanel apanel = {
|
|||
},
|
||||
.mail_led = {
|
||||
.name = "mail:blue",
|
||||
.brightness_set = mail_led_set,
|
||||
.brightness_set_blocking = mail_led_set,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -235,7 +220,6 @@ static int apanel_probe(struct i2c_client *client,
|
|||
if (err)
|
||||
goto out3;
|
||||
|
||||
INIT_WORK(&ap->led_work, led_update);
|
||||
if (device_chip[APANEL_DEV_LED] != CHIP_NONE) {
|
||||
err = led_classdev_register(&client->dev, &ap->mail_led);
|
||||
if (err)
|
||||
|
|
|
@ -481,13 +481,14 @@ static int bma150_register_input_device(struct bma150_data *bma150)
|
|||
idev->close = bma150_irq_close;
|
||||
input_set_drvdata(idev, bma150);
|
||||
|
||||
bma150->input = idev;
|
||||
|
||||
error = input_register_device(idev);
|
||||
if (error) {
|
||||
input_free_device(idev);
|
||||
return error;
|
||||
}
|
||||
|
||||
bma150->input = idev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -510,15 +511,15 @@ static int bma150_register_polled_device(struct bma150_data *bma150)
|
|||
|
||||
bma150_init_input_device(bma150, ipoll_dev->input);
|
||||
|
||||
bma150->input_polled = ipoll_dev;
|
||||
bma150->input = ipoll_dev->input;
|
||||
|
||||
error = input_register_polled_device(ipoll_dev);
|
||||
if (error) {
|
||||
input_free_polled_device(ipoll_dev);
|
||||
return error;
|
||||
}
|
||||
|
||||
bma150->input_polled = ipoll_dev;
|
||||
bma150->input = ipoll_dev->input;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ struct pwm_vibrator {
|
|||
struct work_struct play_work;
|
||||
u16 level;
|
||||
u32 direction_duty_cycle;
|
||||
bool vcc_on;
|
||||
};
|
||||
|
||||
static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
|
||||
|
@ -42,10 +43,13 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
|
|||
struct pwm_state state;
|
||||
int err;
|
||||
|
||||
err = regulator_enable(vibrator->vcc);
|
||||
if (err) {
|
||||
dev_err(pdev, "failed to enable regulator: %d", err);
|
||||
return err;
|
||||
if (!vibrator->vcc_on) {
|
||||
err = regulator_enable(vibrator->vcc);
|
||||
if (err) {
|
||||
dev_err(pdev, "failed to enable regulator: %d", err);
|
||||
return err;
|
||||
}
|
||||
vibrator->vcc_on = true;
|
||||
}
|
||||
|
||||
pwm_get_state(vibrator->pwm, &state);
|
||||
|
@ -76,11 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
|
|||
|
||||
static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
|
||||
{
|
||||
regulator_disable(vibrator->vcc);
|
||||
|
||||
if (vibrator->pwm_dir)
|
||||
pwm_disable(vibrator->pwm_dir);
|
||||
pwm_disable(vibrator->pwm);
|
||||
|
||||
if (vibrator->vcc_on) {
|
||||
regulator_disable(vibrator->vcc);
|
||||
vibrator->vcc_on = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void pwm_vibrator_play_work(struct work_struct *work)
|
||||
|
|
|
@ -1336,7 +1336,6 @@ MODULE_DEVICE_TABLE(i2c, elan_id);
|
|||
static const struct acpi_device_id elan_acpi_id[] = {
|
||||
{ "ELAN0000", 0 },
|
||||
{ "ELAN0100", 0 },
|
||||
{ "ELAN0501", 0 },
|
||||
{ "ELAN0600", 0 },
|
||||
{ "ELAN0602", 0 },
|
||||
{ "ELAN0605", 0 },
|
||||
|
@ -1346,6 +1345,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
|
|||
{ "ELAN060C", 0 },
|
||||
{ "ELAN0611", 0 },
|
||||
{ "ELAN0612", 0 },
|
||||
{ "ELAN0617", 0 },
|
||||
{ "ELAN0618", 0 },
|
||||
{ "ELAN061C", 0 },
|
||||
{ "ELAN061D", 0 },
|
||||
|
|
|
@ -1119,6 +1119,8 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
|
|||
* Asus UX31 0x361f00 20, 15, 0e clickpad
|
||||
* Asus UX32VD 0x361f02 00, 15, 0e clickpad
|
||||
* Avatar AVIU-145A2 0x361f00 ? clickpad
|
||||
* Fujitsu CELSIUS H760 0x570f02 40, 14, 0c 3 hw buttons (**)
|
||||
* Fujitsu CELSIUS H780 0x5d0f02 41, 16, 0d 3 hw buttons (**)
|
||||
* Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons
|
||||
* Fujitsu LIFEBOOK E546 0x470f00 50, 12, 09 2 hw buttons
|
||||
* Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons
|
||||
|
@ -1171,6 +1173,13 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Fujitsu H780 also has a middle button */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H780"),
|
||||
},
|
||||
},
|
||||
#endif
|
||||
{ }
|
||||
};
|
||||
|
|
|
@ -76,6 +76,7 @@ static void ps2_gpio_close(struct serio *serio)
|
|||
{
|
||||
struct ps2_gpio_data *drvdata = serio->port_data;
|
||||
|
||||
flush_delayed_work(&drvdata->tx_work);
|
||||
disable_irq(drvdata->irq);
|
||||
}
|
||||
|
||||
|
|
|
@ -1396,9 +1396,9 @@ static void flexrm_shutdown(struct mbox_chan *chan)
|
|||
|
||||
/* Clear ring flush state */
|
||||
timeout = 1000; /* timeout of 1s */
|
||||
writel_relaxed(0x0, ring + RING_CONTROL);
|
||||
writel_relaxed(0x0, ring->regs + RING_CONTROL);
|
||||
do {
|
||||
if (!(readl_relaxed(ring + RING_FLUSH_DONE) &
|
||||
if (!(readl_relaxed(ring->regs + RING_FLUSH_DONE) &
|
||||
FLUSH_DONE_MASK))
|
||||
break;
|
||||
mdelay(1);
|
||||
|
|
|
@ -310,6 +310,7 @@ int mbox_flush(struct mbox_chan *chan, unsigned long timeout)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mbox_flush);
|
||||
|
||||
/**
|
||||
* mbox_request_channel - Request a mailbox channel.
|
||||
|
|
|
@ -344,7 +344,8 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)
|
|||
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_CTRL, mgmt);
|
||||
}
|
||||
|
||||
static void b53_enable_vlan(struct b53_device *dev, bool enable)
|
||||
static void b53_enable_vlan(struct b53_device *dev, bool enable,
|
||||
bool enable_filtering)
|
||||
{
|
||||
u8 mgmt, vc0, vc1, vc4 = 0, vc5;
|
||||
|
||||
|
@ -369,8 +370,13 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable)
|
|||
vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID;
|
||||
vc1 |= VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN;
|
||||
vc4 &= ~VC4_ING_VID_CHECK_MASK;
|
||||
vc4 |= VC4_ING_VID_VIO_DROP << VC4_ING_VID_CHECK_S;
|
||||
vc5 |= VC5_DROP_VTABLE_MISS;
|
||||
if (enable_filtering) {
|
||||
vc4 |= VC4_ING_VID_VIO_DROP << VC4_ING_VID_CHECK_S;
|
||||
vc5 |= VC5_DROP_VTABLE_MISS;
|
||||
} else {
|
||||
vc4 |= VC4_ING_VID_VIO_FWD << VC4_ING_VID_CHECK_S;
|
||||
vc5 &= ~VC5_DROP_VTABLE_MISS;
|
||||
}
|
||||
|
||||
if (is5325(dev))
|
||||
vc0 &= ~VC0_RESERVED_1;
|
||||
|
@ -420,6 +426,9 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable)
|
|||
}
|
||||
|
||||
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
|
||||
|
||||
dev->vlan_enabled = enable;
|
||||
dev->vlan_filtering_enabled = enable_filtering;
|
||||
}
|
||||
|
||||
static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100)
|
||||
|
@ -632,25 +641,35 @@ static void b53_enable_mib(struct b53_device *dev)
|
|||
b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc);
|
||||
}
|
||||
|
||||
static u16 b53_default_pvid(struct b53_device *dev)
|
||||
{
|
||||
if (is5325(dev) || is5365(dev))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int b53_configure_vlan(struct dsa_switch *ds)
|
||||
{
|
||||
struct b53_device *dev = ds->priv;
|
||||
struct b53_vlan vl = { 0 };
|
||||
int i;
|
||||
int i, def_vid;
|
||||
|
||||
def_vid = b53_default_pvid(dev);
|
||||
|
||||
/* clear all vlan entries */
|
||||
if (is5325(dev) || is5365(dev)) {
|
||||
for (i = 1; i < dev->num_vlans; i++)
|
||||
for (i = def_vid; i < dev->num_vlans; i++)
|
||||
b53_set_vlan_entry(dev, i, &vl);
|
||||
} else {
|
||||
b53_do_vlan_op(dev, VTA_CMD_CLEAR);
|
||||
}
|
||||
|
||||
b53_enable_vlan(dev, false);
|
||||
b53_enable_vlan(dev, false, dev->vlan_filtering_enabled);
|
||||
|
||||
b53_for_each_port(dev, i)
|
||||
b53_write16(dev, B53_VLAN_PAGE,
|
||||
B53_VLAN_PORT_DEF_TAG(i), 1);
|
||||
B53_VLAN_PORT_DEF_TAG(i), def_vid);
|
||||
|
||||
if (!is5325(dev) && !is5365(dev))
|
||||
b53_set_jumbo(dev, dev->enable_jumbo, false);
|
||||
|
@ -1255,6 +1274,46 @@ EXPORT_SYMBOL(b53_phylink_mac_link_up);
|
|||
|
||||
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering)
|
||||
{
|
||||
struct b53_device *dev = ds->priv;
|
||||
struct net_device *bridge_dev;
|
||||
unsigned int i;
|
||||
u16 pvid, new_pvid;
|
||||
|
||||
/* Handle the case were multiple bridges span the same switch device
|
||||
* and one of them has a different setting than what is being requested
|
||||
* which would be breaking filtering semantics for any of the other
|
||||
* bridge devices.
|
||||
*/
|
||||
b53_for_each_port(dev, i) {
|
||||
bridge_dev = dsa_to_port(ds, i)->bridge_dev;
|
||||
if (bridge_dev &&
|
||||
bridge_dev != dsa_to_port(ds, port)->bridge_dev &&
|
||||
br_vlan_enabled(bridge_dev) != vlan_filtering) {
|
||||
netdev_err(bridge_dev,
|
||||
"VLAN filtering is global to the switch!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), &pvid);
|
||||
new_pvid = pvid;
|
||||
if (dev->vlan_filtering_enabled && !vlan_filtering) {
|
||||
/* Filtering is currently enabled, use the default PVID since
|
||||
* the bridge does not expect tagging anymore
|
||||
*/
|
||||
dev->ports[port].pvid = pvid;
|
||||
new_pvid = b53_default_pvid(dev);
|
||||
} else if (!dev->vlan_filtering_enabled && vlan_filtering) {
|
||||
/* Filtering is currently disabled, restore the previous PVID */
|
||||
new_pvid = dev->ports[port].pvid;
|
||||
}
|
||||
|
||||
if (pvid != new_pvid)
|
||||
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port),
|
||||
new_pvid);
|
||||
|
||||
b53_enable_vlan(dev, dev->vlan_enabled, vlan_filtering);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(b53_vlan_filtering);
|
||||
|
@ -1270,7 +1329,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,
|
|||
if (vlan->vid_end > dev->num_vlans)
|
||||
return -ERANGE;
|
||||
|
||||
b53_enable_vlan(dev, true);
|
||||
b53_enable_vlan(dev, true, dev->vlan_filtering_enabled);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1300,7 +1359,7 @@ void b53_vlan_add(struct dsa_switch *ds, int port,
|
|||
b53_fast_age_vlan(dev, vid);
|
||||
}
|
||||
|
||||
if (pvid) {
|
||||
if (pvid && !dsa_is_cpu_port(ds, port)) {
|
||||
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port),
|
||||
vlan->vid_end);
|
||||
b53_fast_age_vlan(dev, vid);
|
||||
|
@ -1326,12 +1385,8 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
|
|||
|
||||
vl->members &= ~BIT(port);
|
||||
|
||||
if (pvid == vid) {
|
||||
if (is5325(dev) || is5365(dev))
|
||||
pvid = 1;
|
||||
else
|
||||
pvid = 0;
|
||||
}
|
||||
if (pvid == vid)
|
||||
pvid = b53_default_pvid(dev);
|
||||
|
||||
if (untagged && !dsa_is_cpu_port(ds, port))
|
||||
vl->untag &= ~(BIT(port));
|
||||
|
@ -1644,10 +1699,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br)
|
|||
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan);
|
||||
dev->ports[port].vlan_ctl_mask = pvlan;
|
||||
|
||||
if (is5325(dev) || is5365(dev))
|
||||
pvid = 1;
|
||||
else
|
||||
pvid = 0;
|
||||
pvid = b53_default_pvid(dev);
|
||||
|
||||
/* Make this port join all VLANs without VLAN entries */
|
||||
if (is58xx(dev)) {
|
||||
|
|
|
@ -91,6 +91,7 @@ enum {
|
|||
struct b53_port {
|
||||
u16 vlan_ctl_mask;
|
||||
struct ethtool_eee eee;
|
||||
u16 pvid;
|
||||
};
|
||||
|
||||
struct b53_vlan {
|
||||
|
@ -137,6 +138,8 @@ struct b53_device {
|
|||
|
||||
unsigned int num_vlans;
|
||||
struct b53_vlan *vlans;
|
||||
bool vlan_enabled;
|
||||
bool vlan_filtering_enabled;
|
||||
unsigned int num_ports;
|
||||
struct b53_port *ports;
|
||||
};
|
||||
|
|
|
@ -726,10 +726,11 @@ static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port,
|
|||
{
|
||||
struct net_device *p = ds->ports[port].cpu_dp->master;
|
||||
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
|
||||
struct ethtool_wolinfo pwol;
|
||||
struct ethtool_wolinfo pwol = { };
|
||||
|
||||
/* Get the parent device WoL settings */
|
||||
p->ethtool_ops->get_wol(p, &pwol);
|
||||
if (p->ethtool_ops->get_wol)
|
||||
p->ethtool_ops->get_wol(p, &pwol);
|
||||
|
||||
/* Advertise the parent device supported settings */
|
||||
wol->supported = pwol.supported;
|
||||
|
@ -750,9 +751,10 @@ static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port,
|
|||
struct net_device *p = ds->ports[port].cpu_dp->master;
|
||||
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
|
||||
s8 cpu_port = ds->ports[port].cpu_dp->index;
|
||||
struct ethtool_wolinfo pwol;
|
||||
struct ethtool_wolinfo pwol = { };
|
||||
|
||||
p->ethtool_ops->get_wol(p, &pwol);
|
||||
if (p->ethtool_ops->get_wol)
|
||||
p->ethtool_ops->get_wol(p, &pwol);
|
||||
if (wol->wolopts & ~pwol.supported)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
@ -134,6 +134,10 @@ static void bcm_sysport_set_rx_csum(struct net_device *dev,
|
|||
|
||||
priv->rx_chk_en = !!(wanted & NETIF_F_RXCSUM);
|
||||
reg = rxchk_readl(priv, RXCHK_CONTROL);
|
||||
/* Clear L2 header checks, which would prevent BPDUs
|
||||
* from being received.
|
||||
*/
|
||||
reg &= ~RXCHK_L2_HDR_DIS;
|
||||
if (priv->rx_chk_en)
|
||||
reg |= RXCHK_EN;
|
||||
else
|
||||
|
|
|
@ -3128,6 +3128,9 @@ int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset)
|
|||
dsaf_set_bit(credit, DSAF_SBM_ROCEE_CFG_CRD_EN_B, 1);
|
||||
dsaf_write_dev(dsaf_dev, DSAF_SBM_ROCEE_CFG_REG_REG, credit);
|
||||
}
|
||||
|
||||
put_device(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(hns_dsaf_roce_reset);
|
||||
|
|
|
@ -2879,7 +2879,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
|||
|
||||
ret = mv643xx_eth_shared_of_probe(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_put_clk;
|
||||
pd = dev_get_platdata(&pdev->dev);
|
||||
|
||||
msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
|
||||
|
@ -2887,6 +2887,11 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
|||
infer_hw_params(msp);
|
||||
|
||||
return 0;
|
||||
|
||||
err_put_clk:
|
||||
if (!IS_ERR(msp->clk))
|
||||
clk_disable_unprepare(msp->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mv643xx_eth_shared_remove(struct platform_device *pdev)
|
||||
|
|
|
@ -5073,7 +5073,7 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
INIT_WORK(&hw->restart_work, sky2_restart);
|
||||
|
||||
pci_set_drvdata(pdev, hw);
|
||||
pdev->d3_delay = 200;
|
||||
pdev->d3_delay = 300;
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -3360,7 +3360,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
|
|||
dev->addr_len = ETH_ALEN;
|
||||
mlx4_en_u64_to_mac(dev->dev_addr, mdev->dev->caps.def_mac[priv->port]);
|
||||
if (!is_valid_ether_addr(dev->dev_addr)) {
|
||||
en_err(priv, "Port: %d, invalid mac burned: %pM, quiting\n",
|
||||
en_err(priv, "Port: %d, invalid mac burned: %pM, quitting\n",
|
||||
priv->port, dev->dev_addr);
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
|
|
|
@ -862,8 +862,9 @@ int __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu,
|
|||
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
|
||||
bool configure = false;
|
||||
bool pfc = false;
|
||||
u16 thres_cells;
|
||||
u16 delay_cells;
|
||||
bool lossy;
|
||||
u16 thres;
|
||||
|
||||
for (j = 0; j < IEEE_8021QAZ_MAX_TCS; j++) {
|
||||
if (prio_tc[j] == i) {
|
||||
|
@ -877,10 +878,11 @@ int __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu,
|
|||
continue;
|
||||
|
||||
lossy = !(pfc || pause_en);
|
||||
thres = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu);
|
||||
delay = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay, pfc,
|
||||
pause_en);
|
||||
mlxsw_sp_pg_buf_pack(pbmc_pl, i, thres + delay, thres, lossy);
|
||||
thres_cells = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu);
|
||||
delay_cells = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay,
|
||||
pfc, pause_en);
|
||||
mlxsw_sp_pg_buf_pack(pbmc_pl, i, thres_cells + delay_cells,
|
||||
thres_cells, lossy);
|
||||
}
|
||||
|
||||
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl);
|
||||
|
|
|
@ -1688,6 +1688,15 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn,
|
|||
|
||||
eth_hlen = ETH_HLEN + (vlan_valid ? sizeof(u32) : 0);
|
||||
|
||||
if (!ether_addr_equal(ethh->h_dest,
|
||||
p_hwfn->p_rdma_info->iwarp.mac_addr)) {
|
||||
DP_VERBOSE(p_hwfn,
|
||||
QED_MSG_RDMA,
|
||||
"Got unexpected mac %pM instead of %pM\n",
|
||||
ethh->h_dest, p_hwfn->p_rdma_info->iwarp.mac_addr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ether_addr_copy(remote_mac_addr, ethh->h_source);
|
||||
ether_addr_copy(local_mac_addr, ethh->h_dest);
|
||||
|
||||
|
@ -2605,7 +2614,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
|||
struct qed_iwarp_info *iwarp_info;
|
||||
struct qed_ll2_acquire_data data;
|
||||
struct qed_ll2_cbs cbs;
|
||||
u32 mpa_buff_size;
|
||||
u32 buff_size;
|
||||
u16 n_ooo_bufs;
|
||||
int rc = 0;
|
||||
int i;
|
||||
|
@ -2632,7 +2641,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
|||
|
||||
memset(&data, 0, sizeof(data));
|
||||
data.input.conn_type = QED_LL2_TYPE_IWARP;
|
||||
data.input.mtu = QED_IWARP_MAX_SYN_PKT_SIZE;
|
||||
data.input.mtu = params->max_mtu;
|
||||
data.input.rx_num_desc = QED_IWARP_LL2_SYN_RX_SIZE;
|
||||
data.input.tx_num_desc = QED_IWARP_LL2_SYN_TX_SIZE;
|
||||
data.input.tx_max_bds_per_packet = 1; /* will never be fragmented */
|
||||
|
@ -2654,9 +2663,10 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
|||
goto err;
|
||||
}
|
||||
|
||||
buff_size = QED_IWARP_MAX_BUF_SIZE(params->max_mtu);
|
||||
rc = qed_iwarp_ll2_alloc_buffers(p_hwfn,
|
||||
QED_IWARP_LL2_SYN_RX_SIZE,
|
||||
QED_IWARP_MAX_SYN_PKT_SIZE,
|
||||
buff_size,
|
||||
iwarp_info->ll2_syn_handle);
|
||||
if (rc)
|
||||
goto err;
|
||||
|
@ -2710,10 +2720,9 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
|||
if (rc)
|
||||
goto err;
|
||||
|
||||
mpa_buff_size = QED_IWARP_MAX_BUF_SIZE(params->max_mtu);
|
||||
rc = qed_iwarp_ll2_alloc_buffers(p_hwfn,
|
||||
data.input.rx_num_desc,
|
||||
mpa_buff_size,
|
||||
buff_size,
|
||||
iwarp_info->ll2_mpa_handle);
|
||||
if (rc)
|
||||
goto err;
|
||||
|
@ -2726,7 +2735,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
|
|||
|
||||
iwarp_info->max_num_partial_fpdus = (u16)p_hwfn->p_rdma_info->num_qps;
|
||||
|
||||
iwarp_info->mpa_intermediate_buf = kzalloc(mpa_buff_size, GFP_KERNEL);
|
||||
iwarp_info->mpa_intermediate_buf = kzalloc(buff_size, GFP_KERNEL);
|
||||
if (!iwarp_info->mpa_intermediate_buf)
|
||||
goto err;
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ enum qed_iwarp_qp_state qed_roce2iwarp_state(enum qed_roce_qp_state state);
|
|||
|
||||
#define QED_IWARP_LL2_SYN_TX_SIZE (128)
|
||||
#define QED_IWARP_LL2_SYN_RX_SIZE (256)
|
||||
#define QED_IWARP_MAX_SYN_PKT_SIZE (128)
|
||||
|
||||
#define QED_IWARP_LL2_OOO_DEF_TX_SIZE (256)
|
||||
#define QED_IWARP_MAX_OOO (16)
|
||||
|
|
|
@ -241,15 +241,18 @@ static inline void dwmac4_get_timestamp(void *desc, u32 ats, u64 *ts)
|
|||
static int dwmac4_rx_check_timestamp(void *desc)
|
||||
{
|
||||
struct dma_desc *p = (struct dma_desc *)desc;
|
||||
unsigned int rdes0 = le32_to_cpu(p->des0);
|
||||
unsigned int rdes1 = le32_to_cpu(p->des1);
|
||||
unsigned int rdes3 = le32_to_cpu(p->des3);
|
||||
u32 own, ctxt;
|
||||
int ret = 1;
|
||||
|
||||
own = p->des3 & RDES3_OWN;
|
||||
ctxt = ((p->des3 & RDES3_CONTEXT_DESCRIPTOR)
|
||||
own = rdes3 & RDES3_OWN;
|
||||
ctxt = ((rdes3 & RDES3_CONTEXT_DESCRIPTOR)
|
||||
>> RDES3_CONTEXT_DESCRIPTOR_SHIFT);
|
||||
|
||||
if (likely(!own && ctxt)) {
|
||||
if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff))
|
||||
if ((rdes0 == 0xffffffff) && (rdes1 == 0xffffffff))
|
||||
/* Corrupted value */
|
||||
ret = -EINVAL;
|
||||
else
|
||||
|
|
|
@ -696,25 +696,27 @@ static int stmmac_ethtool_op_set_eee(struct net_device *dev,
|
|||
struct ethtool_eee *edata)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
int ret;
|
||||
|
||||
priv->eee_enabled = edata->eee_enabled;
|
||||
|
||||
if (!priv->eee_enabled)
|
||||
if (!edata->eee_enabled) {
|
||||
stmmac_disable_eee_mode(priv);
|
||||
else {
|
||||
} else {
|
||||
/* We are asking for enabling the EEE but it is safe
|
||||
* to verify all by invoking the eee_init function.
|
||||
* In case of failure it will return an error.
|
||||
*/
|
||||
priv->eee_enabled = stmmac_eee_init(priv);
|
||||
if (!priv->eee_enabled)
|
||||
edata->eee_enabled = stmmac_eee_init(priv);
|
||||
if (!edata->eee_enabled)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* Do not change tx_lpi_timer in case of failure */
|
||||
priv->tx_lpi_timer = edata->tx_lpi_timer;
|
||||
}
|
||||
|
||||
return phy_ethtool_set_eee(dev->phydev, edata);
|
||||
ret = phy_ethtool_set_eee(dev->phydev, edata);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
priv->eee_enabled = edata->eee_enabled;
|
||||
priv->tx_lpi_timer = edata->tx_lpi_timer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv)
|
||||
|
|
|
@ -259,7 +259,7 @@ static int netcp_module_probe(struct netcp_device *netcp_device,
|
|||
const char *name;
|
||||
char node_name[32];
|
||||
|
||||
if (of_property_read_string(node, "label", &name) < 0) {
|
||||
if (of_property_read_string(child, "label", &name) < 0) {
|
||||
snprintf(node_name, sizeof(node_name), "%pOFn", child);
|
||||
name = node_name;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,10 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
|
|||
u16 val = 0;
|
||||
int err;
|
||||
|
||||
err = priv->phy_drv->read_status(phydev);
|
||||
if (priv->phy_drv->read_status)
|
||||
err = priv->phy_drv->read_status(phydev);
|
||||
else
|
||||
err = genphy_read_status(phydev);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
|
|
@ -1201,8 +1201,8 @@ static const struct usb_device_id products[] = {
|
|||
{QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
|
||||
{QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
|
||||
{QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
|
||||
{QMI_FIXED_INTF(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354 */
|
||||
{QMI_FIXED_INTF(0x1199, 0x68c0, 10)}, /* Sierra Wireless MC7304/MC7354 */
|
||||
{QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354, WP76xx */
|
||||
{QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 10)},/* Sierra Wireless MC7304/MC7354 */
|
||||
{QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
|
||||
{QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */
|
||||
{QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */
|
||||
|
|
|
@ -557,6 +557,7 @@ enum spd_duplex {
|
|||
/* MAC PASSTHRU */
|
||||
#define AD_MASK 0xfee0
|
||||
#define BND_MASK 0x0004
|
||||
#define BD_MASK 0x0001
|
||||
#define EFUSE 0xcfdb
|
||||
#define PASS_THRU_MASK 0x1
|
||||
|
||||
|
@ -1176,9 +1177,9 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
|
|||
return -ENODEV;
|
||||
}
|
||||
} else {
|
||||
/* test for RTL8153-BND */
|
||||
/* test for RTL8153-BND and RTL8153-BD */
|
||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
|
||||
if ((ocp_data & BND_MASK) == 0) {
|
||||
if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK)) {
|
||||
netif_dbg(tp, probe, tp->netdev,
|
||||
"Invalid variant for MAC pass through\n");
|
||||
return -ENODEV;
|
||||
|
|
|
@ -158,6 +158,32 @@ static const struct ieee80211_ops mt76x0u_ops = {
|
|||
.get_txpower = mt76_get_txpower,
|
||||
};
|
||||
|
||||
static int mt76x0u_init_hardware(struct mt76x02_dev *dev)
|
||||
{
|
||||
int err;
|
||||
|
||||
mt76x0_chip_onoff(dev, true, true);
|
||||
|
||||
if (!mt76x02_wait_for_mac(&dev->mt76))
|
||||
return -ETIMEDOUT;
|
||||
|
||||
err = mt76x0u_mcu_init(dev);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
mt76x0_init_usb_dma(dev);
|
||||
err = mt76x0_init_hardware(dev);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e);
|
||||
mt76_wr(dev, MT_TXOP_CTRL_CFG,
|
||||
FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) |
|
||||
FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt76x0u_register_device(struct mt76x02_dev *dev)
|
||||
{
|
||||
struct ieee80211_hw *hw = dev->mt76.hw;
|
||||
|
@ -171,26 +197,10 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev)
|
|||
if (err < 0)
|
||||
goto out_err;
|
||||
|
||||
mt76x0_chip_onoff(dev, true, true);
|
||||
if (!mt76x02_wait_for_mac(&dev->mt76)) {
|
||||
err = -ETIMEDOUT;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
err = mt76x0u_mcu_init(dev);
|
||||
err = mt76x0u_init_hardware(dev);
|
||||
if (err < 0)
|
||||
goto out_err;
|
||||
|
||||
mt76x0_init_usb_dma(dev);
|
||||
err = mt76x0_init_hardware(dev);
|
||||
if (err < 0)
|
||||
goto out_err;
|
||||
|
||||
mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e);
|
||||
mt76_wr(dev, MT_TXOP_CTRL_CFG,
|
||||
FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) |
|
||||
FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58));
|
||||
|
||||
err = mt76x0_register_device(dev);
|
||||
if (err < 0)
|
||||
goto out_err;
|
||||
|
@ -301,6 +311,8 @@ static int __maybe_unused mt76x0_suspend(struct usb_interface *usb_intf,
|
|||
|
||||
mt76u_stop_queues(&dev->mt76);
|
||||
mt76x0u_mac_stop(dev);
|
||||
clear_bit(MT76_STATE_MCU_RUNNING, &dev->mt76.state);
|
||||
mt76x0_chip_onoff(dev, false, false);
|
||||
usb_kill_urb(usb->mcu.res.urb);
|
||||
|
||||
return 0;
|
||||
|
@ -328,7 +340,7 @@ static int __maybe_unused mt76x0_resume(struct usb_interface *usb_intf)
|
|||
tasklet_enable(&usb->rx_tasklet);
|
||||
tasklet_enable(&usb->tx_tasklet);
|
||||
|
||||
ret = mt76x0_init_hardware(dev);
|
||||
ret = mt76x0u_init_hardware(dev);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
|
|
|
@ -1785,13 +1785,13 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun,
|
|||
|
||||
/* Issue Marker IOCB */
|
||||
qla2x00_marker(vha, vha->hw->req_q_map[0],
|
||||
vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun,
|
||||
vha->hw->rsp_q_map[0], fcport->loop_id, lun,
|
||||
flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID);
|
||||
}
|
||||
|
||||
done_free_sp:
|
||||
sp->free(sp);
|
||||
sp->fcport->flags &= ~FCF_ASYNC_SENT;
|
||||
fcport->flags &= ~FCF_ASYNC_SENT;
|
||||
done:
|
||||
return rval;
|
||||
}
|
||||
|
|
|
@ -2951,9 +2951,6 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
|
|||
if (rot == 1) {
|
||||
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
|
||||
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
|
||||
} else {
|
||||
blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
|
||||
blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
|
||||
}
|
||||
|
||||
if (sdkp->device->type == TYPE_ZBC) {
|
||||
|
@ -3090,6 +3087,15 @@ static int sd_revalidate_disk(struct gendisk *disk)
|
|||
if (sdkp->media_present) {
|
||||
sd_read_capacity(sdkp, buffer);
|
||||
|
||||
/*
|
||||
* set the default to rotational. All non-rotational devices
|
||||
* support the block characteristics VPD page, which will
|
||||
* cause this to be updated correctly and any device which
|
||||
* doesn't support it should be treated as rotational.
|
||||
*/
|
||||
blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
|
||||
blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
|
||||
|
||||
if (scsi_device_supports_vpd(sdp)) {
|
||||
sd_read_block_provisioning(sdkp);
|
||||
sd_read_block_limits(sdkp);
|
||||
|
|
|
@ -1788,7 +1788,7 @@ static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len)
|
|||
|
||||
ret = translate_desc(vq, (uintptr_t)vq->used + used_offset,
|
||||
len, iov, 64, VHOST_ACCESS_WO);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < ret; i++) {
|
||||
|
|
|
@ -14,13 +14,30 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
static inline bool spacetab(char c) { return c == ' ' || c == '\t'; }
|
||||
static inline char *next_non_spacetab(char *first, const char *last)
|
||||
{
|
||||
for (; first <= last; first++)
|
||||
if (!spacetab(*first))
|
||||
return first;
|
||||
return NULL;
|
||||
}
|
||||
static inline char *next_terminator(char *first, const char *last)
|
||||
{
|
||||
for (; first <= last; first++)
|
||||
if (spacetab(*first) || !*first)
|
||||
return first;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int load_script(struct linux_binprm *bprm)
|
||||
{
|
||||
const char *i_arg, *i_name;
|
||||
char *cp;
|
||||
char *cp, *buf_end;
|
||||
struct file *file;
|
||||
int retval;
|
||||
|
||||
/* Not ours to exec if we don't start with "#!". */
|
||||
if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!'))
|
||||
return -ENOEXEC;
|
||||
|
||||
|
@ -33,18 +50,40 @@ static int load_script(struct linux_binprm *bprm)
|
|||
if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE)
|
||||
return -ENOENT;
|
||||
|
||||
/*
|
||||
* This section does the #! interpretation.
|
||||
* Sorta complicated, but hopefully it will work. -TYT
|
||||
*/
|
||||
|
||||
/* Release since we are not mapping a binary into memory. */
|
||||
allow_write_access(bprm->file);
|
||||
fput(bprm->file);
|
||||
bprm->file = NULL;
|
||||
|
||||
bprm->buf[BINPRM_BUF_SIZE - 1] = '\0';
|
||||
if ((cp = strchr(bprm->buf, '\n')) == NULL)
|
||||
cp = bprm->buf+BINPRM_BUF_SIZE-1;
|
||||
/*
|
||||
* This section handles parsing the #! line into separate
|
||||
* interpreter path and argument strings. We must be careful
|
||||
* because bprm->buf is not yet guaranteed to be NUL-terminated
|
||||
* (though the buffer will have trailing NUL padding when the
|
||||
* file size was smaller than the buffer size).
|
||||
*
|
||||
* We do not want to exec a truncated interpreter path, so either
|
||||
* we find a newline (which indicates nothing is truncated), or
|
||||
* we find a space/tab/NUL after the interpreter path (which
|
||||
* itself may be preceded by spaces/tabs). Truncating the
|
||||
* arguments is fine: the interpreter can re-read the script to
|
||||
* parse them on its own.
|
||||
*/
|
||||
buf_end = bprm->buf + sizeof(bprm->buf) - 1;
|
||||
cp = strnchr(bprm->buf, sizeof(bprm->buf), '\n');
|
||||
if (!cp) {
|
||||
cp = next_non_spacetab(bprm->buf + 2, buf_end);
|
||||
if (!cp)
|
||||
return -ENOEXEC; /* Entire buf is spaces/tabs */
|
||||
/*
|
||||
* If there is no later space/tab/NUL we must assume the
|
||||
* interpreter path is truncated.
|
||||
*/
|
||||
if (!next_terminator(cp, buf_end))
|
||||
return -ENOEXEC;
|
||||
cp = buf_end;
|
||||
}
|
||||
/* NUL-terminate the buffer and any trailing spaces/tabs. */
|
||||
*cp = '\0';
|
||||
while (cp > bprm->buf) {
|
||||
cp--;
|
||||
|
|
|
@ -238,9 +238,9 @@ out:
|
|||
}
|
||||
|
||||
/* A writeback failed: mark the page as bad, and invalidate the page cache */
|
||||
static void nfs_set_pageerror(struct page *page)
|
||||
static void nfs_set_pageerror(struct address_space *mapping)
|
||||
{
|
||||
nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page));
|
||||
nfs_zap_mapping(mapping->host, mapping);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -994,7 +994,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
|
|||
nfs_list_remove_request(req);
|
||||
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&
|
||||
(hdr->good_bytes < bytes)) {
|
||||
nfs_set_pageerror(req->wb_page);
|
||||
nfs_set_pageerror(page_file_mapping(req->wb_page));
|
||||
nfs_context_set_write_error(req->wb_context, hdr->error);
|
||||
goto remove_req;
|
||||
}
|
||||
|
@ -1348,7 +1348,8 @@ int nfs_updatepage(struct file *file, struct page *page,
|
|||
unsigned int offset, unsigned int count)
|
||||
{
|
||||
struct nfs_open_context *ctx = nfs_file_open_context(file);
|
||||
struct inode *inode = page_file_mapping(page)->host;
|
||||
struct address_space *mapping = page_file_mapping(page);
|
||||
struct inode *inode = mapping->host;
|
||||
int status = 0;
|
||||
|
||||
nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);
|
||||
|
@ -1366,7 +1367,7 @@ int nfs_updatepage(struct file *file, struct page *page,
|
|||
|
||||
status = nfs_writepage_setup(ctx, page, offset, count);
|
||||
if (status < 0)
|
||||
nfs_set_pageerror(page);
|
||||
nfs_set_pageerror(mapping);
|
||||
else
|
||||
__set_page_dirty_nobuffers(page);
|
||||
out:
|
||||
|
|
|
@ -1239,8 +1239,8 @@ static __net_init int nfsd_init_net(struct net *net)
|
|||
retval = nfsd_idmap_init(net);
|
||||
if (retval)
|
||||
goto out_idmap_error;
|
||||
nn->nfsd4_lease = 45; /* default lease time */
|
||||
nn->nfsd4_grace = 45;
|
||||
nn->nfsd4_lease = 90; /* default lease time */
|
||||
nn->nfsd4_grace = 90;
|
||||
nn->somebody_reclaimed = false;
|
||||
nn->clverifier_counter = prandom_u32();
|
||||
nn->clientid_counter = prandom_u32();
|
||||
|
|
|
@ -100,7 +100,7 @@ enum vgic_irq_config {
|
|||
};
|
||||
|
||||
struct vgic_irq {
|
||||
spinlock_t irq_lock; /* Protects the content of the struct */
|
||||
raw_spinlock_t irq_lock; /* Protects the content of the struct */
|
||||
struct list_head lpi_list; /* Used to link all LPIs together */
|
||||
struct list_head ap_list;
|
||||
|
||||
|
@ -256,7 +256,7 @@ struct vgic_dist {
|
|||
u64 propbaser;
|
||||
|
||||
/* Protects the lpi_list and the count value below. */
|
||||
spinlock_t lpi_list_lock;
|
||||
raw_spinlock_t lpi_list_lock;
|
||||
struct list_head lpi_list_head;
|
||||
int lpi_list_count;
|
||||
|
||||
|
@ -307,7 +307,7 @@ struct vgic_cpu {
|
|||
unsigned int used_lrs;
|
||||
struct vgic_irq private_irqs[VGIC_NR_PRIVATE_IRQS];
|
||||
|
||||
spinlock_t ap_list_lock; /* Protects the ap_list */
|
||||
raw_spinlock_t ap_list_lock; /* Protects the ap_list */
|
||||
|
||||
/*
|
||||
* List of IRQs that this VCPU should consider because they are either
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#ifndef __has_attribute
|
||||
# define __has_attribute(x) __GCC4_has_attribute_##x
|
||||
# define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9)
|
||||
# define __GCC4_has_attribute___copy__ 0
|
||||
# define __GCC4_has_attribute___designated_init__ 0
|
||||
# define __GCC4_has_attribute___externally_visible__ 1
|
||||
# define __GCC4_has_attribute___noclone__ 1
|
||||
|
@ -100,6 +101,19 @@
|
|||
*/
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
|
||||
/*
|
||||
* Optional: only supported since gcc >= 9
|
||||
* Optional: not supported by clang
|
||||
* Optional: not supported by icc
|
||||
*
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-copy-function-attribute
|
||||
*/
|
||||
#if __has_attribute(__copy__)
|
||||
# define __copy(symbol) __attribute__((__copy__(symbol)))
|
||||
#else
|
||||
# define __copy(symbol)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated'
|
||||
* attribute warnings entirely and for good") for more information.
|
||||
|
|
|
@ -1198,8 +1198,6 @@ static inline bool efi_enabled(int feature)
|
|||
extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
|
||||
|
||||
extern bool efi_is_table_address(unsigned long phys_addr);
|
||||
|
||||
extern int efi_apply_persistent_mem_reservations(void);
|
||||
#else
|
||||
static inline bool efi_enabled(int feature)
|
||||
{
|
||||
|
@ -1218,11 +1216,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int efi_apply_persistent_mem_reservations(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int efi_status_to_err(efi_status_t status);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue