aboutsummaryrefslogtreecommitdiff
path: root/arch/mips
AgeCommit message (Collapse)AuthorFilesLines
2018-05-17i2c: gpio: move header to platform_dataWolfram Sang1-1/+1
This header only contains platform_data. Move it to the proper directory. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Acked-by: James Hogan <[email protected]> Acked-by: Greg Ungerer <[email protected]>
2018-05-16signal/mips: Report FPE_FLTUNK for undiagnosed floating point exceptionsGuenter Roeck1-1/+1
Most mips builds fail with arch/mips/kernel/traps.c: In function ‘force_fcr31_sig’: arch/mips/kernel/traps.c:732:2: error: ‘si_code’ may be used uninitialized in this function Fix the problem by initializing si_code with FPE_FLTUNK (undiagnosed floating point exception). Fixes: f43a54a0d916 ("signal/mips: Use force_sig_fault where appropriate") Cc: [email protected] Cc: Eric W. Biederman <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
2018-05-16proc: introduce proc_create_single{,_data}Christoph Hellwig2-40/+4
Variants of proc_create{,_data} that directly take a seq_file show callback and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <[email protected]>
2018-05-15MIPS: perf: Fix perf with MT counting other threadsMatt Redfearn1-39/+39
When perf is used in non-system mode, i.e. without specifying CPUs to count on, check_and_calc_range falls into the case when it sets M_TC_EN_ALL in the counter config_base. This has the impact of always counting for all of the threads in a core, even when the user has not requested it. For example this can be seen with a test program which executes 30002 instructions and 10000 branches running on one VPE and a busy load on the other VPE in the core. Without this commit, the expected count is not returned: taskset 4 dd if=/dev/zero of=/dev/null count=100000 & taskset 8 perf stat -e instructions:u,branches:u ./test_prog Performance counter stats for './test_prog': 103235 instructions:u 17015 branches:u In order to fix this, remove check_and_calc_range entirely and perform all of the logic in mipsxx_pmu_enable_event. Since mipsxx_pmu_enable_event now requires the range of the event, ensure that it is set by mipspmu_perf_event_encode in the same circumstances as before (i.e. #ifdef CONFIG_MIPS_MT_SMP && num_possible_cpus() > 1). The logic of mipsxx_pmu_enable_event now becomes: If the CPU is a BMIPS5000, then use the special vpe_id() implementation to select which VPE to count. If the counter has a range greater than a single VPE, i.e. it is a core-wide counter, then ensure that the counter is set up to count events from all TCs (though, since this is true by definition, is this necessary? Just enabling a core-wide counter in the per-VPE case appears experimentally to return the same counts. This is left in for now as the logic was present before). If the event is set up to count a particular CPU (i.e. system mode), then the VPE ID of that CPU is used for the counter. Otherwise, the event should be counted on the CPU scheduling this thread (this was the critical bit missing from the previous implementation) so the VPE ID of this CPU is used for the counter. With this commit, the same test as before returns the counts expected: taskset 4 dd if=/dev/zero of=/dev/null count=100000 & taskset 8 perf stat -e instructions:u,branches:u ./test_prog Performance counter stats for './test_prog': 30002 instructions:u 10000 branches:u Signed-off-by: Matt Redfearn <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19138/ Signed-off-by: James Hogan <[email protected]>
2018-05-15MIPS: perf: Use correct VPE ID when setting up VPE tracingMatt Redfearn1-10/+2
There are a couple of FIXME's in the perf code which state that cpu_data[event->cpu].vpe_id reports 0 for both CPUs. This is no longer the case, since the vpe_id is used extensively by SMP CPS. VPE local counting gets around this by using smp_processor_id() instead. As it happens this does work correctly to count events on the right VPE, but relies on 2 assumptions: a) Always having 2 VPEs / core. b) The hardware only paying attention to the least significant bit of the PERFCTL.VPEID field. If either of these assumptions change then the incorrect VPEs events will be counted. Fix this by replacing smp_processor_id() with cpu_vpe_id(&current_cpu_data), in the vpe_id() macro, and pass vpe_id() to M_PERFCTL_VPEID() when setting up PERFCTL.VPEID. The FIXME's can also be removed since they no longer apply. Signed-off-by: Matt Redfearn <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19137/ Signed-off-by: James Hogan <[email protected]>
2018-05-15MIPS: perf: More robustly probe for the presence of per-tc countersMatt Redfearn3-5/+7
The presence of per TC performance counters is now detected by cpu-probe.c and indicated by MIPS_CPU_MT_PER_TC_PERF_COUNTERS in cpu_data. Switch detection of the feature to use this new flag rather than blindly testing the implementation specific config7 register with a magic number. Signed-off-by: Matt Redfearn <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Maciej W. Rozycki <[email protected]> Cc: Paul Burton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Robert Richter <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19142/ Signed-off-by: James Hogan <[email protected]>
2018-05-15MIPS: Probe for MIPS MT perf counters per TCMatt Redfearn3-0/+19
Processors implementing the MIPS MT ASE may have performance counters implemented per core or per TC. Processors implemented by MIPS Technologies signify presence per TC through a bit in the implementation specific Config7 register. Currently the code which probes for their presence blindly reads a magic number corresponding to this bit, despite it potentially having a different meaning in the CPU implementation. Since CPU features are generally detected by cpu-probe.c, perform the detection here instead. Introduce cpu_set_mt_per_tc_perf which checks the bit in config7 and call it from MIPS CPUs known to implement this bit and the MT ASE, specifically, the 34K, 1004K and interAptiv. Once the presence of the per-tc counter is indicated in cpu_data, tests for it can be updated to use this flag. Suggested-by: James Hogan <[email protected]> Signed-off-by: Matt Redfearn <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Matt Redfearn <[email protected]> Cc: Paul Burton <[email protected]> Cc: Maciej W. Rozycki <[email protected]> Cc: [email protected]> Patchwork: https://patchwork.linux-mips.org/patch/19136/ Signed-off-by: James Hogan <[email protected]>
2018-05-14bpf, mips: remove unused functionDaniel Borkmann1-26/+0
The ool_skb_header_pointer() and size_to_len() is unused same as tmp_offset, therefore remove all of them. Signed-off-by: Daniel Borkmann <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
2018-05-14MIPS: mscc: Connect phys to ports on ocelot_pcb123Alexandre Belloni1-0/+20
Add phy to switch port connections for PCB123 for internal PHYs. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: mscc: Add switch to ocelotAlexandre Belloni1-0/+88
Ocelot has an integrated switch, add support for it. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: JZ4740: Drop old platform reset codePaul Cercueil1-31/+0
This work is now performed by the watchdog driver directly. Signed-off-by: Paul Cercueil <[email protected]> Acked-by: James Hogan <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Wim Van Sebroeck <[email protected]> Cc: Mathieu Malaterre <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: qi_lb60: Enable the jz4740-wdt driverPaul Cercueil1-0/+2
The watchdog is an useful piece of hardware, so there's no reason not to enable it. Besides, this is important for restart to work after the change in the next commit. This commit enables the Kconfig option in the qi_lb60 defconfig. Signed-off-by: Paul Cercueil <[email protected]> Acked-by: James Hogan <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Wim Van Sebroeck <[email protected]> Cc: Mathieu Malaterre <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: JZ4780: dts: Fix watchdog nodePaul Cercueil1-1/+4
- The previous node requested a memory area of 0x100 bytes, while the driver only manipulates four registers present in the first 0x10 bytes. - The driver requests for the "rtc" clock, but the previous node did not provide any. Signed-off-by: Paul Cercueil <[email protected]> Reviewed-by: Mathieu Malaterre <[email protected]> Acked-by: James Hogan <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Wim Van Sebroeck <[email protected]> Cc: Mathieu Malaterre <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: JZ4740: dts: Add bindings for the jz4740-wdt driverPaul Cercueil3-17/+8
Also remove the watchdog platform_device from platform.c, since it wasn't used anywhere anyway. Signed-off-by: Paul Cercueil <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Wim Van Sebroeck <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Malaterre <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] [[email protected]: Drop jz4740_wdt_device declaration from header] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: VPE: Fix spelling mistake: "uneeded" -> "unneeded"Colin Ian King1-1/+1
Trivial fix to spelling mistake in pr_warn message text. Signed-off-by: Colin Ian King <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: Re-use kstrtobool_from_user()Andy Shevchenko1-8/+1
Re-use kstrtobool_from_user() instead of open coded variant. Signed-off-by: Andy Shevchenko <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: Convert update_persistent_clock() to update_persistent_clock64()Baolin Wang8-39/+30
Since struct timespec is not y2038 safe on 32bit machines, this patch converts update_persistent_clock() to update_persistent_clock64() using struct timespec64. The rtc_mips_set_time() and rtc_mips_set_mmss() interfaces were using 'unsigned long' type that is not y2038 safe on 32bit machines, moreover there is only one platform implementing rtc_mips_set_time() and two platforms implementing rtc_mips_set_mmss(), so we can just make them each implement update_persistent_clock64() directly, to get that helper out of the common mips code by removing rtc_mips_set_time() and rtc_mips_set_mmss() interfaces. Signed-off-by: Baolin Wang <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Paul Burton <[email protected]> Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: Convert read_persistent_clock() to read_persistent_clock64()Baolin Wang8-16/+16
Since struct timespec is not y2038 safe on 32bit machines, this patch converts read_persistent_clock() to read_persistent_clock64() using struct timespec64, as well as converting mktime() to mktime64(). Signed-off-by: Baolin Wang <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Paul Burton <[email protected]> Cc: [email protected] Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: sni: Remove the read_persistent_clock()Baolin Wang1-6/+0
The dummy read_persistent_clock() uses a timespec, which is not year 2038 safe on 32bit systems. Thus remove this obsolete interface. Signed-off-by: Baolin Wang <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19114/ Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRsMaciej W. Rozycki2-4/+4
Check the TIF_32BIT_FPREGS task setting of the tracee rather than the tracer in determining the layout of floating-point general registers in the floating-point context, correcting access to odd-numbered registers for o32 tracees where the setting disagrees between the two processes. Fixes: 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries") Signed-off-by: Maciej W. Rozycki <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: <[email protected]> # 3.14+ Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: xilfpga: Actually include FDT in fitImageAlexandre Belloni1-0/+1
Commit b35565bb16a5 ("MIPS: generic: Add support for MIPSfpga") added and its.S file for xilfpga but forgot to add it to arch/mips/generic/Platform so it is never used. Fixes: b35565bb16a5 ("MIPS: generic: Add support for MIPSfpga") Signed-off-by: Alexandre Belloni <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: <[email protected]> # 4.15+ Patchwork: https://patchwork.linux-mips.org/patch/19245/ Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: xilfpga: Stop generating useless dtb.oAlexandre Belloni1-2/+0
A dtb.o is generated from nexys4ddr.dts but this is never used since it has been moved to mips/generic with commit b35565bb16a5 ("MIPS: generic: Add support for MIPSfpga"). Fixes: b35565bb16a5 ("MIPS: generic: Add support for MIPSfpga") Signed-off-by: Alexandre Belloni <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: <[email protected]> # 4.15+ Patchwork: https://patchwork.linux-mips.org/patch/19244/ Signed-off-by: James Hogan <[email protected]>
2018-05-14KVM: Fix spelling mistake: "cop_unsuable" -> "cop_unusable"Colin Ian King1-1/+1
Trivial fix to spelling mistake in debugfs_entries text. Fixes: 669e846e6c4e ("KVM/MIPS32: MIPS arch specific APIs for KVM") Signed-off-by: Colin Ian King <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: [email protected] Cc: <[email protected]> # 3.10+ Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: ptrace: Expose FIR register through FP regsetMaciej W. Rozycki1-2/+16
Correct commit 7aeb753b5353 ("MIPS: Implement task_user_regset_view.") and expose the FIR register using the unused 4 bytes at the end of the NT_PRFPREG regset. Without that register included clients cannot use the PTRACE_GETREGSET request to retrieve the complete FPU register set and have to resort to one of the older interfaces, either PTRACE_PEEKUSR or PTRACE_GETFPREGS, to retrieve the missing piece of data. Also the register is irreversibly missing from core dumps. This register is architecturally hardwired and read-only so the write path does not matter. Ignore data supplied on writes then. Fixes: 7aeb753b5353 ("MIPS: Implement task_user_regset_view.") Signed-off-by: James Hogan <[email protected]> Signed-off-by: Maciej W. Rozycki <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: <[email protected]> # 3.13+ Patchwork: https://patchwork.linux-mips.org/patch/19273/ Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: Fix build with DEBUG_ZBOOT and MACH_JZ4770Paul Cercueil1-3/+3
The debug definitions were missing for MACH_JZ4770, resulting in a build failure when DEBUG_ZBOOT was set. Since the UART addresses are the same across all Ingenic SoCs, we just use a #ifdef CONFIG_MACH_INGENIC instead of checking for individual Ingenic SoCs. Additionally, I added a #define for the UART0 address in-code and dropped the <asm/mach-jz4740/base.h> include, for the reason that this include file is slowly being phased out as the whole platform is being moved to devicetree. Fixes: 9be5f3e92ed5 ("MIPS: ingenic: Initial JZ4770 support") Signed-off-by: Paul Cercueil <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: <[email protected]> # 4.16 Patchwork: https://patchwork.linux-mips.org/patch/18957/ Signed-off-by: James Hogan <[email protected]>
2018-05-14MIPS: c-r4k: Fix data corruption related to cache coherenceNeilBrown1-3/+6
When DMA will be performed to a MIPS32 1004K CPS, the L1-cache for the range needs to be flushed and invalidated first. The code currently takes one of two approaches. 1/ If the range is less than the size of the dcache, then HIT type requests flush/invalidate cache lines for the particular addresses. HIT-type requests a globalised by the CPS so this is safe on SMP. 2/ If the range is larger than the size of dcache, then INDEX type requests flush/invalidate the whole cache. INDEX type requests affect the local cache only. CPS does not propagate them in any way. So this invalidation is not safe on SMP CPS systems. Data corruption due to '2' can quite easily be demonstrated by repeatedly "echo 3 > /proc/sys/vm/drop_caches" and then sha1sum a file that is several times the size of available memory. Dropping caches means that large contiguous extents (large than dcache) are more likely. This was not a problem before Linux-4.8 because option 2 was never used if CONFIG_MIPS_CPS was defined. The commit which removed that apparently didn't appreciate the full consequence of the change. We could, in theory, globalize the INDEX based flush by sending an IPI to other cores. These cache invalidation routines can be called with interrupts disabled and synchronous IPI require interrupts to be enabled. Asynchronous IPI may not trigger writeback soon enough. So we cannot use IPI in practice. We can already test if IPI would be needed for an INDEX operation with r4k_op_needs_ipi(R4K_INDEX). If this is true then we mustn't try the INDEX approach as we cannot use IPI. If this is false (e.g. when there is only one core and hence one L1 cache) then it is safe to use the INDEX approach without IPI. This patch avoids options 2 if r4k_op_needs_ipi(R4K_INDEX), and so eliminates the corruption. Fixes: c00ab4896ed5 ("MIPS: Remove cpu_has_safe_index_cacheops") Signed-off-by: NeilBrown <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Paul Burton <[email protected]> Cc: [email protected] Cc: <[email protected]> # 4.8+ Patchwork: https://patchwork.linux-mips.org/patch/19259/ Signed-off-by: James Hogan <[email protected]>
2018-05-09swiotlb: move the SWIOTLB config symbol to lib/KconfigChristoph Hellwig3-11/+2
This way we have one central definition of it, and user can select it as needed. The new option is not user visible, which is the behavior it had in most architectures, with a few notable exceptions: - On x86_64 and mips/loongson3 it used to be user selectable, but defaulted to y. It now is unconditional, which seems like the right thing for 64-bit architectures without guaranteed availablity of IOMMUs. - on powerpc the symbol is user selectable and defaults to n, but many boards select it. This change assumes no working setup required a manual selection, but if that turned out to be wrong we'll have to add another select statement or two for the respective boards. Signed-off-by: Christoph Hellwig <[email protected]>
2018-05-09mips,unicore32: swiotlb doesn't need sg->dma_lengthChristoph Hellwig2-2/+0
Only mips and unicore32 select CONFIG_NEED_SG_DMA_LENGTH when building swiotlb. swiotlb itself never merges segements and doesn't accesses the dma_length field directly, so drop the dependency. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: James Hogan <[email protected]>
2018-05-09arch: define the ARCH_DMA_ADDR_T_64BIT config symbol in lib/KconfigChristoph Hellwig1-3/+0
Define this symbol if the architecture either uses 64-bit pointers or the PHYS_ADDR_T_64BIT is set. This covers 95% of the old arch magic. We only need an additional select for Xen on ARM (why anyway?), and we now always set ARCH_DMA_ADDR_T_64BIT on mips boards with 64-bit physical addressing instead of only doing it when highmem is set. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: James Hogan <[email protected]>
2018-05-09arch: remove the ARCH_PHYS_ADDR_T_64BIT config symbolChristoph Hellwig1-9/+6
Instead select the PHYS_ADDR_T_64BIT for 32-bit architectures that need a 64-bit phys_addr_t type directly. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: James Hogan <[email protected]>
2018-05-09dma-mapping: move the NEED_DMA_MAP_STATE config symbol to lib/KconfigChristoph Hellwig1-3/+0
This way we have one central definition of it, and user can select it as needed. Note that we now also always select it when CONFIG_DMA_API_DEBUG is select, which fixes some incorrect checks in a few network drivers. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]>
2018-05-09scatterlist: move the NEED_SG_DMA_LENGTH config symbol to lib/KconfigChristoph Hellwig3-9/+0
This way we have one central definition of it, and user can select it as needed. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]>
2018-05-09iommu-helper: mark iommu_is_span_boundary as inlineChristoph Hellwig3-11/+0
This avoids selecting IOMMU_HELPER just for this function. And we only use it once or twice in normal builds so this often even is a size reduction. Signed-off-by: Christoph Hellwig <[email protected]>
2018-05-08dma-debug: remove CONFIG_HAVE_DMA_API_DEBUGChristoph Hellwig1-1/+0
There is no arch specific code required for dma-debug, so there is no need to opt into the support either. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Robin Murphy <[email protected]>
2018-05-08dma-debug: move initialization to common codeChristoph Hellwig1-10/+0
Most mainstream architectures are using 65536 entries, so lets stick to that. If someone is really desperate to override it that can still be done through <asm/dma-mapping.h>, but I'd rather see a really good rationale for that. dma_debug_init is now called as a core_initcall, which for many architectures means much earlier, and provides dma-debug functionality earlier in the boot process. This should be safe as it only relies on the memory allocator already being available. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Marek Szyprowski <[email protected]> Reviewed-by: Robin Murphy <[email protected]>
2018-05-07PCI: remove PCI_DMA_BUS_IS_PHYSChristoph Hellwig1-7/+0
This was used by the ide, scsi and networking code in the past to determine if they should bounce payloads. Now that the dma mapping always have to support dma to all physical memory (thanks to swiotlb for non-iommu systems) there is no need to this crude hack any more. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> (for riscv) Reviewed-by: Jens Axboe <[email protected]>
2018-05-03bpf, mips64: remove ld_abs/ld_indDaniel Borkmann1-104/+0
Since LD_ABS/LD_IND instructions are now removed from the core and reimplemented through a combination of inlined BPF instructions and a slow-path helper, we can get rid of the complexity from mips64 JIT. Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
2018-05-02Merge branch 'timers/urgent' into timers/coreThomas Gleixner4-6/+26
Pick up urgent fixes to apply dependent cleanup patch
2018-05-02MIPS: configs: ci20: Enable ext4Ezequiel Garcia1-0/+1
Now that we have MMC support, enable ext2/3/4 support in the CI20 defconfig. Signed-off-by: Ezequiel Garcia <[email protected]> Acked-by: James Hogan <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2018-05-02MIPS: configs: ci20: Enable DMA and MMC supportEzequiel Garcia1-0/+3
Enable the SD/MMC support, along with DMA engine support in the CI20 defconfig. Acked-by: James Hogan <[email protected]> Tested-by: Mathieu Malaterre <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2018-05-02MIPS: dts: ci20: Enable MMC in the devicetreeEzequiel Garcia1-0/+34
Now that we have support for JZ480 SoCs in the MMC driver, let's enable it on the devicetree. Acked-by: James Hogan <[email protected]> Tested-by: Mathieu Malaterre <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2018-05-02MIPS: dts: jz4780: Add MMC controller node to the devicetreeEzequiel Garcia1-0/+40
Add the devicetree node to support the MMC host controller available in JZ480 SoCs. Acked-by: James Hogan <[email protected]> Tested-by: Mathieu Malaterre <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2018-05-02MIPS: dts: jz4780: Add DMA controller node to the devicetreeEzequiel Garcia1-0/+12
Add the devicetree node to support the DMA controller found in JZ480 SoCs. Tested-by: Mathieu Malaterre <[email protected]> Acked-by: James Hogan <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2018-04-27Merge tag 'v4.17-rc2' into docs-nextJonathan Corbet4-6/+26
Merge -rc2 to pick up the changes to Documentation/core-api/kernel-api.rst that hit mainline via the networking tree. In their absence, subsequent patches cannot be applied.
2018-04-25signal/mips: Use force_sig_fault where appropriateEric W. Biederman2-61/+23
Filling in struct siginfo before calling force_sig_info a tedious and error prone process, where once in a great while the wrong fields are filled out, and siginfo has been inconsistently cleared. Simplify this process by using the helper force_sig_fault. Which takes as a parameters all of the information it needs, ensures all of the fiddly bits of filling in struct siginfo are done properly and then calls force_sig_info. In short about a 5 line reduction in code for every time force_sig_info is called, which makes the calling function clearer. Cc: Ralf Baechle <[email protected]> Cc: James Hogan <[email protected]> Cc: [email protected] Signed-off-by: "Eric W. Biederman" <[email protected]>
2018-04-25signal: Ensure every siginfo we send has all bits initializedEric W. Biederman1-0/+1
Call clear_siginfo to ensure every stack allocated siginfo is properly initialized before being passed to the signal sending functions. Note: It is not safe to depend on C initializers to initialize struct siginfo on the stack because C is allowed to skip holes when initializing a structure. The initialization of struct siginfo in tracehook_report_syscall_exit was moved from the helper user_single_step_siginfo into tracehook_report_syscall_exit itself, to make it clear that the local variable siginfo gets fully initialized. In a few cases the scope of struct siginfo has been reduced to make it clear that siginfo siginfo is not used on other paths in the function in which it is declared. Instances of using memset to initialize siginfo have been replaced with calls clear_siginfo for clarity. Signed-off-by: "Eric W. Biederman" <[email protected]>
2018-04-23MIPS: BCM47XX: Use __initdata for the bcm47xx_leds_pdataRafał Miłecki1-1/+1
This struct variable is used during init only. It gets passed to the gpio_led_register_device() which creates its own data copy. That allows using __initdata and saving some minimal amount of memory. Signed-off-by: Rafał Miłecki <[email protected]> Reviewed-by: Aaro Koskinen <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Hauke Mehrtens <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/18928/ Signed-off-by: James Hogan <[email protected]>
2018-04-23MIPS: Use generic GCC library routines from lib/Antony Pavlov7-144/+6
The commit b35cd9884fa5 ("lib: Add shared copies of some GCC library routines") makes it possible to share generic GCC library routines by several architectures. This commit removes several generic GCC library routines from arch/mips/lib/ in favour of similar routines from lib/. Signed-off-by: Antony Pavlov <[email protected]> [Matt Redfearn] Use GENERIC_LIB_* named Kconfig entries Signed-off-by: Matt Redfearn <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19051/ Signed-off-by: James Hogan <[email protected]>
2018-04-23MIPS: vmlinuz: Use generic ashldi3Matt Redfearn1-4/+7
In preparation for removing some of the MIPS compiler intrinsics from arch/mips/lib, first update the build of vmlinuz to use the generic ashldi3 from lib. Both ashldi3 and bswapsi objects need to be built with different CFLAGS for inclusion to vmlinuz rather than simply including the object built for the main kernel image. The objects cannot be built directly from source, since CONFIG_MODVERSIONS changes cmd_cc_o_c to prevent this. Split the rule to ship ashldi3 and bswapsi from the relevant source locations. These files make no reference to other files in their directory, so the additional CFLAGS are apparently unnecessary - remove them as well. Signed-off-by: Matt Redfearn <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Antony Pavlov <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19050/ [[email protected]: Add if_changed and FORCE to fix build failure when arch/mips/boot/compressed/ashldi3.c is already generated but there is no .ashldi3.c.cmd file yet] Signed-off-by: James Hogan <[email protected]>
2018-04-23MIPS: BCM47XX: Add support for Netgear WNR1000 V3Rafał Miłecki4-0/+21
This adds support for detecting this model board and registers some LEDs and buttons. There are two uncommon things regarding this device: 1) It can use two different "board_id" ID values. Unit I have uses "U12H139T00_NETGEAR" value. This magic is also used in firmware file header. There are two reports (one from an OpenWrt user) of a different "U12H139T50_NETGEAR" magic though. 2) Power LEDs share GPIOs with buttons. Amber one seems to share GPIO 2 with WPS button and green one seems to share GPIO 3 with reset button. It remains unknown how to support them and handle buttons at the same time. For that reason they aren't added to the list of supported LEDs. Signed-off-by: Rafał Miłecki <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Hauke Mehrtens <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/19004/ Signed-off-by: James Hogan <[email protected]>