linux/arch/arm
Fabio Estevam f9d1f7a7ad ARM: imx: gpc: Fix the imx_gpc_genpd_init() error path
If of_genpd_add_provider_onecell() fails the following kernel crash is
observed on a kernel built with multi_v7_defconfig:

[    1.739301] [00000040] *pgd=00000000
[    1.739310] Internal error: Oops: 5 [#1] SMP ARM
[    1.739319] Modules linked in:
[    1.739328] CPU: 1 PID: 95 Comm: kworker/1:4 Not tainted 4.8.0-11897-g6b5e09a #1
[    1.739331] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    1.739352] Workqueue: pm genpd_power_off_work_fn
[    1.739356] task: ee63d400 task.stack: ee70a000
[    1.739365] PC is at mutex_lock+0xc/0x4c
[    1.739374] LR is at regulator_disable+0x2c/0x60
[    1.739379] pc : [<c0bc0da0>]    lr : [<c06e4b10>]    psr: 60000013
[    1.739379] sp : ee70beb0  ip : 10624dd3  fp : ee6e6280
[    1.739382] r10: eefb0900  r9 : 00000000  r8 : c1309918
[    1.739385] r7 : 00000000  r6 : 00000040  r5 : 00000000  r4 : 00000040
[    1.739390] r3 : 0000004c  r2 : 7fffd540  r1 : 000001e4  r0 : 00000040

Instead of returning of_genpd_add_provider_onecell() directly,
we should check its return value and in the case of error we
should unwind the previously taken actions, which in these case are:
- Call imx6q_pm_pu_power_off()
- Set imx6q_pu_domain.reg back to NULL

Setting imx6q_pu_domain.reg to NULL in the error case is important
as it will prevent further operations in the pu_reg regulator.

This kernel crash is not observed with imx_v6_v7_defconfig because
it selects GPU and VPU drivers, which are consumers of the GPC block
and thus change the refcount of the pu_reg regulator.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2016-10-24 15:13:02 +08:00
..
boot Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2016-10-12 11:05:23 -07:00
common Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2016-10-06 07:59:37 -07:00
configs fbdev changes for 4.9 2016-10-12 11:01:37 -07:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-10-10 11:19:47 +08:00
firmware
include Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-14 18:19:05 -07:00
kernel Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
kvm KVM updates for v4.9-rc1 2016-10-06 10:49:01 -07:00
lib Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-14 18:19:05 -07:00
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: stop *MIGHT_HAVE_PCI* config from being selected redundantly 2016-09-21 22:45:05 +02:00
mach-axxia ARM: select PCI_DOMAINS config from ARCH_MULTIPLATFORM 2016-09-21 22:45:13 +02:00
mach-bcm ARM: SoC platform updates for v4.9 2016-10-07 21:18:42 -07:00
mach-berlin
mach-clps711x ARM: clps711x: remove extraneous files 2016-09-02 18:15:00 +02:00
mach-cns3xxx ARM: select PCI_DOMAINS config from ARCH_MULTIPLATFORM 2016-09-21 22:45:13 +02:00
mach-davinci ARM: DT updates for v4.9 2016-10-07 21:29:04 -07:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos ARM: SoC platform updates for v4.9 2016-10-07 21:18:42 -07:00
mach-footbridge ARM: document and update UNCACHEABLE_ADDR definitions 2016-08-26 15:10:19 +01:00
mach-gemini
mach-highbank
mach-hisi
mach-imx ARM: imx: gpc: Fix the imx_gpc_genpd_init() error path 2016-10-24 15:13:02 +08:00
mach-integrator ARM: SoC: late DT updates for v4.9 2016-10-07 21:34:49 -07:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone ARM: select PCI_DOMAINS config from ARCH_MULTIPLATFORM 2016-09-21 22:45:13 +02:00
mach-ks8695
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-mmp
mach-moxart ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-mv78xx0 ARM: mv78xx0: simplify ethernet device creation 2016-09-14 16:35:37 +02:00
mach-mvebu ARM: don't include removed directories 2016-08-10 22:42:18 +02:00
mach-mxs ARM: mxs: remove obsolete startup code for TX28 2016-08-09 14:01:41 +08:00
mach-netx
mach-nomadik ARM: nomadik: select MFD_SYSCON 2016-09-09 23:15:50 +02:00
mach-nspire DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
mach-omap1 ARM: OMAP1: use IS_ENABLED() instead of checking for built-in or module 2016-08-26 08:41:59 -07:00
mach-omap2 ARM: SoC cleanups for v4.9 2016-10-07 21:16:16 -07:00
mach-orion5x ARM: orion5x: remove extraneous NO_IRQ 2016-09-14 16:36:20 +02:00
mach-oxnas ARM: oxnas: select reset controller framework 2016-08-10 22:42:32 +02:00
mach-picoxcell ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-prima2 ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-pxa ARM: SoC platform updates for v4.9 2016-10-07 21:18:42 -07:00
mach-qcom ARM: qcom: Cleanup/Remove unnecessary board file 2016-08-23 15:46:05 -05:00
mach-realview This deletes the realview boardfiles, consolidates a bit 2016-09-02 18:12:09 +02:00
mach-rockchip ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-rpc ARM: document and update UNCACHEABLE_ADDR definitions 2016-08-26 15:10:19 +01:00
mach-s3c24xx ARM: SoC platform updates for v4.9 2016-10-07 21:18:42 -07:00
mach-s3c64xx ARM: s3c64xx: Delete unnecessary assignment for the field "owner" 2016-08-16 08:16:43 +02:00
mach-s5pv210 ARM: don't include removed directories 2016-08-10 22:42:18 +02:00
mach-sa1100 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-10-07 09:12:19 -07:00
mach-shmobile ARM: SoC platform updates for v4.9 2016-10-07 21:18:42 -07:00
mach-socfpga
mach-spear ARM: stop *MIGHT_HAVE_PCI* config from being selected redundantly 2016-09-21 22:45:05 +02:00
mach-sti
mach-stm32
mach-sunxi ARM: sunxi: Support the Nextthing GR8 2016-09-08 14:32:23 +02:00
mach-tango
mach-tegra ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-u300 ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-uniphier ARM: uniphier: remove SoC-specific SMP code 2016-08-29 01:57:14 +09:00
mach-ux500 ARM: SoC driver updates for v4.8 2016-08-01 18:36:01 -04:00
mach-versatile ARM: stop *MIGHT_HAVE_PCI* config from being selected redundantly 2016-09-21 22:45:05 +02:00
mach-vexpress ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-vt8500 ARM: SoC cleanups for v4.8 2016-08-01 18:21:13 -04:00
mach-w90x900
mach-zx
mach-zynq
mm Merge branch 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-11 23:38:39 -07:00
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion ARM: orion: simplify orion_ge00_switch_init 2016-09-14 16:36:13 +02:00
plat-pxa ARM: pxa: remove platform dma code 2016-08-09 08:16:58 +02:00
plat-samsung ARM: EXYNOS: Remove unused DMC and CMU offsets and their mappings 2016-08-24 06:42:27 +02:00
plat-versatile
probes
tools
vdso
vfp
xen arm/xen: fix SMP guests boot 2016-09-14 14:39:13 +01:00
Kconfig Merge branch 'akpm' (patches from Andrew) 2016-10-07 21:38:00 -07:00
Kconfig-nommu
Kconfig.debug Renesas ARM Based SoC Updates for v4.9 2016-09-15 00:27:27 +02:00
Makefile Merge branches 'misc' and 'sa1111-base' into for-linus 2016-10-06 08:56:43 +01:00