summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mfd: rtsx: Move some actions from rtsx_pci_init_hw to individual extra_init_hwWei WANG2013-08-205-4/+12
| | | | | | | | These actions are individual for each reader model, so should be put in extra_init_hw instead of rtsx_pci_init_hw. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: rtsx: Add shutdown callback in rtsx_pci_driverWei WANG2013-08-207-12/+85
| | | | | | | | | | | | | Some actions to clear power state should be handled in .shutdown callback in rtsx_pci_driver. This patch adopts the following measures to catch this goal: 1. Add a function rtsx_pci_power_off to abstract the common ops in .shutdown and .suspend 2. Add pcr->ops->force_power_down to fulfill the individual action for each reader model Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: rtsx: Read vendor setting from config spaceWei WANG2013-08-208-68/+365
| | | | | | | | | | Normally OEMs will set vendor setting to the config space of Realtek card reader in BIOS stage. This patch reads the setting at the first, and configure the internal registers according to it, to improve card reader's compatibility condition. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6030-irq: Add interrupt mapping table for the twl6032Oleksandr Dmytryshyn2013-08-201-1/+47
| | | | | | | | | | The TWL6032 PMIC has different IRQ status bits meaning. Hence, add interrupt mapping table for the twl6032. Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6030-irq: Create struct twl6030_irqGrygorii Strashko2013-08-201-42/+59
| | | | | | | | | Create "struct twl6030_irq" and place all local variables inside it. Also allocate twl6030_irq structure dynamically during initialization. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6030-irq: Convert to use linear irq_domainGrygorii Strashko2013-08-201-50/+69
| | | | | | | | | | | | | | | | | Since the TWL6030 PMIC is used with OMAP4 SoCs only and OMAP4 legacy boot is dropped there are no needs to allocate the range of IRQ descriptors during system boot to support TWL6030 IRQs. Hence, convert it to use linear irq_domain and move IRQ configuration in .map()/.unmap() callbacks of irq_domain. So, IRQ mapping and descriptors allocation will be performed dynamically basing on DT configuration. The error message will be reported in case if unmapped IRQ is received by TWL6030 (virq==0). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6030-irq: Add error check when IRQs are masked initiallyGrygorii Strashko2013-08-201-4/+9
| | | | | | | | | Add a missed check for errors when TWL IRQs are masked initially on probe and report an error in case of failure. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6030-irq: Migrate to IRQ threaded handlerNaga Venkata Srikanth V2013-08-201-100/+50
| | | | | | | | | | | | | | | | | | | | | | | 1) Removed request_irq() and replaced it with request_threaded_irq(). 2) Removed generic_handle_irq() and replaced it with handle_nested_irq(). Handling of these interrupts is nested, as we are handling an interrupt (for e.g rtc, mmc1) when we are still servicing TWL irq. 3) Removed I2C read-retry logic for the case when twl_i2c_read() is failed inside IRQ handler - there is no sense to do that, so just report an error and return. 4) Each nested IRQ is configured with corresponding parent_irq, which need to be retriggered in case if nested IRQ is marked as IRQS_PENDING. Signed-off-by: Naga Venkata Srikanth V <vnv.srikanth@samsung.com> Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: palmas: Add support for external control configurationLaxman Dewangan2013-08-202-0/+146
| | | | | | | | | | | Some of Palmas resources like clock, SMPSs, LDOs etc can be controlled by external pins ENABLE1, ENABLE2 or NSLEEP. Add support to configure these resources to externally controlled. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: da9063: Add IRQ supportKrystian Garbaciak2013-08-204-1/+288
| | | | | | | | | | | This patch adds a regmap irqchip for DA9063 IRQs. It depends on git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-irq-ack-mask Signed-off-by: Krystian Garbaciak <krystian.garbaciak@diasemi.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: da9063: Add Dialog DA9063 core driverKrystian Garbaciak2013-08-206-0/+492
| | | | | | | | | | | | | | | | | | | | | This is MFD module providing access to registers and interrupts of DA906x series PMIC. It is used by other functional modules, registered as MFD cells. Driver uses regmap with paging to access extended register list. Register map is divided into two pages, where the second page is used during initialisation. This module provides support to following functional cells: - Regulators - RTC - HWMON - OnKey (power key misc input device) - Vibration (force-feedback input device) - Watchdog - LEDs Signed-off-by: Krystian Garbaciak <krystian.garbaciak@diasemi.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: da9063: Add register definitions for DA9063 driverKrystian Garbaciak2013-08-201-0/+1028
| | | | | | | | | | This patch adds register definitions for the DA9063 PMIC. They will be used by the following DA9063 mfd core driver and functional module drivers. Signed-off-by: Krystian Garbaciak <krystian.garbaciak@diasemi.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* Merge tag 'regmap-irq-ack-mask' of ↵Samuel Ortiz2013-08-202-3/+32
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap regmap: Support for acknowledging masked IRQs Some devices need interrupts to be clear when they are masked otherwise the interrupt is not deasserted by the mask being set - add support for this to regmap-irq from Philipp Zabel.
| * regmap: irq: document mask/wake_invert flagsPhilipp Zabel2013-07-241-0/+2
| | | | | | | | | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * regmap: irq: make flags bool and put them in a bitfieldPhilipp Zabel2013-07-241-4/+4
| | | | | | | | | | | | | | | | This patch makes mask/wake_invert bool and puts all flags into a bitfield for consistency and to save some space. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * regmap: irq: Allow to acknowledge masked interrupts during initializationPhilipp Zabel2013-07-232-0/+27
| | | | | | | | | | | | | | | | | | | | In case the hardware interrupt mask register does not prevent the chip level irq from being asserted by the corresponding interrupt status bit, already set interrupt bits should to be cleared once after masking them during initialization. Add a flag to let drivers enable this behavior. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | mfd: ucb1x00: Explicitely include linux/device.hAndrea Adami2013-07-311-0/+1
| | | | | | | | | | | | | | | | | | Fixes this compilation error: linux/include/linux/mfd/ucb1x00.h:137:17: error: field 'dev' has incomplete type Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: mcp: Add missing linux/device.h headerAndrea Adami2013-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | Fixes this compilation error: linux/include/linux/mfd/mcp.h:22:16: error: field 'attached_device' has incomplete type linux/include/linux/mfd/mcp.h:48:23: error: field 'drv' has incomplete type Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | MFD: ti_tscadc: Disable TSC config registers in adc modePatil, Rachna2013-07-311-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | AFE Pen Ctrl and TouchScreen transistors enabling is not required when only ADC mode is being used, so check for availability of TSC driver before accessing control register. Signed-off-by: Patil, Rachna <rachna@ti.com> Acked-by: Vaibhav Hiremath <hvaibhav@ti.com> Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | MFD: ti_tscadc: ADC Clock check not requiredPatil, Rachna2013-07-312-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ADC is ideally expected to work at a frequency of 3MHz. The present code had a check, which returned error if the frequency went below the threshold value. But since AM335x supports various working frequencies, this check is not required. Now the code just uses the internal ADC clock divider to set the ADC frequency w.r.t the sys clock. Signed-off-by: Patil, Rachna <rachna@ti.com> Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: wm8994: Remove check for active audio in runtime suspendMark Brown2013-07-311-29/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since enabling VMID takes a runtime PM reference there is no need to suppress suspend when doing a runtime suspend. Similarly the digital inputs and outputs are DAPM widgets and therefore the ASoC core will be holding a reference for them. This used to be required when integration with system suspend was being bodged. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: wm8994: Remove unneeded check for JACKDETMark Brown2013-07-311-14/+0
| | | | | | | | | | | | | | | | | | The jack detection code holds runtime PM references when required so there is no need for suspend to do any checks. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: wm8997: Make Kconfig prompt for WM8997 more consistentMark Brown2013-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | The Kconfig prompt for WM8997 says "Support for..." while the other MFD Kconfigs (including the adjacent ones for other Arizona devices) just list the device name which sticks out like a sore thumb when doing configuration. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: s2mps11: Remove clocks from regulators listYadwinder Singh Brar2013-07-311-5/+1
| | | | | | | | | | | | | | | | | | | | Since these are fixed rate clocks which are registered with common clock framework so remove these from list of regulators which were unnecessarily incrementing the count(S2MPS11_REGULATOR_MAX) of regulators. Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: syscon: Remove "base" field from private driver dataAlexander Shiyan2013-07-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | During a move to use managed resources, the .remove function all was deemed superfluous which subsequently led to its deletion. As there are no remaining users of the stored 'base' address we only have to use it locally during probe. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: twl6040: Cleanup in early error handling in probe functionPeter Ujfalusi2013-07-311-9/+5
| | | | | | | | | | | | | | | | The err: label is not needed we can just return instead of the jump there. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: twl6040: Cosmetic, parameter alignment changePeter Ujfalusi2013-07-311-11/+10
| | | | | | | | | | | | | | | | To comply with coding style. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: twl6040: Remove support for legacy (pdata) modePeter Ujfalusi2013-07-312-42/+14
| | | | | | | | | | | | | | | | | | | | | | | | TWL6040 is used only with OMAP4/5 SoCs and they can only boot in in DT mode. The support for pdata/legacy boot can be removed. Add TODO comment to the header file that all pdata struct can be removed in the next merge window (after the sub driver updates are in). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: sec: Add register cache for interrupt mask registersMark Brown2013-07-311-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | The performance of regmap-irq is improved if the interrupt mask registers can be cached since it does read/modify/update cycles so start using the register cache infrastructure for those registers. We should use this more widely but I don't have a datasheet and this is a nice, conservative starting point. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: Update DA9055 i2c device id nameAnkur Raina2013-07-311-1/+1
| | | | | | | | | | | | | | | | | | DA9055 is a combination of pmic and codec. This patch updates the DA9055 i2c device id name to match the standard naming convention followed for such chips. Signed-off-by: Ankur Raina <Ankur.Raina@kpitcummins.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: Fix for DA9055 driver initializationAnkur Raina2013-07-311-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch clears all the events received while powering up DA9055. While powering up DA9055, both power sequencer and gpio events are received. These events remain uncleared after boot up, due to which further event handling also fails. DA9055 has three event registers. The event register bits are set to '1' on receiving an event. The events can be cleared on writing a '1' to the set bit, which would then clear that bit to '0'. After applying this patch we have a clean state after boot up. Signed-off-by: Ankur Raina <Ankur.Raina@kpitcummins.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: s2mps11: Add device tree supportYadwinder Singh Brar2013-07-312-0/+92
| | | | | | | | | | | | | | | | | | This patch adds DT compatible string for s2mps11 and binding documentation. Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | mfd: Add TPS659038 documentation under PalmasJ Keerthy2013-07-311-0/+2
| | | | | | | | | | | | | | | | | | Add TPS659038 Device Tree documentation. Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: J Keerthy <j-keerthy@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | Linux 3.11-rc3v3.11-rc3Linus Torvalds2013-07-281-1/+1
| |
* | Merge tag 'pinctrl-for-v3.11-2' of ↵Linus Torvalds2013-07-287-19/+49
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Driver fixes for AM33xx, SIRF and PFC pin controllers - Fix a compile warning from the pinctrl single-register driver - Fix a little nasty memory leak * tag 'pinctrl-for-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: fix a memleak when freeing maps pinctrl: pinctrl-single: fix compile warning when no CONFIG_PM pinctrl: sh-pfc: fix SDHI0 VccQ regulator on sh73a0 with DT arm/dts: sirf: fix the pingroup name mismatch between drivers and dts pinctrl: sirf: add usp0_uart_nostreamctrl pin group for usp-uart without flowctrl pinctrl: sirf: fix the pin number and mux bit for usp0 pinctrl: am33xx dt binding: correct include path
| * | pinctrl: fix a memleak when freeing mapsLinus Walleij2013-07-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | We forgot to free the node itself when free:ing a map. Reported-by: xulinuxkernel <xulinuxkernel@gmail.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | pinctrl: pinctrl-single: fix compile warning when no CONFIG_PMJean-Francois Moine2013-07-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This warning has been introduced by the commit 0f9bc4bcdf4f pinctrl: single: adopt pinctrl sleep mode management Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | pinctrl: sh-pfc: fix SDHI0 VccQ regulator on sh73a0 with DTGuennadi Liakhovetski2013-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PFC pinctrl driver on sh73a0 is also regiatering a VccQ regulator for SDHI0. However, its consumers list only included the platform-data based SDHI device name. When booted with DT SDHI0 couldn't enable VccQ and therefore was unusable. Fix this by adding a consumer with DT-based name. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | arm/dts: sirf: fix the pingroup name mismatch between drivers and dtsBarry Song2013-07-222-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | in drivers/pinctrl/sirf, pingroup name is cko0 and cko1, but in dts, they are cko0 and cko1_rst. this patch fixes the error in dts. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | pinctrl: sirf: add usp0_uart_nostreamctrl pin group for usp-uart without ↵Qipan Li2013-07-222-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flowctrl this patch adds the lost pin group which supports to let USP0 to simulate a UART without hardware flow control. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | pinctrl: sirf: fix the pin number and mux bit for usp0Qipan Li2013-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | we missed a pin and related mux bit for usp pin group, this patch fixes it. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | pinctrl: am33xx dt binding: correct include pathIan Campbell2013-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using #include <include/...> is a bit odd. It happens to work because the DTC flags include -Iarch/FOO/boot/dts as well as arch/FOO/boot/dts/include and arch/FOO/boot/dts/include/dt-bindings is a symlink to include/dt-bindings. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | | Merge tag 'trace-fixes-3.11-rc2' of ↵Linus Torvalds2013-07-283-128/+95
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Oleg is working on fixing a very tight race between opening a event file and deleting that event at the same time (both must be done as root). I also found a bug while testing Oleg's patches which has to do with a race with kprobes using the function tracer. There's also a deadlock fix that was introduced with the previous fixes" * tag 'trace-fixes-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus() ftrace: Add check for NULL regs if ops has SAVE_REGS set tracing: Kill trace_cpu struct/members tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu() tracing: Change tracing_entries_fops to rely on tracing_get_cpu() tracing: Change tracing_stats_fops to rely on tracing_get_cpu() tracing: Change tracing_buffers_fops to rely on tracing_get_cpu() tracing: Change tracing_pipe_fops() to rely on tracing_get_cpu() tracing: Introduce trace_create_cpu_file() and tracing_get_cpu()
| * | | tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()Steven Rostedt (Red Hat)2013-07-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a82274151af "tracing: Protect ftrace_trace_arrays list in trace_events.c" added taking the trace_types_lock mutex in trace_events.c as there were several locations that needed it for protection. Unfortunately, it also encapsulated a call to tracing_reset_all_online_cpus() which also takes the trace_types_lock, causing a deadlock. This happens when a module has tracepoints and has been traced. When the module is removed, the trace events module notifier will grab the trace_types_lock, do a bunch of clean ups, and also clears the buffer by calling tracing_reset_all_online_cpus. This doesn't happen often which explains why it wasn't caught right away. Commit a82274151af was marked for stable, which means this must be sent to stable too. Link: http://lkml.kernel.org/r/51EEC646.7070306@broadcom.com Reported-by: Arend van Spril <arend@broadcom.com> Tested-by: Arend van Spriel <arend@broadcom.com> Cc: Alexander Z Lam <azl@google.com> Cc: Vaibhav Nagarnaik <vnagarnaik@google.com> Cc: David Sharp <dhsharp@google.com> Cc: stable@vger.kernel.org # 3.10 Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * | | ftrace: Add check for NULL regs if ops has SAVE_REGS setSteven Rostedt (Red Hat)2013-07-241-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a ftrace ops is registered with the SAVE_REGS flag set, and there's already a ops registered to one of its functions but without the SAVE_REGS flag, there's a small race window where the SAVE_REGS ops gets added to the list of callbacks to call for that function before the callback trampoline gets set to save the regs. The problem is, the function is not currently saving regs, which opens a small race window where the ops that is expecting regs to be passed to it, wont. This can cause a crash if the callback were to reference the regs, as the SAVE_REGS guarantees that regs will be set. To fix this, we add a check in the loop case where it checks if the ops has the SAVE_REGS flag set, and if so, it will ignore it if regs is not set. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * | | tracing: Kill trace_cpu struct/membersOleg Nesterov2013-07-242-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the previous changes trace_array_cpu->trace_cpu and trace_array->trace_cpu becomes write-only. Remove these members and kill "struct trace_cpu" as well. As a side effect this also removes memset(per_cpu_memory, 0). It was not needed, alloc_percpu() returns zero-filled memory. Link: http://lkml.kernel.org/r/20130723152613.GA23741@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * | | tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu()Oleg Nesterov2013-07-241-28/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing_open() and tracing_snapshot_open() are racy, the memory inode->i_private points to can be already freed. Convert these last users of "inode->i_private == trace_cpu" to use "i_private = trace_array" and rely on tracing_get_cpu(). v2: incorporate the fix from Steven, tracing_release() must not blindly dereference file->private_data unless we know that the file was opened for reading. Link: http://lkml.kernel.org/r/20130723152610.GA23737@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * | | tracing: Change tracing_entries_fops to rely on tracing_get_cpu()Oleg Nesterov2013-07-241-37/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing_open_generic_tc() is racy, the memory inode->i_private points to can be already freed. 1. Change its last user, tracing_entries_fops, to use tracing_*_generic_tr() instead. 2. Change debugfs_create_file("buffer_size_kb", data) callers to pass "data = tr". 3. Change tracing_entries_read() and tracing_entries_write() to use tracing_get_cpu(). 4. Kill the no longer used tracing_open_generic_tc() and tracing_release_generic_tc(). Link: http://lkml.kernel.org/r/20130723152606.GA23730@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * | | tracing: Change tracing_stats_fops to rely on tracing_get_cpu()Oleg Nesterov2013-07-241-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing_open_generic_tc() is racy, the memory inode->i_private points to can be already freed. 1. Change one of its users, tracing_stats_fops, to use tracing_*_generic_tr() instead. 2. Change trace_create_cpu_file("stats", data) to pass "data = tr". 3. Change tracing_stats_read() to use tracing_get_cpu(). Link: http://lkml.kernel.org/r/20130723152603.GA23727@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * | | tracing: Change tracing_buffers_fops to rely on tracing_get_cpu()Oleg Nesterov2013-07-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing_buffers_open() is racy, the memory inode->i_private points to can be already freed. Change debugfs_create_file("trace_pipe_raw", data) caller to pass "data = tr", tracing_buffers_open() can use tracing_get_cpu(). Change debugfs_create_file("snapshot_raw_fops", data) caller too, this file uses tracing_buffers_open/release. Link: http://lkml.kernel.org/r/20130723152600.GA23720@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
OpenPOWER on IntegriCloud