aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-12 12:22:54 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-08-12 12:22:54 -0400
commitae27c563a6185d47a904c2d71b72580266cb9d86 (patch)
tree9190380f6ed5bf9c62a1ec153db8a5b587769ecb /arch/arm
parent0bf63e2c2913391dbf7e49ed8df2c89c180e58d9 (diff)
parentd45331b00ddb179e291766617259261c112db872 (diff)
Merge tag 'v5.3-rc4' into patchwork
Linux 5.3-rc4 * tag 'v5.3-rc4': (750 commits) Linux 5.3-rc4 Makefile: Convert -Wimplicit-fallthrough=3 to just -Wimplicit-fallthrough for clang ARM: ep93xx: Mark expected switch fall-through scsi: fas216: Mark expected switch fall-throughs pcmcia: db1xxx_ss: Mark expected switch fall-throughs video: fbdev: omapfb_main: Mark expected switch fall-throughs watchdog: riowd: Mark expected switch fall-through s390/net: Mark expected switch fall-throughs crypto: ux500/crypt: Mark expected switch fall-throughs watchdog: wdt977: Mark expected switch fall-through watchdog: scx200_wdt: Mark expected switch fall-through watchdog: Mark expected switch fall-throughs ARM: signal: Mark expected switch fall-through mfd: omap-usb-host: Mark expected switch fall-throughs mfd: db8500-prcmu: Mark expected switch fall-throughs ARM: OMAP: dma: Mark expected switch fall-throughs ARM: alignment: Mark expected switch fall-throughs ARM: tegra: Mark expected switch fall-through ARM/hw_breakpoint: Mark expected switch fall-throughs mm/memremap: Fix reuse of pgmap instances with internal references ...
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/dma-mapping.h4
-rw-r--r--arch/arm/kernel/hw_breakpoint.c5
-rw-r--r--arch/arm/kernel/signal.c1
-rw-r--r--arch/arm/kvm/coproc.c23
-rw-r--r--arch/arm/mach-ep93xx/crunch.c1
-rw-r--r--arch/arm/mach-tegra/reset.c2
-rw-r--r--arch/arm/mm/Kconfig5
-rw-r--r--arch/arm/mm/alignment.c4
-rw-r--r--arch/arm/mm/dma-mapping.c61
-rw-r--r--arch/arm/mm/init.c5
-rw-r--r--arch/arm/plat-omap/dma.c14
11 files changed, 105 insertions, 20 deletions
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 7e0486ad1318..dba9355e2484 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -18,7 +18,9 @@ extern const struct dma_map_ops arm_coherent_dma_ops;
18 18
19static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 19static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
20{ 20{
21 return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : NULL; 21 if (IS_ENABLED(CONFIG_MMU) && !IS_ENABLED(CONFIG_ARM_LPAE))
22 return &arm_dma_ops;
23 return NULL;
22} 24}
23 25
24#ifdef __arch_page_to_dma 26#ifdef __arch_page_to_dma
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index af8b8e15f589..b0c195e3a06d 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -544,6 +544,7 @@ static int arch_build_bp_info(struct perf_event *bp,
544 if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE) 544 if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE)
545 && max_watchpoint_len >= 8) 545 && max_watchpoint_len >= 8)
546 break; 546 break;
547 /* Else, fall through */
547 default: 548 default:
548 return -EINVAL; 549 return -EINVAL;
549 } 550 }
@@ -608,10 +609,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
608 /* Allow halfword watchpoints and breakpoints. */ 609 /* Allow halfword watchpoints and breakpoints. */
609 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) 610 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
610 break; 611 break;
612 /* Else, fall through */
611 case 3: 613 case 3:
612 /* Allow single byte watchpoint. */ 614 /* Allow single byte watchpoint. */
613 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) 615 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
614 break; 616 break;
617 /* Else, fall through */
615 default: 618 default:
616 ret = -EINVAL; 619 ret = -EINVAL;
617 goto out; 620 goto out;
@@ -861,6 +864,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr,
861 break; 864 break;
862 case ARM_ENTRY_ASYNC_WATCHPOINT: 865 case ARM_ENTRY_ASYNC_WATCHPOINT:
863 WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n"); 866 WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");
867 /* Fall through */
864 case ARM_ENTRY_SYNC_WATCHPOINT: 868 case ARM_ENTRY_SYNC_WATCHPOINT:
865 watchpoint_handler(addr, fsr, regs); 869 watchpoint_handler(addr, fsr, regs);
866 break; 870 break;
@@ -909,6 +913,7 @@ static bool core_has_os_save_restore(void)
909 ARM_DBG_READ(c1, c1, 4, oslsr); 913 ARM_DBG_READ(c1, c1, 4, oslsr);
910 if (oslsr & ARM_OSLSR_OSLM0) 914 if (oslsr & ARM_OSLSR_OSLM0)
911 return true; 915 return true;
916 /* Else, fall through */
912 default: 917 default:
913 return false; 918 return false;
914 } 919 }
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 09f6fdd41974..ab2568996ddb 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -596,6 +596,7 @@ static int do_signal(struct pt_regs *regs, int syscall)
596 switch (retval) { 596 switch (retval) {
597 case -ERESTART_RESTARTBLOCK: 597 case -ERESTART_RESTARTBLOCK:
598 restart -= 2; 598 restart -= 2;
599 /* Fall through */
599 case -ERESTARTNOHAND: 600 case -ERESTARTNOHAND:
600 case -ERESTARTSYS: 601 case -ERESTARTSYS:
601 case -ERESTARTNOINTR: 602 case -ERESTARTNOINTR:
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
index d2806bcff8bb..07745ee022a1 100644
--- a/arch/arm/kvm/coproc.c
+++ b/arch/arm/kvm/coproc.c
@@ -651,13 +651,22 @@ int kvm_handle_cp14_64(struct kvm_vcpu *vcpu, struct kvm_run *run)
651} 651}
652 652
653static void reset_coproc_regs(struct kvm_vcpu *vcpu, 653static void reset_coproc_regs(struct kvm_vcpu *vcpu,
654 const struct coproc_reg *table, size_t num) 654 const struct coproc_reg *table, size_t num,
655 unsigned long *bmap)
655{ 656{
656 unsigned long i; 657 unsigned long i;
657 658
658 for (i = 0; i < num; i++) 659 for (i = 0; i < num; i++)
659 if (table[i].reset) 660 if (table[i].reset) {
661 int reg = table[i].reg;
662
660 table[i].reset(vcpu, &table[i]); 663 table[i].reset(vcpu, &table[i]);
664 if (reg > 0 && reg < NR_CP15_REGS) {
665 set_bit(reg, bmap);
666 if (table[i].is_64bit)
667 set_bit(reg + 1, bmap);
668 }
669 }
661} 670}
662 671
663static struct coproc_params decode_32bit_hsr(struct kvm_vcpu *vcpu) 672static struct coproc_params decode_32bit_hsr(struct kvm_vcpu *vcpu)
@@ -1432,17 +1441,15 @@ void kvm_reset_coprocs(struct kvm_vcpu *vcpu)
1432{ 1441{
1433 size_t num; 1442 size_t num;
1434 const struct coproc_reg *table; 1443 const struct coproc_reg *table;
1435 1444 DECLARE_BITMAP(bmap, NR_CP15_REGS) = { 0, };
1436 /* Catch someone adding a register without putting in reset entry. */
1437 memset(vcpu->arch.ctxt.cp15, 0x42, sizeof(vcpu->arch.ctxt.cp15));
1438 1445
1439 /* Generic chip reset first (so target could override). */ 1446 /* Generic chip reset first (so target could override). */
1440 reset_coproc_regs(vcpu, cp15_regs, ARRAY_SIZE(cp15_regs)); 1447 reset_coproc_regs(vcpu, cp15_regs, ARRAY_SIZE(cp15_regs), bmap);
1441 1448
1442 table = get_target_table(vcpu->arch.target, &num); 1449 table = get_target_table(vcpu->arch.target, &num);
1443 reset_coproc_regs(vcpu, table, num); 1450 reset_coproc_regs(vcpu, table, num, bmap);
1444 1451
1445 for (num = 1; num < NR_CP15_REGS; num++) 1452 for (num = 1; num < NR_CP15_REGS; num++)
1446 WARN(vcpu_cp15(vcpu, num) == 0x42424242, 1453 WARN(!test_bit(num, bmap),
1447 "Didn't reset vcpu_cp15(vcpu, %zi)", num); 1454 "Didn't reset vcpu_cp15(vcpu, %zi)", num);
1448} 1455}
diff --git a/arch/arm/mach-ep93xx/crunch.c b/arch/arm/mach-ep93xx/crunch.c
index 1c9a4be8b503..1c05c5bf7e5c 100644
--- a/arch/arm/mach-ep93xx/crunch.c
+++ b/arch/arm/mach-ep93xx/crunch.c
@@ -49,6 +49,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
49 * FALLTHROUGH: Ensure we don't try to overwrite our newly 49 * FALLTHROUGH: Ensure we don't try to overwrite our newly
50 * initialised state information on the first fault. 50 * initialised state information on the first fault.
51 */ 51 */
52 /* Fall through */
52 53
53 case THREAD_NOTIFY_EXIT: 54 case THREAD_NOTIFY_EXIT:
54 crunch_task_release(thread); 55 crunch_task_release(thread);
diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index 5a67a71f80cc..76a65df42d10 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -70,7 +70,7 @@ static void __init tegra_cpu_reset_handler_enable(void)
70 switch (err) { 70 switch (err) {
71 case -ENOSYS: 71 case -ENOSYS:
72 tegra_cpu_reset_handler_set(reset_address); 72 tegra_cpu_reset_handler_set(reset_address);
73 /* pass-through */ 73 /* fall through */
74 case 0: 74 case 0:
75 is_enabled = true; 75 is_enabled = true;
76 break; 76 break;
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 820b60a50125..c54cd7ed90ba 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -663,6 +663,11 @@ config ARM_LPAE
663 depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \ 663 depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \
664 !CPU_32v4 && !CPU_32v3 664 !CPU_32v4 && !CPU_32v3
665 select PHYS_ADDR_T_64BIT 665 select PHYS_ADDR_T_64BIT
666 select SWIOTLB
667 select ARCH_HAS_DMA_COHERENT_TO_PFN
668 select ARCH_HAS_DMA_MMAP_PGPROT
669 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
670 select ARCH_HAS_SYNC_DMA_FOR_CPU
666 help 671 help
667 Say Y if you have an ARMv7 processor supporting the LPAE page 672 Say Y if you have an ARMv7 processor supporting the LPAE page
668 table format and you would like to access memory beyond the 673 table format and you would like to access memory beyond the
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 8cdb78642e93..04b36436cbc0 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -695,7 +695,7 @@ thumb2arm(u16 tinstr)
695 return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] | 695 return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |
696 (tinstr & 255); /* register_list */ 696 (tinstr & 255); /* register_list */
697 } 697 }
698 /* Else fall through for illegal instruction case */ 698 /* Else, fall through - for illegal instruction case */
699 699
700 default: 700 default:
701 return BAD_INSTR; 701 return BAD_INSTR;
@@ -751,6 +751,8 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
751 case 0xe8e0: 751 case 0xe8e0:
752 case 0xe9e0: 752 case 0xe9e0:
753 poffset->un = (tinst2 & 0xff) << 2; 753 poffset->un = (tinst2 & 0xff) << 2;
754 /* Fall through */
755
754 case 0xe940: 756 case 0xe940:
755 case 0xe9c0: 757 case 0xe9c0:
756 return do_alignment_ldrdstrd; 758 return do_alignment_ldrdstrd;
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 4789c60a86e3..6774b03aa405 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/dma-noncoherent.h>
18#include <linux/dma-contiguous.h> 19#include <linux/dma-contiguous.h>
19#include <linux/highmem.h> 20#include <linux/highmem.h>
20#include <linux/memblock.h> 21#include <linux/memblock.h>
@@ -1125,6 +1126,19 @@ int arm_dma_supported(struct device *dev, u64 mask)
1125 1126
1126static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent) 1127static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
1127{ 1128{
1129 /*
1130 * When CONFIG_ARM_LPAE is set, physical address can extend above
1131 * 32-bits, which then can't be addressed by devices that only support
1132 * 32-bit DMA.
1133 * Use the generic dma-direct / swiotlb ops code in that case, as that
1134 * handles bounce buffering for us.
1135 *
1136 * Note: this checks CONFIG_ARM_LPAE instead of CONFIG_SWIOTLB as the
1137 * latter is also selected by the Xen code, but that code for now relies
1138 * on non-NULL dev_dma_ops. To be cleaned up later.
1139 */
1140 if (IS_ENABLED(CONFIG_ARM_LPAE))
1141 return NULL;
1128 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops; 1142 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;
1129} 1143}
1130 1144
@@ -2329,6 +2343,9 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
2329 const struct dma_map_ops *dma_ops; 2343 const struct dma_map_ops *dma_ops;
2330 2344
2331 dev->archdata.dma_coherent = coherent; 2345 dev->archdata.dma_coherent = coherent;
2346#ifdef CONFIG_SWIOTLB
2347 dev->dma_coherent = coherent;
2348#endif
2332 2349
2333 /* 2350 /*
2334 * Don't override the dma_ops if they have already been set. Ideally 2351 * Don't override the dma_ops if they have already been set. Ideally
@@ -2363,3 +2380,47 @@ void arch_teardown_dma_ops(struct device *dev)
2363 /* Let arch_setup_dma_ops() start again from scratch upon re-probe */ 2380 /* Let arch_setup_dma_ops() start again from scratch upon re-probe */
2364 set_dma_ops(dev, NULL); 2381 set_dma_ops(dev, NULL);
2365} 2382}
2383
2384#ifdef CONFIG_SWIOTLB
2385void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
2386 size_t size, enum dma_data_direction dir)
2387{
2388 __dma_page_cpu_to_dev(phys_to_page(paddr), paddr & (PAGE_SIZE - 1),
2389 size, dir);
2390}
2391
2392void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
2393 size_t size, enum dma_data_direction dir)
2394{
2395 __dma_page_dev_to_cpu(phys_to_page(paddr), paddr & (PAGE_SIZE - 1),
2396 size, dir);
2397}
2398
2399long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
2400 dma_addr_t dma_addr)
2401{
2402 return dma_to_pfn(dev, dma_addr);
2403}
2404
2405pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
2406 unsigned long attrs)
2407{
2408 if (!dev_is_dma_coherent(dev))
2409 return __get_dma_pgprot(attrs, prot);
2410 return prot;
2411}
2412
2413void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
2414 gfp_t gfp, unsigned long attrs)
2415{
2416 return __dma_alloc(dev, size, dma_handle, gfp,
2417 __get_dma_pgprot(attrs, PAGE_KERNEL), false,
2418 attrs, __builtin_return_address(0));
2419}
2420
2421void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
2422 dma_addr_t dma_handle, unsigned long attrs)
2423{
2424 __arm_dma_free(dev, size, cpu_addr, dma_handle, attrs, false);
2425}
2426#endif /* CONFIG_SWIOTLB */
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 4920a206dce9..16d373d587c4 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -21,6 +21,7 @@
21#include <linux/dma-contiguous.h> 21#include <linux/dma-contiguous.h>
22#include <linux/sizes.h> 22#include <linux/sizes.h>
23#include <linux/stop_machine.h> 23#include <linux/stop_machine.h>
24#include <linux/swiotlb.h>
24 25
25#include <asm/cp15.h> 26#include <asm/cp15.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -463,6 +464,10 @@ static void __init free_highpages(void)
463 */ 464 */
464void __init mem_init(void) 465void __init mem_init(void)
465{ 466{
467#ifdef CONFIG_ARM_LPAE
468 swiotlb_init(1);
469#endif
470
466 set_max_mapnr(pfn_to_page(max_pfn) - mem_map); 471 set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
467 472
468 /* this will put all unused low memory onto the freelists */ 473 /* this will put all unused low memory onto the freelists */
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 79f43acf9acb..08c99413d02c 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
388 /* 388 /*
389 * not supported by current hardware on OMAP1 389 * not supported by current hardware on OMAP1
390 * w |= (0x03 << 7); 390 * w |= (0x03 << 7);
391 * fall through
392 */ 391 */
392 /* fall through */
393 case OMAP_DMA_DATA_BURST_16: 393 case OMAP_DMA_DATA_BURST_16:
394 if (dma_omap2plus()) { 394 if (dma_omap2plus()) {
395 burst = 0x3; 395 burst = 0x3;
396 break; 396 break;
397 } 397 }
398 /* 398 /* OMAP1 don't support burst 16 */
399 * OMAP1 don't support burst 16 399 /* fall through */
400 * fall through
401 */
402 default: 400 default:
403 BUG(); 401 BUG();
404 } 402 }
@@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
474 burst = 0x3; 472 burst = 0x3;
475 break; 473 break;
476 } 474 }
477 /* 475 /* OMAP1 don't support burst 16 */
478 * OMAP1 don't support burst 16 476 /* fall through */
479 * fall through
480 */
481 default: 477 default:
482 printk(KERN_ERR "Invalid DMA burst mode\n"); 478 printk(KERN_ERR "Invalid DMA burst mode\n");
483 BUG(); 479 BUG();