aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-04-25ARM: dt: tegra cardhu: basic audio supportStephen Warren1-0/+63
Add WM8903 codec nodes, and top-level sound complex node for basic analog audio over headset jack and internal speakers. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-25ARM: dt: tegra30.dtsi: Add audio-related nodesStephen Warren1-0/+41
Add nodes for the Tegra30 AHUB and I2S controllers. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-25ARM: tegra: add AUXDATA required for audioStephen Warren1-0/+1
Both the Tegra30 I2S and AHUB modules used clocks, and hence currently require AUXDATA in order to get specific device names so that clock lookups work. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-25ARM: tegra: set up audio clocks for tegra30 dtStephen Warren1-0/+9
Set up the audio clock tree for Tegra30 in an equivalent fashion to the existing setup for Tegra20. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-25ARM: tegra: Initialize pll_p_out1Peter De Schrijver1-0/+12
pll_a uses pll_p_out1 as its parent. Therefore this clock needs to be initialized to make sure pll_a has a known input clock. Failure to do so will cause the system to crash early in the bootup. Signed-off-by: Peter De Schrijver <[email protected]> Signed-off-by: Stephen Warren <[email protected]>
2012-04-25ARM: tegra: provide clock aliases for AHUB configlinkStephen Warren1-0/+9
The Tegra30 AHUB driver must call tegra_periph_reset_deassert() for all devices on the AHUB's configlink bus. The AHUB driver must be able to call clk_get_sys() to retrieve the clock parameter for this function. Add the necessary clock aliases to allow this. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-25pinctrl: tegra: error reporting cleanupStephen Warren1-26/+55
Print an explicit error message in various failure cases to allow easier diagnosis. WARN_ON() some internal failures that users/clients shouldn't be able to trigger. Signed-off-by: Stephen Warren <[email protected]>
2012-04-18pinctrl: tegra: debugfs enhancementsStephen Warren1-6/+69
* Only provide debugfs-relates ops when CONFIG_DEBUG_FS is enabled. * Implement pin_config_group_dbg_show op. * Implement pin_config_config_dbg_show op. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: tegra: refactor probe handlingStephen Warren6-96/+91
Rather than having a single tegra-pinctrl driver that determines whether it's running on Tegra20 or Tegra30, instead have separate drivers for each that call into utility functions to implement the majority of the driver. This change is based on review feedback of the SPEAr pinctrl driver, which had originally copied to Tegra driver structure. This requires that the two drivers have unique names. Update a couple spots in arch/arm/mach-tegra for the name change. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Linus Walleij <[email protected]>
2012-04-18ARM: dt: tegra20: add pinmux to device treeStephen Warren7-33/+1148
This adds a complete pinmux configuration to all Tegra20 device tree files. This allows removal of board-dt-tegra20.c's use of the pinmux board files, and the special device tree handling in board-pinmux.c. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18ARM: dt: tegra cardhu: add pinmux to device treeStephen Warren1-0/+44
This adds a minimal pinmux configuration to the Tegra Cardhu device tree. Initially, just the built-in eMMC and SD card slot are configured. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]
2012-04-18ARM: tegra: Remove pre-pinctrl pinmux driverStephen Warren7-2416/+0
The pinctrl driver is now active and used by all boards. Remove the old pinmux driver. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18ARM: tegra: Switch to new pinctrl driverStephen Warren8-578/+609
* Rename old pinmux and new pinctrl platform driver and DT match table entries, so the new driver gets instantiated. * Re-write board-pinmux.c, so that it uses pinctrl APIs to configura the pinmux. * Re-write board-*-pinmux.c so that the pinmux configuration tables are in pinctrl format. Ventana's pin mux table needed some edits on top of the basic format conversion, since some mux options that were previously marked as reserved are now valid in the new pinctrl driver. Attempting to use the old reserved names will result in a failure. Specifically, groups lpw0, lpw2, lsc1, lsck, and lsda were changed from function rsvd4 to displaya, and group pta was changed from function rsvd2 to hdmi. All boards' pin mux tables needed some edits on top of the based format conversion, since function i2c was split into i2c1 (first general I2C controller) and i2cp (power I2C controller) to better align function definitions with HW blocks. Due to the split of mux tables into pure mux and pull/tristate tables, many entries in the separate Seaboard/Ventana tables could be merged into the common table, since the entries differed only in the portion in one of the tables, not both. Most pin groups allow configuration of mux, tri-state, and pull. However, some don't allow pull configuration, which is instead configured by new groups that only allow pull configuration. This is a reflection of the true HW capabilities, which weren't fully represented by the old pinmux driver. This required adding new pull table entries for those new groups, and setting many other entries' pull configuration to TEGRA_PINCONFIG_DONT_SET. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18gpio: tegra: Hide tegra_gpio_enable/disable()Stephen Warren12-158/+27
Recent pinctrl discussions concluded that gpiolib APIs should in fact do whatever is required to mux a GPIO onto pins, by calling pinctrl APIs if required. This change implements this for the Tegra GPIO driver, and removes calls to the Tegra-specific APIs from drivers and board files. Cc: Chris Ball <[email protected]> Cc: [email protected] Signed-off-by: Stephen Warren <[email protected]> Acked-by: Chris Ball <[email protected]> # for sdhci-tegra.c Acked-by: Linus Walleij <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18ARM: tegra: seaboard: Don't gpio_request() ISL29018_IRQStephen Warren1-3/+0
Don't call gpio_request() or gpio_direction_input() for ISL29018_IRQ. This pin is only used as an IRQ, and hence no GPIO configuration should be necessary; the GPIO/IRQ driver should (and does) perform any required setup when the IRQ is requested. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18gpio: tegra: configure pins during irq_set_typeStephen Warren1-0/+3
When a Tegra GPIO is used as an IRQ, it should be enabled as a GPIO (so the pinmux module isn't driving it as an output) and configured as a GPIO input (so the GPIO module isn't driving it as an output). Set this up automatically whenever an IRQ is requested, so that users of IRQs don't need to do this. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18ARM: tegra: Remove VBUS_GPIO handling from board filesStephen Warren2-23/+9
Instead of having board files manually request and initialize USB VBUS GPIOs, fill in the USB driver's platform data and have it do it. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18usb: ehci-tegra: Add vbus_gpio to platform dataStephen Warren3-6/+11
Add a vbus_gpio field to platform data. This mirrors the device tree property nvidia,vbus-gpio. This makes the VBUS GPIO handling identical between booting with board files and device tree; the driver always does it. This removes the need for board files to request and initialize the GPIO early during their boot process, perhaps even before the GPIO driver is ready to process the request. Cc: Greg Kroah-Hartman <[email protected]> Cc: Alan Stern <[email protected]> Cc: [email protected] Signed-off-by: Stephen Warren <[email protected]> Acked-by: Olof Johansson <[email protected]>
2012-04-18pinctrl: show pin name for pingroups in sysfsDong Aisheng2-4/+29
Pin name is more useful to users. After change, when cat pingroups in sysfs, it becomes: root@freescale /sys/kernel/debug/pinctrl/20e0000.iomuxc$ cat pingroups registered pin groups: group: uart4grp-1 pin 219 (MX6Q_PAD_KEY_ROW0) pin 218 (MX6Q_PAD_KEY_COL0) group: usdhc4grp-1 pin 305 (MX6Q_PAD_SD4_CMD) pin 306 (MX6Q_PAD_SD4_CLK) pin 315 (MX6Q_PAD_SD4_DAT0) pin 316 (MX6Q_PAD_SD4_DAT1) pin 317 (MX6Q_PAD_SD4_DAT2) pin 318 (MX6Q_PAD_SD4_DAT3) pin 319 (MX6Q_PAD_SD4_DAT4) pin 320 (MX6Q_PAD_SD4_DAT5) pin 321 (MX6Q_PAD_SD4_DAT6) pin 322 (MX6Q_PAD_SD4_DAT7) Acked-by: Stephen Warren <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: show pin name when request pinsDong Aisheng1-2/+3
Pin name is more useful to users. Acked-by: Stephen Warren <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: implement devm_pinctrl_get()/put()Stephen Warren4-19/+133
These functions allow the driver core to automatically clean up any allocations made by drivers, thus leading to simplified drivers. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: a minor fix of pin config debug informationDong Aisheng1-2/+2
Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: pinconf: fix compilation error if PINCONF is not selectedViresh Kumar1-1/+1
When we compile pinctrl layer for platforms without CONFIG_PINCONF, we get following compilation errors: drivers/built-in.o: In function `pinctrl_show': linux-2.6/drivers/pinctrl/core.c:1116: undefined reference to `pinconf_show_setting' drivers/built-in.o: In function `pinctrl_maps_show': linux-2.6/drivers/pinctrl/core.c:1071: undefined reference to `pinconf_show_map' drivers/built-in.o: In function `pinctrl_init_device_debugfs': linux-2.6/drivers/pinctrl/core.c:1224: undefined reference to `pinconf_init_device_debugfs' make[1]: *** [.tmp_vmlinux1] Error 1 This patch fixes this. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: allow pctldevs to decode pin config in debugfsStephen Warren2-4/+32
Add a pinconf op so that pin controller drivers can decode their pin config settings for debugfs. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: ifdef CONFIG_DEBUG_FS cleanupStephen Warren2-11/+24
Only provide prototypes for pin{mux,conf}.c debugfs-related functions when both CONFIG_PIN* /and/ CONFIG_DEBUG_FS are enabled, otherwise provide static inlines. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: mark non-EXPERIMENTALLinus Walleij1-1/+0
With the finalization of the external driver API and the device tree support, this subsystem is now mature and can be promoted to non-experimental status. Acked-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: tegra: Add complete device tree supportStephen Warren1-0/+205
Implement pinctrl_ops dt_node_to_map() and dt_free_map(). These allow complete specification of the desired pinmux configuration using device tree. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18dt: Document Tegra20/30 pinctrl bindingStephen Warren2-2/+261
Define a new binding for the Tegra pin controller, which is capable of defining all aspects of desired pin multiplexing and pin configuration. This is all based on the new common pinctrl bindings. Add Tegra30 binding based on Tegra20 binding. Add some basic stuff that was missing before: * How many and what reg property entries must be provided. * An example. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18dt: Move Tegra20 pin mux binding into new pinctrl directoryStephen Warren1-0/+0
This places the file in the new location for all pin controller bindings. Also, rename the file using the full compatible value for easier avoidance of conflicts between multiple bindings. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18dt: pinctrl: Document device tree bindingStephen Warren1-0/+128
The core pin controller bindings define: * The fact that pin controllers expose pin configurations as nodes in device tree. * That the bindings for those pin configuration nodes is defined by the individual pin controller drivers. * A standardized set of properties for client devices to define numbered or named pin configuration states, each referring to some number of the afore-mentioned pin configuration nodes. * That the bindings for the client devices determines the set of numbered or named states that must exist. Signed-off-by: Stephen Warren <[email protected]> Acked-by: Shawn Guo <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Simon Glass <[email protected]> Acked-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18dt: add property iteration helpersStephen Warren2-0/+76
This patch adds macros of_property_for_each_u32() and of_property_for_each_string(), which iterate over an array of values within a device-tree property. Usage is for example: struct property *prop; const __be32 *p; u32 u; of_property_for_each_u32(np, "propname", prop, p, u) printk("U32 value: %x\n", u); struct property *prop; const char *s; of_property_for_each_string(np, "propname", prop, s) printk("String value: %s\n", s); Based on work by Rob Herring <[email protected]> Cc: Grant Likely <[email protected]> Signed-off-by: Stephen Warren <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: implement pinctrl deferred probingLinus Walleij3-6/+14
If drivers try to obtain pinctrl handles for a pin controller that has not yet registered to the subsystem, we need to be able to back out and retry with deferred probing. So let's return -EPROBE_DEFER whenever this location fails. Also downgrade the errors to info, maybe we will even set them to debug once the deferred probing is commonplace. Cc: Arnd Bergmann <[email protected]> Reviewed-by: Mark Brown <[email protected]> Acked-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: add some error checking for user interfacesDong Aisheng2-2/+17
This patch can avoid kernel oops in case the mux or config function is not supported by driver. Acked-by: Stephen Warren <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: fix pinmux_check_ops error checkingDong Aisheng1-3/+5
Do not use get_functions_count before checking. Acked-by: Stephen Warren <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: replace list_*() with get_*_count()Viresh Kumar10-115/+63
Most of the SoC drivers implement list_groups() and list_functions() routines for pinctrl and pinmux. These routines continue returning zero until the selector argument is greater than total count of available groups or functions. This patch replaces these list_*() routines with get_*_count() routines, which returns the number of available selection for SoC driver. pinctrl layer will use this value to check the range it can choose. This patch fixes all user drivers for this change. There are other routines in user drivers, which have checks to check validity of selector passed to them. It is also no more required and hence removed. Documentation updated as well. Acked-by: Stephen Warren <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> [Folded in fix and fixed a minor merge artifact manually] Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: mark const init data with __initconst instead of __initdataUwe Kleine-König2-3/+3
As long as there is no other non-const variable marked __initdata in the same compilation unit it doesn't hurt. If there were one however compilation would fail with error: $variablename causes a section type conflict because a section containing const variables is marked read only and so cannot contain non-const variables. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Randy Dunlap <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18Documentation: pinctrl: add missing spi0_0 grp in exampleViresh Kumar1-1/+1
Missed one group from the documentation when proofreading. Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: fix build when CONFIG_OF && !CONFIG_PINCTRLStephen Warren1-1/+3
pinctrl/devicetree.c won't compile when !CONFIG_PINCTRL, since the pinctrl headers don't declare some types when !PINCTRL. Make sure pinctrl/Makefile only attempts to compile devicetree.c when OF && PINCTRL. Acked-by: Dong Aisheng <[email protected]> Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: core device tree mapping table parsing supportStephen Warren6-18/+357
During pinctrl_get(), if the client device has a device tree node, look for the common pinctrl properties there. If found, parse the referenced device tree nodes, with the help of the pinctrl drivers, and generate mapping table entries from them. During pinctrl_put(), free any results of device tree parsing. Acked-by: Dong Aisheng <[email protected]> Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: implement pinctrl_check_opsStephen Warren1-4/+21
Most code assumes that the pinctrl ops are present. Validate this when registering a pinctrl driver. Remove the one place in the code that was checking whether one of these non-optional ops was present. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: include <linux/bug.h> to prevent compile errorsStephen Warren1-0/+2
Macros in <linux/pinctrl/machine.h> call ARRAY_SIZE(), the definition of which eventually calls BUILD_BUG_ON_ZERO(), which is defined in <linux/bug.h>. Include that so that every .c file using the pinctrl macros doesn't have to do that itself. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-18pinctrl: fix compile error if not select PINMUX supportDong Aisheng1-1/+1
The pinctrl_register_mappings is defined in core.c, so change the dependent macro from CONFIG_MUX to CONFIG_PINCTRL. The compile error message is: drivers/pinctrl/core.c:886: error: redefinition of 'pinctrl_register_mappings' include/linux/pinctrl/machine.h:160: note: previous definition of 'pinctrl_register_mappings' was here make[2]: *** [drivers/pinctrl/core.o] Error 1 make[1]: *** [drivers/pinctrl] Error 2 make: *** [drivers] Error 2 Acked-by: Stephen Warren <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-04-15Linux 3.4-rc3Linus Torvalds1-1/+1
2012-04-15Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds14-61/+46
Pull ARM fixes from Russell King: "Nothing too disasterous, the biggest thing being the removal of the regulator support for vcore in the AMBA driver; only one SoC was using this and it got broken during the last merge window, which then started causing problems for other people. Mutual agreement was reached for it to be removed." * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: ARM: 7386/1: jump_label: fixup for rename to static_key ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic MMU ARM: 7359/2: smp_twd: Only wait for reprogramming on active cpus ARM: 7383/1: nommu: populate vectors page from paging_init ARM: 7381/1: nommu: fix typo in mm/Kconfig ARM: 7380/1: DT: do not add a zero-sized memory property ARM: 7379/1: DT: fix atags_to_fdt() second call site ARM: 7366/3: amba: Remove AMBA level regulator support ARM: 7377/1: vic: re-read status register before dispatching each IRQ handler ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets incremented
2012-04-15x86-32: fix up strncpy_from_user() sign errorLinus Torvalds1-2/+2
The 'max' range needs to be unsigned, since the size of the user address space is bigger than 2GB. We know that 'count' is positive in 'long' (that is checked in the caller), so we will truncate 'max' down to something that fits in a signed long, but before we actually do that, that comparison needs to be done in unsigned. Bug introduced in commit 92ae03f2ef99 ("x86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up"). On x86-64 you can't trigger this, since the user address space is much smaller than 63 bits, and on x86-32 it works in practice, since you would seldom hit the strncpy limits anyway. I had actually tested the corner-cases, I had only tested them on x86-64. Besides, I had only worried about the case of a pointer *close* to the end of the address space, rather than really far away from it ;) This also changes the "we hit the user-specified maximum" to return 'res', for the trivial reason that gcc seems to generate better code that way. 'res' and 'count' are the same in that case, so it really doesn't matter which one we return. Signed-off-by: Linus Torvalds <[email protected]>
2012-04-15ARM: 7386/1: jump_label: fixup for rename to static_keyRabin Vincent1-1/+1
c5905afb0 ("static keys: Introduce 'struct static_key'...") renamed struct jump_label_key to struct static_key. Fixup ARM for this to eliminate these build warnings: include/linux/jump_label.h:113:2: warning: passing argument 1 of 'arch_static_branch' from incompatible pointer type include/asm/jump_label.h:17:82: note: expected 'struct jump_label_key *' but argument is of type 'struct static_key *' Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-04-15ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEEJonathan Austin1-0/+12
Currently when ThumbEE is not enabled (!CONFIG_ARM_THUMBEE) the ThumbEE register states are not saved/restored at context switch. The default state of the ThumbEE Ctrl register (TEECR) allows userspace accesses to the ThumbEE Base Handler register (TEEHBR). This can cause unexpected behaviour when people use ThumbEE on !CONFIG_ARM_THUMBEE kernels, as well as allowing covert communication - eg between userspace tasks running inside chroot jails. This patch sets up TEECR in order to prevent user-space access to TEEHBR when !CONFIG_ARM_THUMBEE. In this case, tasks are sent SIGILL if they try to access TEEHBR. Cc: [email protected] Reviewed-by: Will Deacon <[email protected]> Signed-off-by: Jonathan Austin <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-04-15ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic MMUWill Deacon1-1/+15
If a bank of memory spanning the 4GB boundary is added on a !CONFIG_LPAE kernel then we will hang early during boot since the memory bank will have wrapped around to zero. This patch truncates memory banks for !LPAE configurations when the end address is not representable in 32 bits. Acked-by: Nicolas Pitre <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-04-15ARM: 7359/2: smp_twd: Only wait for reprogramming on active cpusLinus Walleij1-1/+5
During booting of cpu1, there is a short window where cpu1 is online, but not active where cpu1 is occupied by waiting to become active. If cpu0 then decides to schedule something on cpu1 and wait for it to complete, before cpu0 has set cpu1 active, we have a deadlock. Typically it's this CPU frequency transition that happens at this time, so let's just not wait for it to happen, it will happen whenever the CPU eventually comes online instead. Cc: Peter Zijlstra <[email protected]> Cc: [email protected] Signed-off-by: Jonas Aaberg <[email protected]> Reviewed-by: Rickard Andersson <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Russell King <[email protected]>
2012-04-15PCI: Fix regression in pci_restore_state(), v3Rafael J. Wysocki1-18/+39
Commit 26f41062f28d ("PCI: check for pci bar restore completion and retry") attempted to address problems with PCI BAR restoration on systems where FLR had not been completed before pci_restore_state() was called, but it did that in an utterly wrong way. First off, instead of retrying the writes for the BAR registers only, it did that for all of the PCI config space of the device, including the status register (whose value after the write quite obviously need not be the same as the written one). Second, it added arbitrary delay to pci_restore_state() even for systems where the PCI config space restoration was successful at first attempt. Finally, the mdelay(10) it added to every iteration of the writing loop was way too much of a delay for any reasonable device. All of this actually caused resume failures for some devices on Mikko's system. To fix the regression, make pci_restore_state() only retry the writes for BAR registers and only wait if the first read from the register doesn't return the written value. Additionaly, make it wait for 1 ms, instead of 10 ms, after every failing attempt to write into config space. Reported-by: Mikko Vinni <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>