Skip to content

Commit

Permalink
Merge branch 'android-4.9-q' of https://android.googlesource.com/kern…
Browse files Browse the repository at this point in the history
…el/common into eleven

* 'android-4.9-q' of https://android.googlesource.com/kernel/common: (247 commits)
  Linux 4.9.276
  seq_file: disallow extremely large seq buffer allocations
  MIPS: vdso: Invalid GIC access through VDSO
  mips: disable branch profiling in boot/decompress.o
  mips: always link byteswap helpers into decompressor
  scsi: be2iscsi: Fix an error handling path in beiscsi_dev_probe()
  ARM: dts: am335x: align ti,pindir-d0-out-d1-in property with dt-shema
  memory: fsl_ifc: fix leak of private memory on probe failure
  memory: fsl_ifc: fix leak of IO mapping on probe failure
  reset: bail if try_module_get() fails
  ARM: dts: r8a7779, marzen: Fix DU clock names
  rtc: fix snprintf() checking in is_rtc_hctosys()
  ARM: dts: exynos: fix PWM LED max brightness on Odroid XU4
  ARM: dts: exynos: fix PWM LED max brightness on Odroid XU/XU3
  hexagon: use common DISCARDS macro
  ALSA: isa: Fix error return code in snd_cmi8330_probe()
  x86/fpu: Limit xstate copy size in xstateregs_set()
  ubifs: Set/Clear I_LINKABLE under i_lock for whiteout inode
  nfs: fix acl memory leak of posix_acl_create()
  watchdog: aspeed: fix hardware timeout calculation
  ...

Change-Id: I180c1fd47c52452d3819ec4b85cfe1522f22caa3
Signed-off-by: PainKiller3 <[email protected]>
  • Loading branch information
PainKiller3 committed Jul 23, 2021
2 parents 51c891d + 9457058 commit 5f71518
Show file tree
Hide file tree
Showing 261 changed files with 1,143 additions and 601 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 275
SUBLEVEL = 276
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/am335x-cm-t335.dts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ status = "okay";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
ti,pindir-d0-out-d1-in = <1>;
ti,pindir-d0-out-d1-in;
/* WLS1271 WiFi */
wlcore: wlcore@1 {
compatible = "ti,wl1271";
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/exynos5422-odroidxu4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
label = "blue:heartbeat";
pwms = <&pwm 2 2000000 0>;
pwm-names = "pwm2";
max_brightness = <255>;
max-brightness = <255>;
linux,default-trigger = "heartbeat";
};
};
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/exynos54xx-odroidxu-leds.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
* Green LED is much brighter than the others
* so limit its max brightness
*/
max_brightness = <127>;
max-brightness = <127>;
linux,default-trigger = "mmc0";
};

blueled {
label = "blue:heartbeat";
pwms = <&pwm 2 2000000 0>;
pwm-names = "pwm2";
max_brightness = <255>;
max-brightness = <255>;
linux,default-trigger = "heartbeat";
};
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/r8a7779-marzen.dts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
status = "okay";

clocks = <&mstp1_clks R8A7779_CLK_DU>, <&x3_clk>;
clock-names = "du", "dclkin.0";
clock-names = "du.0", "dclkin.0";

ports {
port@0 {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/r8a7779.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
reg = <0 0xfff80000 0 0x40000>;
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp1_clks R8A7779_CLK_DU>;
clock-names = "du.0";
power-domains = <&sysc R8A7779_PD_ALWAYS_ON>;
status = "disabled";

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/sama5d4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@
0xffffffff 0x3ffcfe7c 0x1c010101 /* pioA */
0x7fffffff 0xfffccc3a 0x3f00cc3a /* pioB */
0xffffffff 0x3ff83fff 0xff00ffff /* pioC */
0x0003ff00 0x8002a800 0x00000000 /* pioD */
0xb003ff00 0x8002a800 0x00000000 /* pioD */
0xffffffff 0x7fffffff 0x76fff1bf /* pioE */
>;

Expand Down
10 changes: 5 additions & 5 deletions arch/arm/probes/kprobes/test-thumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,21 @@ void kprobe_thumb32_test_cases(void)
"3: mvn r0, r0 \n\t"
"2: nop \n\t")

TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,"]",
TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,", lsl #1]",
"9: \n\t"
".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t"
"3: mvn r0, r0 \n\t"
"2: nop \n\t")

TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,"]",
TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,", lsl #1]",
"9: \n\t"
".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t"
"3: mvn r0, r0 \n\t"
"2: nop \n\t")

TEST_RRX("tbh [r",1,9f, ", r",14,1,"]",
TEST_RRX("tbh [r",1,9f, ", r",14,1,", lsl #1]",
"9: \n\t"
".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t"
Expand All @@ -471,10 +471,10 @@ void kprobe_thumb32_test_cases(void)

TEST_UNSUPPORTED("strexb r0, r1, [r2]")
TEST_UNSUPPORTED("strexh r0, r1, [r2]")
TEST_UNSUPPORTED("strexd r0, r1, [r2]")
TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
TEST_UNSUPPORTED("ldrexb r0, [r1]")
TEST_UNSUPPORTED("ldrexh r0, [r1]")
TEST_UNSUPPORTED("ldrexd r0, [r1]")
TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")

TEST_GROUP("Data-processing (shifted register) and (modified immediate)")

Expand Down
7 changes: 1 addition & 6 deletions arch/hexagon/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,8 @@ SECTIONS

_end = .;

/DISCARD/ : {
EXIT_TEXT
EXIT_DATA
EXIT_CALL
}

STABS_DEBUG
DWARF_DEBUG

DISCARDS
}
2 changes: 1 addition & 1 deletion arch/ia64/kernel/mca_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ init_record_index_pools(void)

/* - 2 - */
sect_min_size = sal_log_sect_min_sizes[0];
for (i = 1; i < sizeof sal_log_sect_min_sizes/sizeof(size_t); i++)
for (i = 1; i < ARRAY_SIZE(sal_log_sect_min_sizes); i++)
if (sect_min_size > sal_log_sect_min_sizes[i])
sect_min_size = sal_log_sect_min_sizes[i];

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
KCOV_INSTRUMENT := n

# decompressor objects (linked with vmlinuz)
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o

ifdef CONFIG_DEBUG_ZBOOT
vmlinuzobjs-$(CONFIG_DEBUG_ZBOOT) += $(obj)/dbg.o
Expand All @@ -47,7 +47,7 @@ extra-y += uart-ath79.c
$(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c
$(call cmd,shipped)

vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o
vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o

extra-y += ashldi3.c bswapsi.c
$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/boot/compressed/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* option) any later version.
*/

#define DISABLE_BRANCH_PROFILING

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
Expand Down
8 changes: 7 additions & 1 deletion arch/mips/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
{
flush_tlb_page(vma, addr & huge_page_mask(hstate_vma(vma)));
/*
* clear the huge pte entry firstly, so that the other smp threads will
* not get old pte entry after finishing flush_tlb_page and before
* setting new huge pte entry
*/
huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
flush_tlb_page(vma, addr);
}

static inline int huge_pte_none(pte_t pte)
Expand Down
10 changes: 7 additions & 3 deletions arch/mips/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ do { \

static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{
pmd_t *pmd;
pmd_t *pmd = NULL;
struct page *pg;

pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, PMD_ORDER);
if (pmd)
pg = alloc_pages(GFP_KERNEL | __GFP_ACCOUNT, PMD_ORDER);
if (pg) {
pgtable_pmd_page_ctor(pg);
pmd = (pmd_t *)page_address(pg);
pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table);
}
return pmd;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/vdso/vdso.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static inline const union mips_vdso_data *get_vdso_data(void)

static inline void __iomem *get_gic(const union mips_vdso_data *data)
{
return (void __iomem *)data - PAGE_SIZE;
return (void __iomem *)((unsigned long)data & PAGE_MASK) - PAGE_SIZE;
}

#endif /* CONFIG_CLKSRC_MIPS_GIC */
Expand Down
59 changes: 34 additions & 25 deletions arch/powerpc/boot/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "string.h"
#include "stdio.h"
#include "ops.h"
#include "of.h"

void dt_fixup_memory(u64 start, u64 size)
{
Expand All @@ -27,31 +28,35 @@ void dt_fixup_memory(u64 start, u64 size)
root = finddevice("/");
if (getprop(root, "#address-cells", &naddr, sizeof(naddr)) < 0)
naddr = 2;
else
naddr = be32_to_cpu(naddr);
if (naddr < 1 || naddr > 2)
fatal("Can't cope with #address-cells == %d in /\n\r", naddr);

if (getprop(root, "#size-cells", &nsize, sizeof(nsize)) < 0)
nsize = 1;
else
nsize = be32_to_cpu(nsize);
if (nsize < 1 || nsize > 2)
fatal("Can't cope with #size-cells == %d in /\n\r", nsize);

i = 0;
if (naddr == 2)
memreg[i++] = start >> 32;
memreg[i++] = start & 0xffffffff;
memreg[i++] = cpu_to_be32(start >> 32);
memreg[i++] = cpu_to_be32(start & 0xffffffff);
if (nsize == 2)
memreg[i++] = size >> 32;
memreg[i++] = size & 0xffffffff;
memreg[i++] = cpu_to_be32(size >> 32);
memreg[i++] = cpu_to_be32(size & 0xffffffff);

memory = finddevice("/memory");
if (! memory) {
memory = create_node(NULL, "memory");
setprop_str(memory, "device_type", "memory");
}

printf("Memory <- <0x%x", memreg[0]);
printf("Memory <- <0x%x", be32_to_cpu(memreg[0]));
for (i = 1; i < (naddr + nsize); i++)
printf(" 0x%x", memreg[i]);
printf(" 0x%x", be32_to_cpu(memreg[i]));
printf("> (%ldMB)\n\r", (unsigned long)(size >> 20));

setprop(memory, "reg", memreg, (naddr + nsize)*sizeof(u32));
Expand All @@ -69,10 +74,10 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
printf("CPU bus-frequency <- 0x%x (%dMHz)\n\r", bus, MHZ(bus));

while ((devp = find_node_by_devtype(devp, "cpu"))) {
setprop_val(devp, "clock-frequency", cpu);
setprop_val(devp, "timebase-frequency", tb);
setprop_val(devp, "clock-frequency", cpu_to_be32(cpu));
setprop_val(devp, "timebase-frequency", cpu_to_be32(tb));
if (bus > 0)
setprop_val(devp, "bus-frequency", bus);
setprop_val(devp, "bus-frequency", cpu_to_be32(bus));
}

timebase_period_ns = 1000000000 / tb;
Expand All @@ -84,7 +89,7 @@ void dt_fixup_clock(const char *path, u32 freq)

if (devp) {
printf("%s: clock-frequency <- %x (%dMHz)\n\r", path, freq, MHZ(freq));
setprop_val(devp, "clock-frequency", freq);
setprop_val(devp, "clock-frequency", cpu_to_be32(freq));
}
}

Expand Down Expand Up @@ -137,8 +142,12 @@ void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize)
{
if (getprop(node, "#address-cells", naddr, 4) != 4)
*naddr = 2;
else
*naddr = be32_to_cpu(*naddr);
if (getprop(node, "#size-cells", nsize, 4) != 4)
*nsize = 1;
else
*nsize = be32_to_cpu(*nsize);
}

static void copy_val(u32 *dest, u32 *src, int naddr)
Expand Down Expand Up @@ -167,9 +176,9 @@ static int add_reg(u32 *reg, u32 *add, int naddr)
int i, carry = 0;

for (i = MAX_ADDR_CELLS - 1; i >= MAX_ADDR_CELLS - naddr; i--) {
u64 tmp = (u64)reg[i] + add[i] + carry;
u64 tmp = (u64)be32_to_cpu(reg[i]) + be32_to_cpu(add[i]) + carry;
carry = tmp >> 32;
reg[i] = (u32)tmp;
reg[i] = cpu_to_be32((u32)tmp);
}

return !carry;
Expand All @@ -184,18 +193,18 @@ static int compare_reg(u32 *reg, u32 *range, u32 *rangesize)
u32 end;

for (i = 0; i < MAX_ADDR_CELLS; i++) {
if (reg[i] < range[i])
if (be32_to_cpu(reg[i]) < be32_to_cpu(range[i]))
return 0;
if (reg[i] > range[i])
if (be32_to_cpu(reg[i]) > be32_to_cpu(range[i]))
break;
}

for (i = 0; i < MAX_ADDR_CELLS; i++) {
end = range[i] + rangesize[i];
end = be32_to_cpu(range[i]) + be32_to_cpu(rangesize[i]);

if (reg[i] < end)
if (be32_to_cpu(reg[i]) < end)
break;
if (reg[i] > end)
if (be32_to_cpu(reg[i]) > end)
return 0;
}

Expand Down Expand Up @@ -244,7 +253,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
return 0;

dt_get_reg_format(parent, &naddr, &nsize);

if (nsize > 2)
return 0;

Expand All @@ -256,10 +264,10 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,

copy_val(last_addr, prop_buf + offset, naddr);

ret_size = prop_buf[offset + naddr];
ret_size = be32_to_cpu(prop_buf[offset + naddr]);
if (nsize == 2) {
ret_size <<= 32;
ret_size |= prop_buf[offset + naddr + 1];
ret_size |= be32_to_cpu(prop_buf[offset + naddr + 1]);
}

for (;;) {
Expand All @@ -282,7 +290,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,

offset = find_range(last_addr, prop_buf, prev_naddr,
naddr, prev_nsize, buflen / 4);

if (offset < 0)
return 0;

Expand All @@ -300,8 +307,7 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
if (naddr > 2)
return 0;

ret_addr = ((u64)last_addr[2] << 32) | last_addr[3];

ret_addr = ((u64)be32_to_cpu(last_addr[2]) << 32) | be32_to_cpu(last_addr[3]);
if (sizeof(void *) == 4 &&
(ret_addr >= 0x100000000ULL || ret_size > 0x100000000ULL ||
ret_addr + ret_size > 0x100000000ULL))
Expand Down Expand Up @@ -354,11 +360,14 @@ int dt_is_compatible(void *node, const char *compat)
int dt_get_virtual_reg(void *node, void **addr, int nres)
{
unsigned long xaddr;
int n;
int n, i;

n = getprop(node, "virtual-reg", addr, nres * 4);
if (n > 0)
if (n > 0) {
for (i = 0; i < n/4; i ++)
((u32 *)addr)[i] = be32_to_cpu(((u32 *)addr)[i]);
return n / 4;
}

for (n = 0; n < nres; n++) {
if (!dt_xlate_reg(node, n, &xaddr, NULL))
Expand Down
Loading

0 comments on commit 5f71518

Please sign in to comment.