Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Browse files Browse the repository at this point in the history
Pull ARM updates from Russell King:
 "Another mixture of changes this time around:

   - Split XIP linker file from main linker file to make it more
     maintainable, and various XIP fixes, and clean up a resulting
     macro.

   - Decompressor cleanups from Masahiro Yamada

   - Avoid printing an error for a missing L2 cache

   - Remove some duplicated symbols in System.map, and move
     vectors/stubs back into kernel VMA

   - Various low priority fixes from Arnd

   - Updates to allow bus match functions to return negative errno
     values, touching some drivers and the driver core.  Greg has acked
     these changes.

   - Virtualisation platform udpates form Jean-Philippe Brucker.

   - Security enhancements from Kees Cook

   - Rework some Kconfig dependencies and move PSCI idle management code
     out of arch/arm into drivers/firmware/psci.c

   - ARM DMA mapping updates, touching media, acked by Mauro.

   - Fix places in ARM code which should be using virt_to_idmap() so
     that Keystone2 can work.

   - Fix Marvell Tauros2 to work again with non-DT boots.

   - Provide a delay timer for ARM Orion platforms"

* 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (45 commits)
  ARM: 8546/1: dma-mapping: refactor to fix coherent+cma+gfp=0
  ARM: 8547/1: dma-mapping: store buffer information
  ARM: 8543/1: decompressor: rename suffix_y to compress-y
  ARM: 8542/1: decompressor: merge piggy.*.S and simplify Makefile
  ARM: 8541/1: decompressor: drop redundant FORCE in Makefile
  ARM: 8540/1: decompressor: use clean-files instead of extra-y to clean files
  ARM: 8539/1: decompressor: drop more unneeded assignments to "targets"
  ARM: 8538/1: decompressor: drop unneeded assignments to "targets"
  ARM: 8532/1: uncompress: mark putc as inline
  ARM: 8531/1: turn init_new_context into an inline function
  ARM: 8530/1: remove VIRT_TO_BUS
  ARM: 8537/1: drop unused DEBUG_RODATA from XIP_KERNEL
  ARM: 8536/1: mm: hide __start_rodata_section_aligned for non-debug builds
  ARM: 8535/1: mm: DEBUG_RODATA makes no sense with XIP_KERNEL
  ARM: 8534/1: virt: fix hyp-stub build for pre-ARMv7 CPUs
  ARM: make the physical-relative calculation more obvious
  ARM: 8512/1: proc-v7.S: Adjust stack address when XIP_KERNEL
  ARM: 8411/1: Add default SPARSEMEM settings
  ARM: 8503/1: clk_register_clkdev: remove format string interface
  ARM: 8529/1: remove 'i' and 'zi' targets
  ...
  • Loading branch information
torvalds committed Mar 19, 2016
2 parents b31a3bc + 1b3bf84 commit de06dbf
Show file tree
Hide file tree
Showing 57 changed files with 969 additions and 377 deletions.
26 changes: 26 additions & 0 deletions Documentation/DMA-attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,29 @@ allocated by dma_alloc_attrs() function from individual pages if it can
be mapped as contiguous chunk into device dma address space. By
specifying this attribute the allocated buffer is forced to be contiguous
also in physical memory.

DMA_ATTR_ALLOC_SINGLE_PAGES
---------------------------

This is a hint to the DMA-mapping subsystem that it's probably not worth
the time to try to allocate memory to in a way that gives better TLB
efficiency (AKA it's not worth trying to build the mapping out of larger
pages). You might want to specify this if:
- You know that the accesses to this memory won't thrash the TLB.
You might know that the accesses are likely to be sequential or
that they aren't sequential but it's unlikely you'll ping-pong
between many addresses that are likely to be in different physical
pages.
- You know that the penalty of TLB misses while accessing the
memory will be small enough to be inconsequential. If you are
doing a heavy operation like decryption or decompression this
might be the case.
- You know that the DMA mapping is fairly transitory. If you expect
the mapping to have a short lifetime then it may be worth it to
optimize allocation (avoid coming up with large pages) instead of
getting the slight performance win of larger pages.
Setting this hint doesn't guarantee that you won't get huge pages, but it
means that we won't try quite as hard to get them.

NOTE: At the moment DMA_ATTR_ALLOC_SINGLE_PAGES is only implemented on ARM,
though ARM64 patches will likely be posted soon.
6 changes: 4 additions & 2 deletions Documentation/driver-model/porting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ comparison:

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

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

When a device is registered, the bus's list of drivers is iterated
over. bus->match() is called for each one until a match is found.
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ config ARCH_RPC
select NEED_MACH_IO_H
select NEED_MACH_MEMORY_H
select NO_IOPORT_MAP
select VIRT_TO_BUS
help
On the Acorn Risc-PC, Linux can support the internal IDE disk and
CD-ROM interface, serial and parallel port, and the floppy drive.
Expand Down Expand Up @@ -1336,7 +1335,6 @@ config BIG_LITTLE
config BL_SWITCHER
bool "big.LITTLE switcher support"
depends on BIG_LITTLE && MCPM && HOTPLUG_CPU && ARM_GIC
select ARM_CPU_SUSPEND
select CPU_PM
help
The big.LITTLE "switcher" provides the core functionality to
Expand Down Expand Up @@ -2110,7 +2108,8 @@ config ARCH_SUSPEND_POSSIBLE
def_bool y

config ARM_CPU_SUSPEND
def_bool PM_SLEEP
def_bool PM_SLEEP || BL_SWITCHER || ARM_PSCI_FW
depends on ARCH_SUSPEND_POSSIBLE

config ARCH_HIBERNATION_POSSIBLE
bool
Expand Down
1 change: 0 additions & 1 deletion arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ archclean:

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


define archhelp
Expand Down
10 changes: 1 addition & 9 deletions arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
$(call if_changed,objcopy)
@$(kecho) ' Kernel: $@ is ready'

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

zi:
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
$(obj)/zImage System.map "$(INSTALL_PATH)"

i:
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
$(obj)/Image System.map "$(INSTALL_PATH)"

subdir- := bootp compressed dts
6 changes: 1 addition & 5 deletions arch/arm/boot/compressed/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ bswapsdi2.S
font.c
lib1funcs.S
hyp-stub.S
piggy.gzip
piggy.lzo
piggy.lzma
piggy.xzkern
piggy.lz4
piggy_data
vmlinux
vmlinux.lds

Expand Down
31 changes: 14 additions & 17 deletions arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ endif

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

suffix_$(CONFIG_KERNEL_GZIP) = gzip
suffix_$(CONFIG_KERNEL_LZO) = lzo
suffix_$(CONFIG_KERNEL_LZMA) = lzma
suffix_$(CONFIG_KERNEL_XZ) = xzkern
suffix_$(CONFIG_KERNEL_LZ4) = lz4
compress-$(CONFIG_KERNEL_GZIP) = gzip
compress-$(CONFIG_KERNEL_LZO) = lzo
compress-$(CONFIG_KERNEL_LZMA) = lzma
compress-$(CONFIG_KERNEL_XZ) = xzkern
compress-$(CONFIG_KERNEL_LZ4) = lz4

# Borrowed libfdt files for the ATAG compatibility mode

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

targets := vmlinux vmlinux.lds \
piggy.$(suffix_y) piggy.$(suffix_y).o \
lib1funcs.o lib1funcs.S ashldi3.o ashldi3.S bswapsdi2.o \
bswapsdi2.S font.o font.c head.o misc.o $(OBJS)
targets := vmlinux vmlinux.lds piggy_data piggy.o \
lib1funcs.o ashldi3.o bswapsdi2.o \
head.o $(OBJS)

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

KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING

Expand Down Expand Up @@ -178,17 +175,17 @@ fi

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

$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) \
$(bswapsdi2) $(efi-obj-y) FORCE
@$(check_for_multiple_zreladdr)
$(call if_changed,ld)
@$(check_for_bad_syms)

$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
$(call if_changed,$(suffix_y))
$(obj)/piggy_data: $(obj)/../Image FORCE
$(call if_changed,$(compress-y))

$(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE
$(obj)/piggy.o: $(obj)/piggy_data

CFLAGS_font.o := -Dstatic=

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.section .piggydata,#alloc
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.gzip"
.incbin "arch/arm/boot/compressed/piggy_data"
.globl input_data_end
input_data_end:
6 changes: 0 additions & 6 deletions arch/arm/boot/compressed/piggy.lz4.S

This file was deleted.

6 changes: 0 additions & 6 deletions arch/arm/boot/compressed/piggy.lzma.S

This file was deleted.

6 changes: 0 additions & 6 deletions arch/arm/boot/compressed/piggy.lzo.S

This file was deleted.

6 changes: 0 additions & 6 deletions arch/arm/boot/compressed/piggy.xzkern.S

This file was deleted.

2 changes: 1 addition & 1 deletion arch/arm/common/sa1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv)
struct sa1111_dev *dev = SA1111_DEV(_dev);
struct sa1111_driver *drv = SA1111_DRV(_drv);

return dev->devid & drv->devid;
return !!(dev->devid & drv->devid);
}

static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
Expand Down
1 change: 0 additions & 1 deletion arch/arm/include/asm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ generic-y += preempt.h
generic-y += resource.h
generic-y += rwsem.h
generic-y += seccomp.h
generic-y += sections.h
generic-y += segment.h
generic-y += sembuf.h
generic-y += serial.h
Expand Down
14 changes: 7 additions & 7 deletions arch/arm/include/asm/div64.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias)
{
unsigned long long res;
unsigned int tmp = 0;
register unsigned int tmp asm("ip") = 0;

if (!bias) {
asm ( "umull %Q0, %R0, %Q1, %Q2\n\t"
Expand All @@ -90,12 +90,12 @@ static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias)
: "r" (m), "r" (n)
: "cc");
} else {
asm ( "umull %Q0, %R0, %Q1, %Q2\n\t"
"cmn %Q0, %Q1\n\t"
"adcs %R0, %R0, %R1\n\t"
"adc %Q0, %3, #0"
: "=&r" (res)
: "r" (m), "r" (n), "r" (tmp)
asm ( "umull %Q0, %R0, %Q2, %Q3\n\t"
"cmn %Q0, %Q2\n\t"
"adcs %R0, %R0, %R2\n\t"
"adc %Q0, %1, #0"
: "=&r" (res), "+&r" (tmp)
: "r" (m), "r" (n)
: "cc");
}

Expand Down
35 changes: 18 additions & 17 deletions arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,21 @@
*/
#define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)

#ifdef CONFIG_XIP_KERNEL
/*
* When referencing data in RAM from the XIP region in a relative manner
* with the MMU off, we need the relative offset between the two physical
* addresses. The macro below achieves this, which is:
* __pa(v_data) - __xip_pa(v_text)
*/
#define PHYS_RELATIVE(v_data, v_text) \
(((v_data) - PAGE_OFFSET + PLAT_PHYS_OFFSET) - \
((v_text) - XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) + \
CONFIG_XIP_PHYS_ADDR))
#else
#define PHYS_RELATIVE(v_data, v_text) ((v_data) - (v_text))
#endif

#ifndef __ASSEMBLY__

/*
Expand Down Expand Up @@ -273,14 +288,14 @@ static inline void *phys_to_virt(phys_addr_t x)
#define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x)))
#define pfn_to_kaddr(pfn) __va((phys_addr_t)(pfn) << PAGE_SHIFT)

extern phys_addr_t (*arch_virt_to_idmap)(unsigned long x);
extern unsigned long (*arch_virt_to_idmap)(unsigned long x);

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

#ifdef CONFIG_VIRT_TO_BUS
#define virt_to_bus virt_to_bus
static inline __deprecated unsigned long virt_to_bus(void *x)
{
return __virt_to_bus((unsigned long)x);
}

#define bus_to_virt bus_to_virt
static inline __deprecated void *bus_to_virt(unsigned long x)
{
return (void *)__bus_to_virt(x);
}
#endif

/*
* Conversion between a struct page and a physical address.
*
Expand Down
14 changes: 12 additions & 2 deletions arch/arm/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ void __check_vmalloc_seq(struct mm_struct *mm);
#ifdef CONFIG_CPU_HAS_ASID

void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk);
#define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.id, 0); 0; })
static inline int
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
atomic64_set(&mm->context.id, 0);
return 0;
}

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

#endif /* CONFIG_MMU */

#define init_new_context(tsk,mm) 0
static inline int
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
return 0;
}


#endif /* CONFIG_CPU_HAS_ASID */

Expand Down
8 changes: 8 additions & 0 deletions arch/arm/include/asm/sections.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef _ASM_ARM_SECTIONS_H
#define _ASM_ARM_SECTIONS_H

#include <asm-generic/sections.h>

extern char _exiprom[];

#endif /* _ASM_ARM_SECTIONS_H */
7 changes: 4 additions & 3 deletions arch/arm/include/asm/sparsemem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* Eg, if you have 2 banks of up to 64MB at 0x80000000, 0x84000000,
* then MAX_PHYSMEM_BITS is 32, SECTION_SIZE_BITS is 26.
*
* Define these in your mach/memory.h.
* These can be overridden in your mach/memory.h.
*/
#if !defined(SECTION_SIZE_BITS) || !defined(MAX_PHYSMEM_BITS)
#error Sparsemem is not supported on this platform
#if !defined(MAX_PHYSMEM_BITS) || !defined(SECTION_SIZE_BITS)
#define MAX_PHYSMEM_BITS 36
#define SECTION_SIZE_BITS 28
#endif

#endif
8 changes: 3 additions & 5 deletions arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,6 @@ ENDPROC(vector_\name)
.endm

.section .stubs, "ax", %progbits
__stubs_start:
@ This must be the first word
.word vector_swi

Expand Down Expand Up @@ -1202,14 +1201,13 @@ vector_addrexcptn:
.long __fiq_svc @ e
.long __fiq_svc @ f

.globl vector_fiq_offset
.equ vector_fiq_offset, vector_fiq
.globl vector_fiq

.section .vectors, "ax", %progbits
__vectors_start:
.L__vectors_start:
W(b) vector_rst
W(b) vector_und
W(ldr) pc, __vectors_start + 0x1000
W(ldr) pc, .L__vectors_start + 0x1000
W(b) vector_pabt
W(b) vector_dabt
W(b) vector_addrexcptn
Expand Down
Loading

0 comments on commit de06dbf

Please sign in to comment.