summaryrefslogtreecommitdiff
path: root/arch (follow)
Commit message (Collapse)AuthorAge
...
* | | arm64: Move topology_init to postcoreShiju Mathew2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | Move topology_init to postcore initcall to retrive cpu frequency table early in boot from OPP. Change-Id: I814a022f646878ee608f18ff740b5dc29c77a3c7 Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
* | | arm64: update die handler from ARM / x86Stepan Moskovchenko2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 02df19b4227e5b799e4642e88b568f9474fa78d0 ("ARM: 7424/1: update die handler from x86") refactored the ARM die() logic to avoid a deadlock if a kernel oops happens while holding a spinlock that may also be used in an IRQ handler. Refactor the ARM64 die() handler in a similar way, to avoid similar deadlocks, which would have otherwise prevented the kernel from printing the full panic output and properly completing the panic() path. Change-Id: I217a8d719f64b54467fa88a583d83f72193d7580 Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* | | sysctl: add boot_reason and cold_boot sysctl entries for arm64David Collins2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define boot_reason and cold_boot variables in the arm64 version of setup.c so that arm64 targets can export the boot_reason and cold_boot sysctl entries. This feature is required by the qpnp-power-on driver. Change-Id: Id2d4ff5b8caa2e6a35d4ac61e338963d602c8b84 Signed-off-by: David Collins <collinsd@codeaurora.org> [osvaldob: resolved trival merge conflicts] Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
* | | ARM64: smp: Fix cpu_up() racing with sys_rebootAbhimanyu Kapur2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing stops a process from hotplugging in a CPU concurrently with a sys_reboot() call. In such a situation we could have ipi_cpu_stop() mark a cpu as 'offline' and _cpu_up() ignore the fact that the CPU is not really offline and call the CPU_UP_PREPARE notifier. When this happens stop_machine code will complain that the cpu thread already exists and BUG_ON(). CPU0 CPU1 sys_reboot() kernel_restart() machine_restart() machine_shutdown() smp_send_stop() ... ipi_cpu_stop() set_cpu_online(1, false) local_irq_disable() while(1) <PREEMPT> cpu_up() _cpu_up() if (!cpu_online(1)) __cpu_notify(CPU_UP_PREPARE...) cpu_stop_cpu_callback() BUG_ON(stopper->thread) This is easily reproducible by hotplugging in and out in a tight loop while also rebooting. Since the CPU is not really offline and hasn't gone through the proper steps to be marked as such, let's mark the CPU as inactive. This is just as easily testable as online and avoids any possibility of _cpu_up() trying to bring the CPU back online when it never was offline to begin with. Based on the similar patchset by for arm targets 040c163( "ARM: smp: Fix cpu_up() racing with sys_reboot)" CRs-fixed: 758395 Change-Id: Ia13a3aad8cd6616119a07b5114350591173a5d03 Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
* | | ARM64: Use pr_debug() for CPU hotplug messagesStepan Moskovchenko2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, CPU online messages are printed using printk(), and CPU offline messages are printed using pr_notice(). It seems rather silly to have the (otherwise symmetric) messages to be printed using different log levels. Change both messages to be printed using pr_debug() to match the ARM implementation, to avoid disparities in log spam on ARM/ARM64 with otherwise identical loglevel settings. Change-Id: I58ce95c5b76093ee27678de497cf5c4cab4ad3aa Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* | | arm64: Don't call dump_mem() on stack memory during __die()Matt Wagantall2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With multiple CPUs online, these memory dumps may consume a very large amount of log buffer space, pushing out useful information. Drop the call to dump_mem() for stack memory. The actual string- formatted call stack will still be printed, which should be sufficient for identifying the context of a panic. Stack memory can be collected from full memory ramdumps if needed. Change-Id: I2d08b49217b3838d3d3e7f8deceb937bb90ffaf7 Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
* | | arm64: Dump memory surrounding PC, LR and SP registers onlyMatt Wagantall2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the verbosity of printing, dumping memory regions for all register when many CPUs are online may contribute to flooded kernel logs. Spinlock lockups due to the printing have also been seen to result, compounding the problem due to additional prints. Change-Id: I7440b2d77f03fd34f36816f549588fa89322ce5f Signed-off-by: Matt Wagantall <mattw@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
* | | arm64: Export caching APIsLaura Abbott2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | External modules may need to use caching APIs. Export the symbols to allow their use. Change-Id: I72a862608d37dedf0980ee2790ffb93a9de82221 Signed-off-by: Laura Abbott <lauraa@codeaurora.org> [stepanm@codeaurora.org: resolve minor conflicts] Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
* | | arm64: Call idle notifiers in CPU idlePatrick Cain2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CPU idle is enabled, the idle call should also notifiy the idle_notifier_call_chain of the change in status. Otherwise some processes will think the CPU is always active. CRs-Fixed: 677525 Change-Id: Iabd6f617d6835688cf8b482ac1321e5c1deafffd Signed-off-by: Patrick Cain <pcain@codeaurora.org>
* | | arm64: Print device tree model string during bootStepan Moskovchenko2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change to refactor kernel/setup.c to use the common of_flat_dt_get_machine_name() API has apparently removed the line which prints the device tree model string during boot. Having the model string in the kernel log is helpful, so add it back in. Change-Id: I7dccc3ab00f5b67753cdd256846a522596c5058f Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
* | | arm64: Add pdev_archdata for dmamaskLaura Abbott2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dma_mask for a device structure is a pointer. This pointer needs to be set up before the dma mask can actually be set. Most frameworks in the kernel take care of setting this up properly but platform devices that don't follow a regular bus structure may not ever have this set. As a result, checks such as dma_capable will always return false on a raw platform device and dma_set_mask will always return -EIO. Fix this by adding a dma_mask in the platform_device archdata and setting it to be the dma_mask. Devices used in other frameworks can change this as needed. Change-Id: I5bfd2aa75798dfdf49d3af70fdd95dfaf2126e8c Signed-off-by: Laura Abbott <lauraa@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
* | | ARM64: smp: fix incorrect per-cpu definition of regs_before_stopRohit Vaswani2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit f3b4a40bc637a25c01c5ec66c825b4ddfc30328a introduced changes to store CPU registers for all CPUs that handle IPI_CPU_STOP. The structure to save the registers was intended to be a per-cpu variable. However, the patch did not allocate a per-cpu structure and instead only ended up providing a compiler per-cpu directive. Fix this bug by actually defining a static per-cpu variable. Change-Id: Iea7e52e91819f6f2c7f8d2c638545c0a68d2ef76 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
* | | ARM64: smp: BUG() if smp_send_reschedule() is called for an offline cpuTrilok Soni2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the commit 8b775be35e41b9ffa764411a632b52015d1e3d69 Sending an IPI_RESCHEDULE to an offline CPU is incorrect and potentially bad for both power and stability. On some sub-architectures such as MSM, if a power-collapsed CPU is unexpectedly woken up by an IPI, it will be begin executing without the preparations that would normally happen as part of CPU_UP_PREPARE. If clocks, voltage regulators, or other hardware configuration are not performed, the booting CPU may cause general instability or (at best) poor power performance since the CPU would be powered up but not utilized. One common cause for such issues is misuse of add_timer_on() or APIs such as queue_work_on() which call it. If proper precautions are not taken to block hotplug while these APIs are called then a race may result in IPIs being sent to CPUs that are already offline. This same argument could be applied to other IPIs (with the exception of IPI_WAKEUP), but the others are already restricted to only online CPUs by existing mechanisms, so an explicit assertion is not useful. Change-Id: I2607082719b4cb216e53fb354649ea4c5c875b1e Signed-off-by: Matt Wagantall <mattw@codeaurora.org> Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
* | | ARM64: smp: Save CPU registers before IPI_CPU_STOP processingRohit Vaswani2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a kernel panic occurs on one CPU, other CPUs are instructed to stop execution via the IPI_CPU_STOP message. These other CPUs dump their stack, which may not be good enough to reconstruct their context to perform post-mortem analysis. Dump each CPU's context (before it started procesing the IPI) into a globally accessible structure and print them on the dmesg/console to allow for easier post-mortem debugging. Change-Id: Ifd7589af4327992540196c87f8b640045d7eaf19 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org> [abhimany: resolve trivial merge conflic] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
* | | arm64: alternative: Support memory protectionPatrick Daly2016-03-01
| |/ |/| | | | | | | | | | | | | Modify the kernel code section with fixmap to handle the case where the kernel text section is readonly. Change-Id: I3f81fcbfe917ef42783e55b107289ad97e1c02c3 Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
* | Revert "ARM: Blacklist GCC 4.8.0 to GCC 4.8.2 - PR58854"Ruchi Kandoi2016-02-16
| | | | | | | | This reverts commit 7fc150543c73de71859631c8a6b17e3067fe7617.
* | FROMLIST: x86: mm: support ARCH_MMAP_RND_BITS.dcashman2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit https://lkml.org/lkml/2015/12/21/339) x86: arch_mmap_rnd() uses hard-coded values, 8 for 32-bit and 28 for 64-bit, to generate the random offset for the mmap base address. This value represents a compromise between increased ASLR effectiveness and avoiding address-space fragmentation. Replace it with a Kconfig option, which is sensibly bounded, so that platform developers may choose where to place this compromise. Keep default values as new minimums. Bug: 24047224 Signed-off-by: Daniel Cashman <dcashman@android.com> Signed-off-by: Daniel Cashman <dcashman@google.com> Change-Id: Ic38735a8de2943843a73b5c20855ccfa92513422
* | FROMLIST: arm64: mm: support ARCH_MMAP_RND_BITS.dcashman2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit https://lkml.org/lkml/2015/12/21/340) arm64: arch_mmap_rnd() uses STACK_RND_MASK to generate the random offset for the mmap base address. This value represents a compromise between increased ASLR effectiveness and avoiding address-space fragmentation. Replace it with a Kconfig option, which is sensibly bounded, so that platform developers may choose where to place this compromise. Keep default values as new minimums. Bug: 24047224 Signed-off-by: Daniel Cashman <dcashman@android.com> Signed-off-by: Daniel Cashman <dcashman@google.com> Change-Id: I0be0bf8b1ed412863f248323e2d86b1df5bf21c6
* | FROMLIST: arm: mm: support ARCH_MMAP_RND_BITS.dcashman2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit https://lkml.org/lkml/2015/12/21/341) arm: arch_mmap_rnd() uses a hard-code value of 8 to generate the random offset for the mmap base address. This value represents a compromise between increased ASLR effectiveness and avoiding address-space fragmentation. Replace it with a Kconfig option, which is sensibly bounded, so that platform developers may choose where to place this compromise. Keep 8 as the minimum acceptable value. Bug: 24047224 Signed-off-by: Daniel Cashman <dcashman@android.com> Signed-off-by: Daniel Cashman <dcashman@google.com> Change-Id: I438ae2dae939ea7f311246832cb789afdd6cba4e
* | FROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR.dcashman2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit https://lkml.org/lkml/2015/12/21/337) ASLR only uses as few as 8 bits to generate the random offset for the mmap base address on 32 bit architectures. This value was chosen to prevent a poorly chosen value from dividing the address space in such a way as to prevent large allocations. This may not be an issue on all platforms. Allow the specification of a minimum number of bits so that platforms desiring greater ASLR protection may determine where to place the trade-off. Bug: 24047224 Signed-off-by: Daniel Cashman <dcashman@android.com> Signed-off-by: Daniel Cashman <dcashman@google.com> Change-Id: Ibf9ed3d4390e9686f5cc34f605d509a20d40e6c2
* | ARM64: copy CONFIG_CMDLINE_EXTEND from ARMColin Cross2016-02-16
| | | | | | | | | | | | | | | | | | Copy the config choice for CONFIG_CMDLINE_EXTEND from arch/arm/Kconfig, including CONFIG_CMDLINE_FROM_BOOTLOADER as the default. These will be used by drivers/of/fdt.c. Change-Id: I8416038498ddf8fc1e99ab06109825eb1492aa7f Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: decompressor: Flush tlb before swiching domain 0 to client modeArve Hjønnevåg2016-02-16
| | | | | | | | | | | | | | | | | | | | | | If the bootloader used a page table that is incompatible with domain 0 in client mode, and boots with the mmu on, then swithing domain 0 to client mode causes a fault if we don't flush the tlb after updating the page table pointer. v2: Add ISB before loading dacr. Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | ARM64: add option to build Image.gz/dtb comboAlex Ray2016-02-16
| | | | | | | | | | | | | | | | | | | | Allows a defconfig to set a list of dtbs to concatenate with an Image.gz to create a Image.gz-dtb. Includes 8adb162 arm64: Fix correct dtb clean-files location Change-Id: I0b462322d5c970f1fdf37baffece7ad058099f4a Signed-off-by: Alex Ray <aray@google.com>
* | ARM: convert build of appended dtb zImage to list of dtbsColin Cross2016-02-16
| | | | | | | | | | | | | | | | | | Allow CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES to specify a space separated list of dtbs to append to the zImage, and name the resulting file zImage-dtb Change-Id: Ied5d0bafbd1d01fc1f109c15c4283de7029903c9 Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: add config option to build zImage/dtb comboErik Gilling2016-02-16
| | | | | | | | | | | | | | | | Allows a defconfig to set a default dtb to concatenate with a zImage to create a zImage-dtb.<dtb name> Signed-off-by: Erik Gilling <konkers@android.com> Change-Id: I34b643b1c49228fbae88a56e46c93c478089620d
* | ARM: Fix dtb list when DTB_IMAGE_NAMES is emptyBenoit Goby2016-02-16
| | | | | | | | | | | | | | | | In the 3.10 kernel, dtb-y is not defined in Makefile.boot anymore but in dts/Makefile, so it needs to be included too. Change-Id: I6d6fccf933709bcb6220ce8f12b4b9e2a7c40d63 Signed-off-by: Benoit Goby <benoit@android.com>
* | arm64: pass return address to dma_common_contiguous_remapJin Qian2016-02-16
| | | | | | | | | | | | Added return address to show caller function in /proc/vmallocinfo Change-Id: Ieb0bbf6ec82b561cea6ff18f0516744050dfc269
* | arm64 Kconfig: Move LIST_POISON to a safe valueJeff Vander Stoep2016-02-16
| | | | | | | | | | | | | | | | | | Move the poison pointer offset to 0xdead000000000000, a recognized value that is not mappable by user-space exploits. Change-Id: I558441a26a7c8390aa087f32c4cbe980de8c8ce3 Signed-off-by: Thierry Strudel <tstrudel@google.com> Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
* | arch: arm64: force -fno-picGreg Hackmann2016-02-16
| | | | | | | | | | | | | | | | | | The aarch64-linux-android- toolchain enables -fpic by default. -fpic isn't needed for the kernel and breaks CONFIG_JUMP_LABEL, so turn it off. Change-Id: I685da1dc60e4cf1e9abcfb56e03654675ac02a0c Signed-off-by: Greg Hackmann <ghackmann@google.com>
* | arm64: process: dump memory around registers when displaying regsGreg Hackmann2016-02-16
| | | | | | | | | | | | | | | | | | A port of 8608d7c4418c75841c562a90cddd9beae5798a48 to ARM64. Both the original code and this port are limited to dumping kernel addresses, so don't bother if the registers are from a userspace process. Change-Id: Idc76804c54efaaeb70311cbb500c54db6dac4525 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* | arm64: check for upper PAGE_SHIFT bits in pfn_valid()Greg Hackmann2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | pfn_valid() returns a false positive when the lower (64 - PAGE_SHIFT) bits match a valid pfn but some of the upper bits are set. This caused a kernel panic in kpageflags_read() when a userspace utility parsed /proc/*/pagemap, neglected to discard the upper flag bits, and tried to lseek()+read() from the corresponding offset in /proc/kpageflags. A valid pfn will never have the upper PAGE_SHIFT bits set, so simply check for this before passing the pfn to memblock_is_memory(). Change-Id: Ief5d8cd4dd93cbecd545a634a8d5885865cb5970 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* | ARM: fault: assume no context when IRQs are disabled during data abort.JP Abgrall2016-02-16
| | | | | | | | | | | | | | | | | | | | Bail out early if IRQs are disabled in do_page_fault or else [14415.157266] BUG: sleeping function called from invalid context at arch/arm/mm/fault.c:301 Russell King's idea from http://comments.gmane.org/gmane.linux.ports.arm.omap/59256 Signed-off-by: JP Abgrall <jpa@google.com>
* | ARM: Fix "Make low-level printk work" to use a separate config optionArve Hjønnevåg2016-02-16
| | | | | | | | | | Change-Id: I5ca8db61b595adc642a07ea187bd41fd7636840e Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | ARM: add option to flush console before rebootDima Zavin2016-02-16
| | | | | | | | | | | | | | | | | | | | | | If the console_lock was held while the system was rebooted, the messages in the temporary logbuffer would not have propogated to all the console drivers. This force releases the console lock if it failed to be acquired. Change-Id: I193dcf7b968be17966833e50b8b8bc70d5d9fe89 Signed-off-by: Dima Zavin <dima@android.com>
* | Optionally flush entire dcache from v6_dma_flush_rangeArve Hjønnevåg2016-02-16
| | | | | | | | | | | | | | | | If CACHE_FLUSH_RANGE_LIMIT is defined, then the entire dcache will be flushed if the requested range is larger than this limit. Change-Id: I29277d645a9d6716b1952cf3b870c78496261dd0 Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | process: Add display of memory around registers when displaying regs.San Mehat2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is extremely useful in diagnosing remote crashes, and is based heavily on original work by <md@google.com>. Signed-off-by: San Mehat <san@google.com> Cc: Michael Davidson <md@google.com> [ARM] process: Use uber-safe probe_kernel_address() to read mem when dumping. This prevents the dump from taking pagefaults / external aborts. Change-Id: I8df76e8638780f94fb1bd7ea4471e3f7b01df950 Signed-off-by: San Mehat <san@google.com>
* | ARM: Call idle notifiersTodd Poynor2016-02-16
| | | | | | | | | | | | Change-Id: Id833e61c13baa1783705ac9e9046d1f0cc90c95e Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | Move x86_64 idle notifiers to genericTodd Poynor2016-02-16
| | | | | | | | | | | | | | | | | | Move the x86_64 idle notifiers originally by Andi Kleen and Venkatesh Pallipadi to generic. Change-Id: Idf29cda15be151f494ff245933c12462643388d5 Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | fiq_debugger: move into drivers/staging/android/fiq_debugger/Colin Cross2016-02-16
| | | | | | | | | | | | | | | | Move fiq_debugger into drivers/staging/android/fiq_debugger/ to allow for sharing between ARM and ARM64. Change-Id: I6ca5e8b7e3d000f57da3234260261c5592cef2a8 Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: fiq_glue: Add custom fiq return handler api.Arve Hjønnevåg2016-02-16
| | | | | | | | | | Change-Id: I5ff2764e85151ca0a88576542fda07c2d33dd065 Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | ARM: kgdb: ignore breakpoint instructions from user modeTodd Poynor2016-02-16
| | | | | | | | | | | | | | | | Avoid conflicts with user mode usage of the same instructions, as with Clang -ftrapv. Change-Id: I12d1c6d8f94376bfd2503cb0be843d7e478fb6ea Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | ARM: fiq_debugger: Update tty code for 3.9Arve Hjønnevåg2016-02-16
| | | | | | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | ARM: fiq_debugger: Use kmsg_dumper to dump kernel logsArve Hjønnevåg2016-02-16
| | | | | | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | ARM: fiq_debugger: Fix to compile on 3.7Arve Hjønnevåg2016-02-16
| | | | | | | | | | | | Use for_each_irq_desc in arch/arm/common/fiq_debugger.c Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | ARM: fiq_debugger: fix uninitialised spin_lock.Mars2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backtrace: [<c0045ea0>] (dump_backtrace+0x0/0x10c) from [<c0575c60>] (dump_stack+0x1) r6:c07a489c r5:c0c9b9dc r4:00000002 r3:271aed3b [<c0575c48>] (dump_stack+0x0/0x1c) from [<c00b1b00>] (__lock_acquire+0x93) [<c00b11c8>] (__lock_acquire+0x0/0xad4) from [<c00b219c>] (lock_acquire+0) [<c00b210c>] (lock_acquire+0x0/0xa4) from [<c057e544>] (_raw_spin_lock_ir) [<c057e4f8>] (_raw_spin_lock_irq+0x0/0x5c) from [<c005297c>] (fiq_tty_wri) r5:e30f0000 r4:e36f0c00 [<c005293c>] (fiq_tty_write+0x0/0x80) from [<c023168c>] (n_tty_write+0x18) r8:e370fc40 r7:e378a000 r6:e3572d1c r5:e36f0c00 r4:00000002 r3:c005293c [<c0231500>] (n_tty_write+0x0/0x440) from [<c022d4a4>] (tty_write+0x100/0) [<c022d3a4>] (tty_write+0x0/0x2a8) from [<c0100b80>] (vfs_write+0xa4/0x14) [<c0100adc>] (vfs_write+0x0/0x148) from [<c0100cdc>] (sys_write+0x40/0x78) r8:00000002 r7:4076d2c4 r6:e370fc40 r5:00000000 r4:00000000 [<c0100c9c>] (sys_write+0x0/0x78) from [<c0041740>] (ret_fast_syscall+0x0) r8:c0041908 r7:00000004 r6:00000002 r5:00000000 r4:4007cbe0 [ccross: moved spin_lock_init into existing #ifdef] Change-Id: If400d084eb20433c126ea1dd027a6be7f2ebb1f6 Signed-off-by: Mars <caoziqiang@meizu.com> Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: fiq_debugger: lock between tty and console writesColin Cross2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debug_console_write calls debug_uart_flush, which will usually wait until the serial port fifo empties. If another thread is continuously calling fiq_tty_write, the fifo will constantly be refilled and debug_uart_flush might never return. Add a spinlock that is locked in debug_console_write and fiq_tty_write to ensure they can't run at the same time. This has an extra advantage of preventing lines from the console and tty from being mixed together. Also reduce the size returned by fiq_tty_write_room to keep the time spent with the spinlock held to a reasonable value. In addition, make sure fiq context can't loop forever by never calling debug_uart_flush when the console is enabled. Change-Id: I5712b01f740ca0c84f680d2032c9fa16b7656939 Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: fiq_debugger: add process context reboot commandColin Cross2016-02-16
| | | | | | | | | | | | | | | | | | | | kernel_restart cannot be called from interrupt context. Add support for commands called from a work function, and implement the "reboot" command there. Also rename the existing irq-mode command to "reset" and change it to use machine_restart instead of kernel_restart. Change-Id: I3c423147c01db03d89e95a5b99096ca89462079f Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: fiq_debugger: fix multiple consoles and make it a preferred consoleColin Cross2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix setting up consoles on multiple fiq debugger devices by splitting the tty driver init into the initcall, and initializing the single tty device during probe. Has the side effect of moving the tty device node to /dev/ttyFIQx, where x is the platform device id, which should normally match the serial port. To avoid having to pass a different console=/dev/ttyFIQx for every device, make the fiq debugger a preferred console that will be used by default if no console was passed on the command line. Change-Id: I6cc2670628a41e84615859bc96adba189966d647 Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: fiq_debugger: add support for kgdbColin Cross2016-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds polling tty ops to the fiq debugger console tty, which allows kgdb to run against an fiq debugger console. Add a check in do_sysrq to prevent enabling kgdb from the fiq debugger unless a flag (writable only by root) has been set. This should make it safe to enable KGDB on a production device. Also add a shortcut to enable the console and kgdb together, to allow kgdb to be enabled when the shell on the console is not responding. Change-Id: Ifc65239ca96c9887431a6a36b9b44a539002f544 Signed-off-by: Colin Cross <ccross@android.com>
* | ARM: fiq_debugger: add debug_putcColin Cross2016-02-16
| | | | | | | | | | | | | | | | Convert all the calls to state->pdata->uart_putc to a debug_putc helper. Change-Id: Idc007bd170ff1b51d0325e238105ae0c86d23777 Signed-off-by: Colin Cross <ccross@android.com>