Skip to content

Commit 20565c9

Browse files
committed
Merge remote-tracking branch 'stable/linux-4.19.y' into rpi-4.19.y
2 parents 33354f3 + be9b678 commit 20565c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+533
-266
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 19
4-
SUBLEVEL = 59
4+
SUBLEVEL = 60
55
EXTRAVERSION =
66
NAME = "People's Front"
77

arch/arc/kernel/unwind.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ static void *__init unw_hdr_alloc_early(unsigned long sz)
185185
MAX_DMA_ADDRESS);
186186
}
187187

188-
static void *unw_hdr_alloc(unsigned long sz)
189-
{
190-
return kmalloc(sz, GFP_KERNEL);
191-
}
192-
193188
static void init_unwind_table(struct unwind_table *table, const char *name,
194189
const void *core_start, unsigned long core_size,
195190
const void *init_start, unsigned long init_size,
@@ -370,6 +365,10 @@ static void init_unwind_hdr(struct unwind_table *table,
370365
}
371366

372367
#ifdef CONFIG_MODULES
368+
static void *unw_hdr_alloc(unsigned long sz)
369+
{
370+
return kmalloc(sz, GFP_KERNEL);
371+
}
373372

374373
static struct unwind_table *last_table;
375374

arch/arm/boot/dts/gemini-dlink-dns-313.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/ {
1313
model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
14-
compatible = "dlink,dir-313", "cortina,gemini";
14+
compatible = "dlink,dns-313", "cortina,gemini";
1515
#address-cells = <1>;
1616
#size-cells = <1>;
1717

arch/arm/boot/dts/imx6ul.dtsi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
pwm1: pwm@2080000 {
360360
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
361361
reg = <0x02080000 0x4000>;
362-
interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
362+
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
363363
clocks = <&clks IMX6UL_CLK_PWM1>,
364364
<&clks IMX6UL_CLK_PWM1>;
365365
clock-names = "ipg", "per";
@@ -370,7 +370,7 @@
370370
pwm2: pwm@2084000 {
371371
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
372372
reg = <0x02084000 0x4000>;
373-
interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
373+
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
374374
clocks = <&clks IMX6UL_CLK_PWM2>,
375375
<&clks IMX6UL_CLK_PWM2>;
376376
clock-names = "ipg", "per";
@@ -381,7 +381,7 @@
381381
pwm3: pwm@2088000 {
382382
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
383383
reg = <0x02088000 0x4000>;
384-
interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
384+
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
385385
clocks = <&clks IMX6UL_CLK_PWM3>,
386386
<&clks IMX6UL_CLK_PWM3>;
387387
clock-names = "ipg", "per";
@@ -392,7 +392,7 @@
392392
pwm4: pwm@208c000 {
393393
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
394394
reg = <0x0208c000 0x4000>;
395-
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
395+
interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
396396
clocks = <&clks IMX6UL_CLK_PWM4>,
397397
<&clks IMX6UL_CLK_PWM4>;
398398
clock-names = "ipg", "per";

arch/arm/mach-omap2/prm3xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static void omap3_prm_reconfigure_io_chain(void)
433433
* registers, and omap3xxx_prm_reconfigure_io_chain() must be called.
434434
* No return value.
435435
*/
436-
static void __init omap3xxx_prm_enable_io_wakeup(void)
436+
static void omap3xxx_prm_enable_io_wakeup(void)
437437
{
438438
if (prm_features & PRM_HAS_IO_WAKEUP)
439439
omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,

arch/s390/include/asm/facility.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ static inline int test_facility(unsigned long nr)
5959
return __test_facility(nr, &S390_lowcore.stfle_fac_list);
6060
}
6161

62+
static inline unsigned long __stfle_asm(u64 *stfle_fac_list, int size)
63+
{
64+
register unsigned long reg0 asm("0") = size - 1;
65+
66+
asm volatile(
67+
".insn s,0xb2b00000,0(%1)" /* stfle */
68+
: "+d" (reg0)
69+
: "a" (stfle_fac_list)
70+
: "memory", "cc");
71+
return reg0;
72+
}
73+
6274
/**
6375
* stfle - Store facility list extended
6476
* @stfle_fac_list: array where facility list can be stored
@@ -76,13 +88,8 @@ static inline void stfle(u64 *stfle_fac_list, int size)
7688
memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
7789
if (S390_lowcore.stfl_fac_list & 0x01000000) {
7890
/* More facility bits available with stfle */
79-
register unsigned long reg0 asm("0") = size - 1;
80-
81-
asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
82-
: "+d" (reg0)
83-
: "a" (stfle_fac_list)
84-
: "memory", "cc");
85-
nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
91+
nr = __stfle_asm(stfle_fac_list, size);
92+
nr = min_t(unsigned long, (nr + 1) * 8, size * 8);
8693
}
8794
memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
8895
preempt_enable();

arch/x86/entry/entry_32.S

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,30 @@ ENTRY(irq_entries_start)
10981098
.endr
10991099
END(irq_entries_start)
11001100

1101+
#ifdef CONFIG_X86_LOCAL_APIC
1102+
.align 8
1103+
ENTRY(spurious_entries_start)
1104+
vector=FIRST_SYSTEM_VECTOR
1105+
.rept (NR_VECTORS - FIRST_SYSTEM_VECTOR)
1106+
pushl $(~vector+0x80) /* Note: always in signed byte range */
1107+
vector=vector+1
1108+
jmp common_spurious
1109+
.align 8
1110+
.endr
1111+
END(spurious_entries_start)
1112+
1113+
common_spurious:
1114+
ASM_CLAC
1115+
addl $-0x80, (%esp) /* Adjust vector into the [-256, -1] range */
1116+
SAVE_ALL switch_stacks=1
1117+
ENCODE_FRAME_POINTER
1118+
TRACE_IRQS_OFF
1119+
movl %esp, %eax
1120+
call smp_spurious_interrupt
1121+
jmp ret_from_intr
1122+
ENDPROC(common_spurious)
1123+
#endif
1124+
11011125
/*
11021126
* the CPU automatically disables interrupts when executing an IRQ vector,
11031127
* so IRQ-flags tracing has to follow that:

arch/x86/entry/entry_64.S

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,18 @@ ENTRY(irq_entries_start)
438438
.endr
439439
END(irq_entries_start)
440440

441+
.align 8
442+
ENTRY(spurious_entries_start)
443+
vector=FIRST_SYSTEM_VECTOR
444+
.rept (NR_VECTORS - FIRST_SYSTEM_VECTOR)
445+
UNWIND_HINT_IRET_REGS
446+
pushq $(~vector+0x80) /* Note: always in signed byte range */
447+
jmp common_spurious
448+
.align 8
449+
vector=vector+1
450+
.endr
451+
END(spurious_entries_start)
452+
441453
.macro DEBUG_ENTRY_ASSERT_IRQS_OFF
442454
#ifdef CONFIG_DEBUG_ENTRY
443455
pushq %rax
@@ -634,10 +646,20 @@ _ASM_NOKPROBE(interrupt_entry)
634646

635647
/* Interrupt entry/exit. */
636648

637-
/*
638-
* The interrupt stubs push (~vector+0x80) onto the stack and
639-
* then jump to common_interrupt.
640-
*/
649+
/*
650+
* The interrupt stubs push (~vector+0x80) onto the stack and
651+
* then jump to common_spurious/interrupt.
652+
*/
653+
common_spurious:
654+
addq $-0x80, (%rsp) /* Adjust vector to [-256, -1] range */
655+
call interrupt_entry
656+
UNWIND_HINT_REGS indirect=1
657+
call smp_spurious_interrupt /* rdi points to pt_regs */
658+
jmp ret_from_intr
659+
END(common_spurious)
660+
_ASM_NOKPROBE(common_spurious)
661+
662+
/* common_interrupt is a hotpath. Align it */
641663
.p2align CONFIG_X86_L1_CACHE_SHIFT
642664
common_interrupt:
643665
addq $-0x80, (%rsp) /* Adjust vector to [-256, -1] range */

arch/x86/include/asm/hw_irq.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ extern char irq_entries_start[];
150150
#define trace_irq_entries_start irq_entries_start
151151
#endif
152152

153+
extern char spurious_entries_start[];
154+
153155
#define VECTOR_UNUSED NULL
154-
#define VECTOR_RETRIGGERED ((void *)~0UL)
156+
#define VECTOR_SHUTDOWN ((void *)~0UL)
157+
#define VECTOR_RETRIGGERED ((void *)~1UL)
155158

156159
typedef struct irq_desc* vector_irq_t[NR_VECTORS];
157160
DECLARE_PER_CPU(vector_irq_t, vector_irq);

arch/x86/kernel/apic/apic.c

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,8 @@ static void apic_pending_intr_clear(void)
14521452
if (queued) {
14531453
if (boot_cpu_has(X86_FEATURE_TSC) && cpu_khz) {
14541454
ntsc = rdtsc();
1455-
max_loops = (cpu_khz << 10) - (ntsc - tsc);
1455+
max_loops = (long long)cpu_khz << 10;
1456+
max_loops -= ntsc - tsc;
14561457
} else {
14571458
max_loops--;
14581459
}
@@ -2026,21 +2027,32 @@ __visible void __irq_entry smp_spurious_interrupt(struct pt_regs *regs)
20262027
entering_irq();
20272028
trace_spurious_apic_entry(vector);
20282029

2030+
inc_irq_stat(irq_spurious_count);
2031+
2032+
/*
2033+
* If this is a spurious interrupt then do not acknowledge
2034+
*/
2035+
if (vector == SPURIOUS_APIC_VECTOR) {
2036+
/* See SDM vol 3 */
2037+
pr_info("Spurious APIC interrupt (vector 0xFF) on CPU#%d, should never happen.\n",
2038+
smp_processor_id());
2039+
goto out;
2040+
}
2041+
20292042
/*
2030-
* Check if this really is a spurious interrupt and ACK it
2031-
* if it is a vectored one. Just in case...
2032-
* Spurious interrupts should not be ACKed.
2043+
* If it is a vectored one, verify it's set in the ISR. If set,
2044+
* acknowledge it.
20332045
*/
20342046
v = apic_read(APIC_ISR + ((vector & ~0x1f) >> 1));
2035-
if (v & (1 << (vector & 0x1f)))
2047+
if (v & (1 << (vector & 0x1f))) {
2048+
pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Acked\n",
2049+
vector, smp_processor_id());
20362050
ack_APIC_irq();
2037-
2038-
inc_irq_stat(irq_spurious_count);
2039-
2040-
/* see sw-dev-man vol 3, chapter 7.4.13.5 */
2041-
pr_info("spurious APIC interrupt through vector %02x on CPU#%d, "
2042-
"should never happen.\n", vector, smp_processor_id());
2043-
2051+
} else {
2052+
pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Not pending!\n",
2053+
vector, smp_processor_id());
2054+
}
2055+
out:
20442056
trace_spurious_apic_exit(vector);
20452057
exiting_irq();
20462058
}

arch/x86/kernel/apic/io_apic.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,50 @@ static int ioapic_set_affinity(struct irq_data *irq_data,
18911891
return ret;
18921892
}
18931893

1894+
/*
1895+
* Interrupt shutdown masks the ioapic pin, but the interrupt might already
1896+
* be in flight, but not yet serviced by the target CPU. That means
1897+
* __synchronize_hardirq() would return and claim that everything is calmed
1898+
* down. So free_irq() would proceed and deactivate the interrupt and free
1899+
* resources.
1900+
*
1901+
* Once the target CPU comes around to service it it will find a cleared
1902+
* vector and complain. While the spurious interrupt is harmless, the full
1903+
* release of resources might prevent the interrupt from being acknowledged
1904+
* which keeps the hardware in a weird state.
1905+
*
1906+
* Verify that the corresponding Remote-IRR bits are clear.
1907+
*/
1908+
static int ioapic_irq_get_chip_state(struct irq_data *irqd,
1909+
enum irqchip_irq_state which,
1910+
bool *state)
1911+
{
1912+
struct mp_chip_data *mcd = irqd->chip_data;
1913+
struct IO_APIC_route_entry rentry;
1914+
struct irq_pin_list *p;
1915+
1916+
if (which != IRQCHIP_STATE_ACTIVE)
1917+
return -EINVAL;
1918+
1919+
*state = false;
1920+
raw_spin_lock(&ioapic_lock);
1921+
for_each_irq_pin(p, mcd->irq_2_pin) {
1922+
rentry = __ioapic_read_entry(p->apic, p->pin);
1923+
/*
1924+
* The remote IRR is only valid in level trigger mode. It's
1925+
* meaning is undefined for edge triggered interrupts and
1926+
* irrelevant because the IO-APIC treats them as fire and
1927+
* forget.
1928+
*/
1929+
if (rentry.irr && rentry.trigger) {
1930+
*state = true;
1931+
break;
1932+
}
1933+
}
1934+
raw_spin_unlock(&ioapic_lock);
1935+
return 0;
1936+
}
1937+
18941938
static struct irq_chip ioapic_chip __read_mostly = {
18951939
.name = "IO-APIC",
18961940
.irq_startup = startup_ioapic_irq,
@@ -1900,6 +1944,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
19001944
.irq_eoi = ioapic_ack_level,
19011945
.irq_set_affinity = ioapic_set_affinity,
19021946
.irq_retrigger = irq_chip_retrigger_hierarchy,
1947+
.irq_get_irqchip_state = ioapic_irq_get_chip_state,
19031948
.flags = IRQCHIP_SKIP_SET_WAKE,
19041949
};
19051950

@@ -1912,6 +1957,7 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
19121957
.irq_eoi = ioapic_ir_ack_level,
19131958
.irq_set_affinity = ioapic_set_affinity,
19141959
.irq_retrigger = irq_chip_retrigger_hierarchy,
1960+
.irq_get_irqchip_state = ioapic_irq_get_chip_state,
19151961
.flags = IRQCHIP_SKIP_SET_WAKE,
19161962
};
19171963

arch/x86/kernel/apic/vector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static void clear_irq_vector(struct irq_data *irqd)
342342
trace_vector_clear(irqd->irq, vector, apicd->cpu, apicd->prev_vector,
343343
apicd->prev_cpu);
344344

345-
per_cpu(vector_irq, apicd->cpu)[vector] = VECTOR_UNUSED;
345+
per_cpu(vector_irq, apicd->cpu)[vector] = VECTOR_SHUTDOWN;
346346
irq_matrix_free(vector_matrix, apicd->cpu, vector, managed);
347347
apicd->vector = 0;
348348

@@ -351,7 +351,7 @@ static void clear_irq_vector(struct irq_data *irqd)
351351
if (!vector)
352352
return;
353353

354-
per_cpu(vector_irq, apicd->prev_cpu)[vector] = VECTOR_UNUSED;
354+
per_cpu(vector_irq, apicd->prev_cpu)[vector] = VECTOR_SHUTDOWN;
355355
irq_matrix_free(vector_matrix, apicd->prev_cpu, vector, managed);
356356
apicd->prev_vector = 0;
357357
apicd->move_in_progress = 0;

arch/x86/kernel/head64.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,24 +184,25 @@ unsigned long __head __startup_64(unsigned long physaddr,
184184
pgtable_flags = _KERNPG_TABLE_NOENC + sme_get_me_mask();
185185

186186
if (la57) {
187-
p4d = fixup_pointer(early_dynamic_pgts[next_early_pgt++], physaddr);
187+
p4d = fixup_pointer(early_dynamic_pgts[(*next_pgt_ptr)++],
188+
physaddr);
188189

189190
i = (physaddr >> PGDIR_SHIFT) % PTRS_PER_PGD;
190191
pgd[i + 0] = (pgdval_t)p4d + pgtable_flags;
191192
pgd[i + 1] = (pgdval_t)p4d + pgtable_flags;
192193

193-
i = (physaddr >> P4D_SHIFT) % PTRS_PER_P4D;
194-
p4d[i + 0] = (pgdval_t)pud + pgtable_flags;
195-
p4d[i + 1] = (pgdval_t)pud + pgtable_flags;
194+
i = physaddr >> P4D_SHIFT;
195+
p4d[(i + 0) % PTRS_PER_P4D] = (pgdval_t)pud + pgtable_flags;
196+
p4d[(i + 1) % PTRS_PER_P4D] = (pgdval_t)pud + pgtable_flags;
196197
} else {
197198
i = (physaddr >> PGDIR_SHIFT) % PTRS_PER_PGD;
198199
pgd[i + 0] = (pgdval_t)pud + pgtable_flags;
199200
pgd[i + 1] = (pgdval_t)pud + pgtable_flags;
200201
}
201202

202-
i = (physaddr >> PUD_SHIFT) % PTRS_PER_PUD;
203-
pud[i + 0] = (pudval_t)pmd + pgtable_flags;
204-
pud[i + 1] = (pudval_t)pmd + pgtable_flags;
203+
i = physaddr >> PUD_SHIFT;
204+
pud[(i + 0) % PTRS_PER_PUD] = (pudval_t)pmd + pgtable_flags;
205+
pud[(i + 1) % PTRS_PER_PUD] = (pudval_t)pmd + pgtable_flags;
205206

206207
pmd_entry = __PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL;
207208
/* Filter out unsupported __PAGE_KERNEL_* bits: */
@@ -211,8 +212,9 @@ unsigned long __head __startup_64(unsigned long physaddr,
211212
pmd_entry += physaddr;
212213

213214
for (i = 0; i < DIV_ROUND_UP(_end - _text, PMD_SIZE); i++) {
214-
int idx = i + (physaddr >> PMD_SHIFT) % PTRS_PER_PMD;
215-
pmd[idx] = pmd_entry + i * PMD_SIZE;
215+
int idx = i + (physaddr >> PMD_SHIFT);
216+
217+
pmd[idx % PTRS_PER_PMD] = pmd_entry + i * PMD_SIZE;
216218
}
217219

218220
/*

0 commit comments

Comments
 (0)