summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'wip-mips-pm' of https://github.com/paulburton/linux into ↵Ralf Baechle2014-05-2941-218/+2257
|\ | | | | | | mips-for-linux-next
| * MIPS: Malta: CPS SMP by defaultPaul Burton2014-05-282-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The CONFIG_MIPS_CPS SMP implementation should be able to handle all cases the CONFIG_MIPS_CMP implementation does, but without requiring bootloader assistance. It is also required in order to make use of features such as hotplug & cpuidle core power gating. Enable it by default for Malta configs that previously enabled the now deprecated CONFIG_MIPS_CMP, and disable the latter. The local version suffix "cmp" is removed rather than replaced with "cps" since there are other ways to tell that the CPS SMP implementation is in use (the "VPE topology" line in the boot log being one). Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * cpuidle: cpuidle-cps: add MIPS CPS cpuidle driverPaul Burton2014-05-285-0/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a cpuidle driver for systems based around the MIPS Coherent Processing System (CPS) architecture. It supports four idle states: - The standard MIPS wait instruction. - The non-coherent wait, clock gated & power gated states exposed by the recently added pm-cps layer. The pm-cps layer is used to enter all the deep idle states. Since cores in the clock or power gated states cannot service interrupts, the gic_send_ipi_single function is modified to send a power up command for the appropriate core to the CPC in cases where the target CPU has marked itself potentially incoherent. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * cpuidle: declare cpuidle_dev in cpuidle.hPaul Burton2014-05-281-0/+1
| | | | | | | | | | | | | | | | | | Declaring this allows drivers which need to initialise each struct cpuidle_device at initialisation time to make use of the structures already defined in cpuidle.c, rather than having to wastefully define their own. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: include cpuidle Kconfig menuPaul Burton2014-05-281-2/+6
| | | | | | | | | | | | | | This patch simply includes the cpuidle Kconfig entries in preparation for cpuidle drivers used on MIPS systems. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: cpuidle wait instruction statePaul Burton2014-05-282-0/+25
| | | | | | | | | | | | | | | | Defines a macro intended to allow trivial use of the regular MIPS wait instruction from cpuidle drivers, which may simply invoke the macro within their array of states. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: duplicate core0 CCA on secondary coresPaul Burton2014-05-282-5/+14
| | | | | | | | | | | | | | | | Rather than hardcoding CCA=0x5 for secondary cores, re-use the CCA from the boot CPU. This allows overrides of the CCA using the cca= kernel parameter to take effect on all CPUs for consistency. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: set a coherent default CCAPaul Burton2014-05-281-0/+3
| | | | | | | | | | | | | | | | This patch sets a default CCA suited for use with multi-core SMP on all current MIPS CPS based systems. It may still be overriden by the cca= argument on the kernel command line. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: prevent multi-core SMP with unsuitable CCAPaul Burton2014-05-281-2/+28
| | | | | | | | | | | | | | | | If the user or bootloader sets the CCA to a value which is not suited for multi-core SMP (ie. anything non-coherent) then limit the system to using only a single core and warn the user. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: hotplug supportPaul Burton2014-05-282-2/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for offlining CPUs via hotplug when using the CONFIG_MIPS_CPS SMP implementation. When a CPU is offlined one of 2 things will happen: - If the CPU is part of a core which implements the MT ASE and there is at least one other VPE online within that core then the VPE will be halted by settings its TCHalt bit. - Otherwise if supported the core will be powered down via the CPC. - Otherwise the CPU will hang by executing an infinite loop. Bringing CPUs back online is then a process of either clearing the appropriate VPEs TCHalt bit or powering up the appropriate core via the CPC. Throughout the process the struct core_boot_config vpe_mask field must be maintained such that mips_cps_boot_vpes will start & stop the correct VPEs. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: pm-cps: add PM state entry code for CPS systemsPaul Burton2014-05-286-0/+809
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds code to generate entry & exit code for various low power states available on systems based around the MIPS Coherent Processing System architecture (ie. those with a Coherence Manager, Global Interrupt Controller & for >=CM2 a Cluster Power Controller). States supported are: - Non-coherent wait. This state first leaves the coherent domain and then executes a regular MIPS wait instruction. Power savings are found from the elimination of coherency interventions between the core and any other coherent requestors in the system. - Clock gated. This state leaves the coherent domain and then gates the clock input to the core. This removes all dynamic power from the core but leaves the core at the mercy of another to restart its clock. Register state is preserved, but the core can not service interrupts whilst its clock is gated. - Power gated. This deepest state removes all power input to the core. All register state is lost and the core will restart execution from its BEV when another core powers it back up. Because register state is lost this state requires cooperation with the CONFIG_MIPS_CPS SMP implementation in order for the core to exit the state successfully. The code will detect which states are available on the current system during boot & generate the entry/exit code for those states. This will be used by cpuidle & hotplug implementations. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: use CPC core-other lockingPaul Burton2014-05-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The core which the CPC core-other region relates to is based upon the core-local core-other addressing register. As its name suggests this register is shared between all VPEs within a core, and if there is a possibility that multiple VPEs within a core will attempt to access another core simultaneously then locking is required. This wasn't previously a problem with the only user being cpu0 during boot, but will be an issue once hotplug is implemented & may race with other users such as cpuidle. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: flush cache after patching mips_cps_core_entryPaul Burton2014-05-281-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The start of mips_cps_core_entry is patched in order to provide the code with the address of the CM register region at a point where it will be running non-coherent with the rest of the system. However the cache wasn't being flushed after that patching which could in principle lead to secondary cores using an invalid CM base address. The patching is moved to cps_prepare_cpus since local_flush_icache_range has not been initialised at the point cps_smp_setup is called. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: function to determine whether CPS SMP is in usePaul Burton2014-05-282-0/+8
| | | | | | | | | | | | | | | | | | The core power down state for cpuidle will require that the CPS SMP implementation is in use. This patch provides a mips_cps_smp_in_use function which determines whether or not the CPS SMP implementation is currently in use. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: smp-cps: rework core/VPE initialisationPaul Burton2014-05-285-161/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When hotplug and/or a powered down idle state are supported cases will arise where a non-zero VPE must be brought online without VPE 0, and it where multiple VPEs must be onlined simultaneously. This patch prepares for that by: - Splitting struct boot_config into core & VPE boot config structures, allocated one per core or VPE respectively. This allows for multiple VPEs to be onlined simultaneously without clobbering each others configuration. - Indicating which VPEs should be online within a core at any given time using a bitmap. This allows multiple VPEs to be brought online simultaneously and also indicates to VPE 0 whether it should halt after starting any non-zero VPEs that should be online within the core. For example if all VPEs within a core are offlined via hotplug and the user onlines the second VPE within that core: 1) The core will be powered up. 2) VPE 0 will run from the BEV (ie. mips_cps_core_entry) to initialise the core. 3) VPE 0 will start VPE 1 because its bit is set in the cores bitmap. 4) VPE 0 will halt itself because its bit is clear in the cores bitmap. - Moving the core & VPE initialisation to assembly code which does not make any use of the stack. This is because if a non-zero VPE is to be brought online in a powered down core then when VPE 0 of that core runs it may not have a valid stack, and even if it did then it's messy to run through parts of generic kernel code on VPE 0 before starting the correct VPE. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: uasm: add MT ASE yield instructionPaul Burton2014-05-283-1/+11
| | | | | | | | | | | | | | This patch allows use of the MT ASE yield instruction from uasm. It will be used by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: uasm: add wait instructionPaul Burton2014-05-284-1/+5
| | | | | | | | | | | | | | This patch allows use of the wait instruction from uasm. It will be used by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: uasm: add sync instructionPaul Burton2014-05-284-2/+6
| | | | | | | | | | | | | | This patch allows use of the sync instruction from uasm. It will be used by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: uasm: add jalr instructionPaul Burton2014-05-283-4/+10
| | | | | | | | | | | | | | This patch allows use of the jalr instruction from uasm. It will be used by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: uasm: add a label variant of beqPaul Burton2014-05-282-0/+10
| | | | | | | | | | | | | | This patch allows for use of the beq instruction with labels from uasm, much as bne & others already do. It will be used by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: inst.h: define microMIPS wait opPaul Burton2014-05-281-0/+1
| | | | | | | | | | | | | | The opcode for the wait instruction within POOL32AXf was missing. This patch adds it for use by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: inst.h: define microMIPS sync opPaul Burton2014-05-281-0/+1
| | | | | | | | | | | | | | The opcode for the sync instruction within POOL32AXf was missing. This patch adds it for use by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: inst.h: define MT yield opPaul Burton2014-05-281-10/+11
| | | | | | | | | | | | | | The opcode for the MT ASE yield instruction within the spec3 group was missing. This patch adds it for use by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: inst.h: define COP0 wait opPaul Burton2014-05-281-1/+2
| | | | | | | | | | | | | | The func field for the wait instruction was missing from inst.h - this patch adds it. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: MT: define write_c0_tchalt macroPaul Burton2014-05-281-0/+2
| | | | | | | | | | | | | | Define a macro to write to the current TCs TCHalt register. This will be used by a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: add kmap_noncoherent to wire a cached non-coherent TLB entryPaul Burton2014-05-283-2/+20
| | | | | | | | | | | | | | | | | | | | This is identical to kmap_coherent apart from the cache coherency attribute used for the TLB entry, so kmap_coherent is abstracted to kmap_prot which is then called for both kmap_coherent & kmap_noncoherent. This will be used by a subsequent patch. Suggested-by: Leonid Yegoshin <leonid.yegoshin@imgtec.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: CPC: provide locking functionsPaul Burton2014-05-022-0/+53
| | | | | | | | | | | | | | | | | | | | | | This patch provides functions to lock & unlock access to the "core-other" register region of the CPC. Without performing appropriate locking it is possible for code using this region to be preempted or to race with code on another VPE within the same core, with one changing the core which the "core-other" region is acting upon at an inopportune time for the other. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: CPC: provide functions to retrieve register addressesPaul Burton2014-05-021-1/+6
| | | | | | | | | | | | | | | | | | This patch introduces addr_ functions in addition to the existing read_ & write_ functions. The new functions simply return the address of the appropriate CPC register rather than performing a memory access. This will be used in a subsequent patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: introduce cpu_coherent_maskPaul Burton2014-05-022-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Add a mask of CPUs which are currently known to be operating coherently. This is setup initially to be all present CPUs, but in a subsequent patch CPUs in a MIPS Coherent Processing System will be cleared in this mask as they enter non-coherent idle states. This will be used in order to determine when a CPU within a CPS system may need to be powered back up, but may also be used in future to optimise away wakeups for cache operations or TLB invalidations. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: support for generic clockevents broadcastPaul Burton2014-05-022-0/+44
| | | | | | | | | | | | | | | | This patch adds support for generic clockevents broadcast using the a dummy clockevent device and the tick_broadcast function introduced by commit 12ad10004645 "clockevents: Add generic timer broadcast function". Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: allow R4K clockevent device to function regardless of GICPaul Burton2014-05-021-6/+0
| | | | | | | | | | | | | | | | | | | | Having the GIC clockevent driver compiled should not prevent the R4K timer clockevent driver from functioning. One will be selected as the CPU local timer based upon their priorities and the other may simply be unused or in the case of the GIC timer may be used as the tick broadcast device. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: mark R4K clockevent device with CLOCK_EVT_FEAT_PERCPUPaul Burton2014-05-021-1/+2
| | | | | | | | | | | | | | | | | | The CLOCK_EVT_FEAT_PERCPU flag indicates that a clockevent device is only configurable by the CPU for which it is registered, and thus cannot be used as the tick broadcast device. That property is true of the R4K timer, which is inaccessible from other cores. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: mark R4K clockevent device with CLOCK_EVT_FEAT_C3STOPPaul Burton2014-05-021-1/+2
| | | | | | | | | | | | | | When a core enters a clock off or power down state its CP0 counter will be stopped along with it. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: allow GIC clockevent device config from other CPUsPaul Burton2014-05-023-1/+17
| | | | | | | | | | | | | | | | | | This patch allows the GIC clockevent device for a CPU to be configured by another CPU. This makes GIC clockevent devices suitable for use as the tick broadcast device, where formerly the GIC timer local to the configuring CPU would have been configured incorrectly. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: mark GIC clockevent device with CLOCK_EVT_FEAT_C3STOPPaul Burton2014-05-021-1/+2
| | | | | | | | | | | | | | | | Although the GIC counter will continue when a core is in a low power state and it will still trigger interrupts, the core will be incapable of servicing those interrupts rendering them useless. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: PM: Implement PM helper macrosJames Hogan2014-05-023-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement assembler helper macros in asm/pm.h for platform code to use for saving context across low power states - for example suspend to RAM or powered down cpuidle states. Macros are provided for saving and restoring the main CPU context used by C code and doing important configuration which must be done very early during resume. Notably EVA needs segmentation control registers to be restored before the stack or dynamically allocated memory is accessed, so that state is saved in global data. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: tlb-r4k: Add CPU PM callback to reconfigure TLBJames Hogan2014-05-021-1/+33
| | | | | | | | | | | | | | | | Add a CPU power management callback for the r4k TLB which reconfigures it after the CPU leaves a powered down state. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: c-r4k: Add CPU PM callback for coherencyJames Hogan2014-05-021-0/+24
| | | | | | | | | | | | | | | | Implement a CPU power management callback for the r4k cache, to set up coherency again after leaving a powered down state. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: traps: Add CPU PM callback for trap configurationJames Hogan2014-05-022-27/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a CPU power management callback for restoring trap related CPU configuration after CPU power up from a low power state. The following state is restored: - Status register - HWREna register - Exception vector configuration registers - Context/XContext register Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * MIPS: PM: Add CPU PM callbacks for general CPU contextJames Hogan2014-04-243-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a CPU power management notifier callback for preserving general CPU context. The CPU PM callbacks will be triggered by the powering down of CPU cores, for example by cpuidle drivers & in the future by suspend to RAM implementations. The current state preserved is mostly related to the process context: - FPU - DSP - ASID - UserLocal - Watch registers Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
* | MIPS: SNI: Remove USE_GENERIC_EARLY_PRINTK_8250Thomas Bogendoerfer2014-05-281-1/+0
| | | | | | | | | | | | | | | | | | | | SNI RM code has its own EARLY_PRINTK support no need for some generic 8250 stuff. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6715/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: Alchemy: Default to noncoherent IO on Au1200 ABManuel Lauss2014-05-282-24/+8
| | | | | | | | | | | | | | | | | | | | CONFIG_DMA_COHERENT is no longer set; default to noncoherent io on Au1200 revision AB to make USB work. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/6745/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: Octeon: Add PCIe2 support in arch_setup_msi_irq()Eunbong Song2014-05-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | In arch_setup_msi_irq(), there is no case for PCIe2. So board which have PCIe2 functionality fails to boot with "Kernel panic - not syncing: arch_setup_msi_irq: Invalid octeon_dma_bar_type" message. This patch solve this problem. Signed-off-by: Eunbong Song <eunb.song@samsung.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/6747/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: defconfigs: add MTD_SPI_NOR (new dependency for M25P80)Brian Norris2014-05-283-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These defconfigs contain the CONFIG_M25P80 symbol, which is now dependent on the MTD_SPI_NOR symbol. Add CONFIG_MTD_SPI_NOR to satisfy the new dependency. At the same time, drop the now-nonexistent CONFIG_MTD_CHAR symbol. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: Huang Shijie <b32955@freescale.com> Cc: Marek Vasut <marex@denx.de> Cc: linux-mtd@lists.infradead.org Patchwork: https://patchwork.linux-mips.org/patch/6878/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64Aaro Koskinen2014-05-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow 64-bit userspace programs to use ll64 types. The define name comes from commit 2c9c6ce0199a4d252e20c531cfdc9d24e39235c0 (powerpc: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64). The patch allows to compile perf on MIPS64 and eliminates the following warnings: tests/attr.c:74:4: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__u64' [-Werror=format=] Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/6890/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: Lemote 2F: cs5536: mfgpt: depend on !highresSebastian Andrzej Siewior2014-05-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This timer does not support oneshot mode and as such the system remains in periodic mode and won't support high res timers. This patch adds a note about this in Kconfig and lets it depend on !highres so users which want to use high timers don' stuck with this timer. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: linux-mips@linux-mips.org Cc: Hua Yan <yanh@lemote.com> Cc: Huacai Chen <chenhc@lemote.com> Cc: Alex Smith <alex.smith@imgtec.com> Cc: Hongliang Tao <taohl@lemote.com> Cc: Wu Zhangjin <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/6935/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: SMP: Remove plat_smp_ops cpus_done method.Ralf Baechle2014-05-2714-76/+0
| | | | | | | | | | | | | | | | | | Nothing was using the method and there isn't any need for this hook. This leaves smp_cpus_done() empty for the moment. As suggested by Paul Bolle <pebolle@tiscali.nl>. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: DTS: Fix missing device_type="memory" property in memory nodesLeif Lindholm2014-05-265-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few platforms lack a 'device_type = "memory"' for their memory nodes, relying on an old ppc quirk in order to discover its memory. Add the missing data so that all parsing code can find memory nodes correctly. Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: John Crispin <blogic@openwrt.org> Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: linux-mips@linux-mips.org Cc: devicetree@vger.kernel.org Cc: Mark Rutland <mark.rutland@arm.com> Cc: <stable@vger.kernel.org> Cc: gaurav.minocha@alumni.ubc.ca Patchwork: https://patchwork.linux-mips.org/patch/6989/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: SEAD3: Introduce the use of the managed version of kzallocHimangi Saraogi2014-05-261-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. Also, the now unnecessary labels out_mem and out are done away with. The error handling code is moved under if and return 0 is now at the end of the function. The following Coccinelle semantic patch was used for making the change: @platform@ identifier p, probefn, removefn; @@ struct platform_driver p = { .probe = probefn, .remove = removefn, }; @prb@ identifier platform.probefn, pdev; expression e, e1, e2; @@ probefn(struct platform_device *pdev, ...) { <+... - e = kzalloc(e1, e2) + e = devm_kzalloc(&pdev->dev, e1, e2) ... ?-kfree(e); ...+> } @rem depends on prb@ identifier platform.removefn; expression e; @@ removefn(...) { <... - kfree(e); ...> } Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Tested-by: Markos Chandras <markos.chandras@imgtec.com> Reviewed-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/6977/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: malta: Remove 'maybe_unused' attribute from ememsize{, _str}Markos Chandras2014-05-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | First introduced in e6ca4e5bf11466b5e9423a1e4ea51a8216c4b9b6 "MIPS: malta: malta-memory: Add support for the 'ememsize' variable" but it is not needed since both variables are visible to the compiler. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: <stable@vger.kernel.org> # v3.15+ Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6985/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
OpenPOWER on IntegriCloud