linux-stable/arch/powerpc
Ryan Grimm 6f963ec2d6 cxl: Fix device_node reference counting
When unbinding and rebinding the driver on a system with a card in PHB0, this
error condition is reached after a few attempts:

ERROR: Bad of_node_put() on /pciex@3fffe40000000
CPU: 0 PID: 3040 Comm: bash Not tainted 3.18.0-rc3-12545-g3627ffe #152
Call Trace:
[c000000721acb5c0] [c00000000086ef94] .dump_stack+0x84/0xb0 (unreliable)
[c000000721acb640] [c00000000073a0a8] .of_node_release+0xd8/0xe0
[c000000721acb6d0] [c00000000044bc44] .kobject_release+0x74/0xe0
[c000000721acb760] [c0000000007394fc] .of_node_put+0x1c/0x30
[c000000721acb7d0] [c000000000545cd8] .cxl_probe+0x1a98/0x1d50
[c000000721acb900] [c0000000004845a0] .local_pci_probe+0x40/0xc0
[c000000721acb980] [c000000000484998] .pci_device_probe+0x128/0x170
[c000000721acba30] [c00000000052400c] .driver_probe_device+0xac/0x2a0
[c000000721acbad0] [c000000000522468] .bind_store+0x108/0x160
[c000000721acbb70] [c000000000521448] .drv_attr_store+0x38/0x60
[c000000721acbbe0] [c000000000293840] .sysfs_kf_write+0x60/0xa0
[c000000721acbc50] [c000000000292500] .kernfs_fop_write+0x140/0x1d0
[c000000721acbcf0] [c000000000208648] .vfs_write+0xd8/0x260
[c000000721acbd90] [c000000000208b18] .SyS_write+0x58/0x100
[c000000721acbe30] [c000000000009258] syscall_exit+0x0/0x98

We are missing a call to of_node_get(). pnv_pci_to_phb_node() should
call of_node_get() otherwise np's reference count isn't incremented and
it might go away. Rename pnv_pci_to_phb_node() to pnv_pci_get_phb_node()
so it's clear it calls of_node_get().

Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-02-02 14:51:31 +11:00
..
boot Merge remote-tracking branch 'scottwood/next' into next 2014-11-18 17:00:38 +11:00
configs powerpc/ps3: Enable CONFIG_PS3_REPOSITORY_WRITE in ps3_defconfig 2015-01-22 17:31:22 +11:00
crypto crypto: powerpc - replace memset by memzero_explicit 2014-12-02 22:55:50 +08:00
include cxl: Fix device_node reference counting 2015-02-02 14:51:31 +11:00
kernel powerpc: Remove some unused functions 2015-01-28 15:00:24 +11:00
kvm powerpc/kvm: Create proper names for the kvm_host_state PMU fields 2014-12-29 15:45:55 +11:00
lib powerpc/lib: Makefile, use obj64-y to consolidate 64-bit rules 2015-01-28 15:00:24 +11:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm powerpc: Remove some unused functions 2015-01-28 15:00:24 +11:00
net PPC: bpf_jit_comp: Unify BPF_MOD | BPF_X and BPF_DIV | BPF_X 2014-11-18 13:20:09 -05:00
oprofile powerpc updates for 3.19 2014-12-11 17:48:14 -08:00
perf power/perf/hv-24x7: Use kmem_cache_free() instead of kfree 2014-12-12 16:06:13 +11:00
platforms cxl: Fix device_node reference counting 2015-02-02 14:51:31 +11:00
sysdev powerpc: Replace cpumask_weight(cpu_possible_mask) with num_possible_cpus() 2015-01-23 14:02:51 +11:00
xmon powerpc/xmon: use isspace/isxdigit/isalnum from linux/ctype.h 2014-12-29 15:45:43 +11:00
Kconfig powerpc/mm: fix undefined reference to `.__kernel_map_pages' on FSL PPC64 2015-01-28 14:22:22 +11:00
Kconfig.debug Patch queue for ppc - 2014-08-01 2014-08-05 09:58:11 +02:00
Makefile powerpc: Add POWER8 CPU selection 2014-09-25 23:14:49 +10:00
relocs_check.pl