Skip to content

Commit 1b3bf84

Browse files
author
Russell King
committed
Merge branches 'amba', 'fixes', 'misc' and 'tauros2' into for-next
5 parents 18558ca + 656b803 + f474c8c + b426867 + 1d93ba2 commit 1b3bf84

File tree

59 files changed

+975
-377
lines changed

Some content is hidden

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

59 files changed

+975
-377
lines changed

Documentation/DMA-attributes.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,29 @@ allocated by dma_alloc_attrs() function from individual pages if it can
100100
be mapped as contiguous chunk into device dma address space. By
101101
specifying this attribute the allocated buffer is forced to be contiguous
102102
also in physical memory.
103+
104+
DMA_ATTR_ALLOC_SINGLE_PAGES
105+
---------------------------
106+
107+
This is a hint to the DMA-mapping subsystem that it's probably not worth
108+
the time to try to allocate memory to in a way that gives better TLB
109+
efficiency (AKA it's not worth trying to build the mapping out of larger
110+
pages). You might want to specify this if:
111+
- You know that the accesses to this memory won't thrash the TLB.
112+
You might know that the accesses are likely to be sequential or
113+
that they aren't sequential but it's unlikely you'll ping-pong
114+
between many addresses that are likely to be in different physical
115+
pages.
116+
- You know that the penalty of TLB misses while accessing the
117+
memory will be small enough to be inconsequential. If you are
118+
doing a heavy operation like decryption or decompression this
119+
might be the case.
120+
- You know that the DMA mapping is fairly transitory. If you expect
121+
the mapping to have a short lifetime then it may be worth it to
122+
optimize allocation (avoid coming up with large pages) instead of
123+
getting the slight performance win of larger pages.
124+
Setting this hint doesn't guarantee that you won't get huge pages, but it
125+
means that we won't try quite as hard to get them.
126+
127+
NOTE: At the moment DMA_ATTR_ALLOC_SINGLE_PAGES is only implemented on ARM,
128+
though ARM64 patches will likely be posted soon.

Documentation/driver-model/porting.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,10 @@ comparison:
340340

341341
int (*match)(struct device * dev, struct device_driver * drv);
342342

343-
match should return '1' if the driver supports the device, and '0'
344-
otherwise.
343+
match should return positive value if the driver supports the device,
344+
and zero otherwise. It may also return error code (for example
345+
-EPROBE_DEFER) if determining that given driver supports the device is
346+
not possible.
345347

346348
When a device is registered, the bus's list of drivers is iterated
347349
over. bus->match() is called for each one until a match is found.

arch/arm/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ config ARCH_RPC
572572
select NEED_MACH_IO_H
573573
select NEED_MACH_MEMORY_H
574574
select NO_IOPORT_MAP
575-
select VIRT_TO_BUS
576575
help
577576
On the Acorn Risc-PC, Linux can support the internal IDE disk and
578577
CD-ROM interface, serial and parallel port, and the floppy drive.
@@ -1337,7 +1336,6 @@ config BIG_LITTLE
13371336
config BL_SWITCHER
13381337
bool "big.LITTLE switcher support"
13391338
depends on BIG_LITTLE && MCPM && HOTPLUG_CPU && ARM_GIC
1340-
select ARM_CPU_SUSPEND
13411339
select CPU_PM
13421340
help
13431341
The big.LITTLE "switcher" provides the core functionality to
@@ -2111,7 +2109,8 @@ config ARCH_SUSPEND_POSSIBLE
21112109
def_bool y
21122110

21132111
config ARM_CPU_SUSPEND
2114-
def_bool PM_SLEEP
2112+
def_bool PM_SLEEP || BL_SWITCHER || ARM_PSCI_FW
2113+
depends on ARCH_SUSPEND_POSSIBLE
21152114

21162115
config ARCH_HIBERNATION_POSSIBLE
21172116
bool

arch/arm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ archclean:
352352

353353
# My testing targets (bypasses dependencies)
354354
bp:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage
355-
i zi:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
356355

357356

358357
define archhelp

arch/arm/boot/Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
8888
$(call if_changed,objcopy)
8989
@$(kecho) ' Kernel: $@ is ready'
9090

91-
PHONY += initrd FORCE
91+
PHONY += initrd
9292
initrd:
9393
@test "$(INITRD_PHYS)" != "" || \
9494
(echo This machine does not support INITRD; exit -1)
@@ -107,12 +107,4 @@ uinstall:
107107
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
108108
$(obj)/uImage System.map "$(INSTALL_PATH)"
109109

110-
zi:
111-
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
112-
$(obj)/zImage System.map "$(INSTALL_PATH)"
113-
114-
i:
115-
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
116-
$(obj)/Image System.map "$(INSTALL_PATH)"
117-
118110
subdir- := bootp compressed dts

arch/arm/boot/compressed/.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ bswapsdi2.S
33
font.c
44
lib1funcs.S
55
hyp-stub.S
6-
piggy.gzip
7-
piggy.lzo
8-
piggy.lzma
9-
piggy.xzkern
10-
piggy.lz4
6+
piggy_data
117
vmlinux
128
vmlinux.lds
139

arch/arm/boot/compressed/Makefile

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ endif
6666

6767
CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
6868

69-
suffix_$(CONFIG_KERNEL_GZIP) = gzip
70-
suffix_$(CONFIG_KERNEL_LZO) = lzo
71-
suffix_$(CONFIG_KERNEL_LZMA) = lzma
72-
suffix_$(CONFIG_KERNEL_XZ) = xzkern
73-
suffix_$(CONFIG_KERNEL_LZ4) = lz4
69+
compress-$(CONFIG_KERNEL_GZIP) = gzip
70+
compress-$(CONFIG_KERNEL_LZO) = lzo
71+
compress-$(CONFIG_KERNEL_LZMA) = lzma
72+
compress-$(CONFIG_KERNEL_XZ) = xzkern
73+
compress-$(CONFIG_KERNEL_LZ4) = lz4
7474

7575
# Borrowed libfdt files for the ATAG compatibility mode
7676

@@ -89,15 +89,12 @@ ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
8989
OBJS += $(libfdt_objs) atags_to_fdt.o
9090
endif
9191

92-
targets := vmlinux vmlinux.lds \
93-
piggy.$(suffix_y) piggy.$(suffix_y).o \
94-
lib1funcs.o lib1funcs.S ashldi3.o ashldi3.S bswapsdi2.o \
95-
bswapsdi2.S font.o font.c head.o misc.o $(OBJS)
92+
targets := vmlinux vmlinux.lds piggy_data piggy.o \
93+
lib1funcs.o ashldi3.o bswapsdi2.o \
94+
head.o $(OBJS)
9695

97-
# Make sure files are removed during clean
98-
extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern piggy.lz4 \
99-
lib1funcs.S ashldi3.S bswapsdi2.S $(libfdt) $(libfdt_hdrs) \
100-
hyp-stub.S
96+
clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S \
97+
$(libfdt) $(libfdt_hdrs) hyp-stub.S
10198

10299
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
103100

@@ -178,22 +175,24 @@ fi
178175

179176
efi-obj-$(CONFIG_EFI_STUB) := $(objtree)/drivers/firmware/efi/libstub/lib.a
180177

181-
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
178+
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
182179
$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) \
183180
$(bswapsdi2) $(efi-obj-y) FORCE
184181
@$(check_for_multiple_zreladdr)
185182
$(call if_changed,ld)
186183
@$(check_for_bad_syms)
187184

188-
$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
189-
$(call if_changed,$(suffix_y))
185+
$(obj)/piggy_data: $(obj)/../Image FORCE
186+
$(call if_changed,$(compress-y))
190187

191-
$(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE
188+
$(obj)/piggy.o: $(obj)/piggy_data
192189

193190
CFLAGS_font.o := -Dstatic=
194191

195192
$(obj)/font.c: $(FONTC)
196193
$(call cmd,shipped)
197194

195+
AFLAGS_hyp-stub.o := -Wa,-march=armv7-a
196+
198197
$(obj)/hyp-stub.S: $(srctree)/arch/$(SRCARCH)/kernel/hyp-stub.S
199198
$(call cmd,shipped)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.section .piggydata,#alloc
22
.globl input_data
33
input_data:
4-
.incbin "arch/arm/boot/compressed/piggy.gzip"
4+
.incbin "arch/arm/boot/compressed/piggy_data"
55
.globl input_data_end
66
input_data_end:

arch/arm/boot/compressed/piggy.lz4.S

Lines changed: 0 additions & 6 deletions
This file was deleted.

arch/arm/boot/compressed/piggy.lzma.S

Lines changed: 0 additions & 6 deletions
This file was deleted.

arch/arm/boot/compressed/piggy.lzo.S

Lines changed: 0 additions & 6 deletions
This file was deleted.

arch/arm/boot/compressed/piggy.xzkern.S

Lines changed: 0 additions & 6 deletions
This file was deleted.

arch/arm/common/sa1111.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv)
12901290
struct sa1111_dev *dev = SA1111_DEV(_dev);
12911291
struct sa1111_driver *drv = SA1111_DRV(_drv);
12921292

1293-
return dev->devid & drv->devid;
1293+
return !!(dev->devid & drv->devid);
12941294
}
12951295

12961296
static int sa1111_bus_suspend(struct device *dev, pm_message_t state)

arch/arm/include/asm/Kbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ generic-y += preempt.h
2323
generic-y += resource.h
2424
generic-y += rwsem.h
2525
generic-y += seccomp.h
26-
generic-y += sections.h
2726
generic-y += segment.h
2827
generic-y += sembuf.h
2928
generic-y += serial.h

arch/arm/include/asm/div64.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
7474
static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias)
7575
{
7676
unsigned long long res;
77-
unsigned int tmp = 0;
77+
register unsigned int tmp asm("ip") = 0;
7878

7979
if (!bias) {
8080
asm ( "umull %Q0, %R0, %Q1, %Q2\n\t"
@@ -90,12 +90,12 @@ static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias)
9090
: "r" (m), "r" (n)
9191
: "cc");
9292
} else {
93-
asm ( "umull %Q0, %R0, %Q1, %Q2\n\t"
94-
"cmn %Q0, %Q1\n\t"
95-
"adcs %R0, %R0, %R1\n\t"
96-
"adc %Q0, %3, #0"
97-
: "=&r" (res)
98-
: "r" (m), "r" (n), "r" (tmp)
93+
asm ( "umull %Q0, %R0, %Q2, %Q3\n\t"
94+
"cmn %Q0, %Q2\n\t"
95+
"adcs %R0, %R0, %R2\n\t"
96+
"adc %Q0, %1, #0"
97+
: "=&r" (res), "+&r" (tmp)
98+
: "r" (m), "r" (n)
9999
: "cc");
100100
}
101101

arch/arm/include/asm/memory.h

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,21 @@
134134
*/
135135
#define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
136136

137+
#ifdef CONFIG_XIP_KERNEL
138+
/*
139+
* When referencing data in RAM from the XIP region in a relative manner
140+
* with the MMU off, we need the relative offset between the two physical
141+
* addresses. The macro below achieves this, which is:
142+
* __pa(v_data) - __xip_pa(v_text)
143+
*/
144+
#define PHYS_RELATIVE(v_data, v_text) \
145+
(((v_data) - PAGE_OFFSET + PLAT_PHYS_OFFSET) - \
146+
((v_text) - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) + \
147+
CONFIG_XIP_PHYS_ADDR))
148+
#else
149+
#define PHYS_RELATIVE(v_data, v_text) ((v_data) - (v_text))
150+
#endif
151+
137152
#ifndef __ASSEMBLY__
138153

139154
/*
@@ -273,14 +288,14 @@ static inline void *phys_to_virt(phys_addr_t x)
273288
#define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x)))
274289
#define pfn_to_kaddr(pfn) __va((phys_addr_t)(pfn) << PAGE_SHIFT)
275290

276-
extern phys_addr_t (*arch_virt_to_idmap)(unsigned long x);
291+
extern unsigned long (*arch_virt_to_idmap)(unsigned long x);
277292

278293
/*
279294
* These are for systems that have a hardware interconnect supported alias of
280295
* physical memory for idmap purposes. Most cases should leave these
281-
* untouched.
296+
* untouched. Note: this can only return addresses less than 4GiB.
282297
*/
283-
static inline phys_addr_t __virt_to_idmap(unsigned long x)
298+
static inline unsigned long __virt_to_idmap(unsigned long x)
284299
{
285300
if (IS_ENABLED(CONFIG_MMU) && arch_virt_to_idmap)
286301
return arch_virt_to_idmap(x);
@@ -303,20 +318,6 @@ static inline phys_addr_t __virt_to_idmap(unsigned long x)
303318
#define __bus_to_pfn(x) __phys_to_pfn(x)
304319
#endif
305320

306-
#ifdef CONFIG_VIRT_TO_BUS
307-
#define virt_to_bus virt_to_bus
308-
static inline __deprecated unsigned long virt_to_bus(void *x)
309-
{
310-
return __virt_to_bus((unsigned long)x);
311-
}
312-
313-
#define bus_to_virt bus_to_virt
314-
static inline __deprecated void *bus_to_virt(unsigned long x)
315-
{
316-
return (void *)__bus_to_virt(x);
317-
}
318-
#endif
319-
320321
/*
321322
* Conversion between a struct page and a physical address.
322323
*

arch/arm/include/asm/mmu_context.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ void __check_vmalloc_seq(struct mm_struct *mm);
2626
#ifdef CONFIG_CPU_HAS_ASID
2727

2828
void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk);
29-
#define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.id, 0); 0; })
29+
static inline int
30+
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
31+
{
32+
atomic64_set(&mm->context.id, 0);
33+
return 0;
34+
}
3035

3136
#ifdef CONFIG_ARM_ERRATA_798181
3237
void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm,
@@ -85,7 +90,12 @@ static inline void finish_arch_post_lock_switch(void)
8590

8691
#endif /* CONFIG_MMU */
8792

88-
#define init_new_context(tsk,mm) 0
93+
static inline int
94+
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
95+
{
96+
return 0;
97+
}
98+
8999

90100
#endif /* CONFIG_CPU_HAS_ASID */
91101

arch/arm/include/asm/sections.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef _ASM_ARM_SECTIONS_H
2+
#define _ASM_ARM_SECTIONS_H
3+
4+
#include <asm-generic/sections.h>
5+
6+
extern char _exiprom[];
7+
8+
#endif /* _ASM_ARM_SECTIONS_H */

arch/arm/include/asm/sparsemem.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* Eg, if you have 2 banks of up to 64MB at 0x80000000, 0x84000000,
1616
* then MAX_PHYSMEM_BITS is 32, SECTION_SIZE_BITS is 26.
1717
*
18-
* Define these in your mach/memory.h.
18+
* These can be overridden in your mach/memory.h.
1919
*/
20-
#if !defined(SECTION_SIZE_BITS) || !defined(MAX_PHYSMEM_BITS)
21-
#error Sparsemem is not supported on this platform
20+
#if !defined(MAX_PHYSMEM_BITS) || !defined(SECTION_SIZE_BITS)
21+
#define MAX_PHYSMEM_BITS 36
22+
#define SECTION_SIZE_BITS 28
2223
#endif
2324

2425
#endif

arch/arm/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ obj-$(CONFIG_DEBUG_LL) += debug.o
8888
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
8989

9090
obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
91+
AFLAGS_hyp-stub.o :=-Wa,-march=armv7-a
9192
ifeq ($(CONFIG_ARM_PSCI),y)
9293
obj-$(CONFIG_SMP) += psci_smp.o
9394
endif

0 commit comments

Comments
 (0)