linux/arch/sparc/kernel
Sowmini Varadhan 9a78d4fc28 sparc/pci: Refactor dev_archdata initialization into pci_init_dev_archdata
The function pcibios_add_device() added by commit d0c31e0200
("sparc/PCI: Fix for panic while enabling SR-IOV") initializes
the dev_archdata by doing a memcpy from the PF. This has the
problem that it erroneously copies the OF device without
explicitly refcounting it.

As David Miller pointed out: "Generally speaking we don't
really support hot-plug for OF probed devices, but if we did
all of the device tree pointers have to be refcounted properly."

To fix this error, and also avoid code duplication, this patch
creates a new helper function, pci_init_dev_archdata(), that
initializes the fields in dev_archdata, and can be invoked
by callers after they have taken the needed refcounts

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-21 16:43:45 -04:00
..
.gitignore
apc.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
asm-offsets.c [PATCH] sparc32: vm_area_struct access for old Sun SPARCs. 2013-07-10 13:56:10 -07:00
audit.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
auxio_32.c sparc32: fix sparse warning in auxio_32.c 2014-05-18 19:01:27 -07:00
auxio_64.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
btext.c sparc64: fix sparse warning in btext.c 2014-05-18 19:01:30 -07:00
central.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
cherrs.S
chmc.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
compat_audit.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
cpu.c sparc64: correctly recognise M6 and M7 cpu type 2014-09-09 15:24:10 -07:00
cpumap.c sparc64: support M6 and M7 for building CPU distribution map 2014-09-09 15:24:10 -07:00
cpumap.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
devices.c sparc32: drop tadpole specific code 2014-05-18 19:01:29 -07:00
dma.c sparc: remove several unnecessary module.h include instances 2011-10-31 19:30:54 -04:00
ds.c sparc64: Move request_irq() from ldc_bind() to ldc_alloc() 2014-09-16 18:31:31 -07:00
dtlb_miss.S
dtlb_prot.S sparc64: Fix corrupted thread fault code. 2014-10-18 23:03:09 -04:00
ebus.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
entry.h sparc: Resolve conflict between sparc v9 and M7 on usage of bit 9 of TTE 2015-05-31 22:15:01 -07:00
entry.S sparc: Fix misspellings in comments. 2016-03-20 21:28:58 -07:00
etrap_32.S sparc32: introduce support for run-time patching for all shared assembler code 2012-05-27 23:52:49 -07:00
etrap_64.S sparc64: clear syscall_noerror on the entry to syscall, not on the exit 2012-10-14 19:26:52 -04:00
fpu_traps.S
ftrace.c ftrace: Do not pass data to ftrace_dyn_arch_init 2014-03-07 10:06:14 -05:00
getsetcc.S
head_32.S sparc32: drop swapper_pg_dir 2012-07-26 16:46:15 -07:00
head_64.S locking/lockdep: Eliminate lockdep_init() 2016-02-09 12:03:25 +01:00
helpers.S
hvapi.c sparc: perf: Add support M7 processor 2015-03-19 18:54:49 -07:00
hvcalls.S Add sun4v_wdt watchdog driver 2016-01-31 11:06:24 -08:00
hvtramp.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
idprom.c net: Add eth_platform_get_mac_address() helper. 2016-01-06 16:31:56 -05:00
iommu_common.h remove <asm/scatterlist.h> 2015-05-05 13:35:39 -06:00
iommu.c iommu-common: Fix error code used in iommu_tbl_range_{alloc,free}(). 2015-11-04 11:30:57 -08:00
ioport.c sparc: Fix misspellings in comments. 2016-03-20 21:28:58 -07:00
irq_32.c sparc32: fix sparse warnings in irq_32.c 2014-04-29 01:12:25 -04:00
irq_64.c sparc/irq: Use access helper irq_data_get_affinity_mask() 2015-07-31 22:20:05 +02:00
irq.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
itlb_miss.S
ivec.S
jump_label.c jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP} 2015-08-03 11:34:12 +02:00
kernel.h sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
kgdb_32.c sparc: explicitly include sched.h to get task_thread_info declaration 2013-02-06 11:04:10 -08:00
kgdb_64.c sparc64: fix sparse warning in kgdb_64.c 2014-05-18 19:01:34 -07:00
kprobes.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
kstack.h
ktlb.S sparc64: Adjust vmalloc region size based upon available virtual address bits. 2014-10-05 16:53:40 -07:00
ldc.c iommu-common: Fix error code used in iommu_tbl_range_{alloc,free}(). 2015-11-04 11:30:57 -08:00
led.c
leon_kernel.c sparc: Fix misspellings in comments. 2016-03-20 21:28:58 -07:00
leon_pci_grpci1.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
leon_pci_grpci2.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
leon_pci.c PCI: Cleanup control flow 2015-03-19 10:17:22 -05:00
leon_pmc.c sparc32: fix sparse warnings in leon_pmc.c 2014-04-29 01:12:27 -04:00
leon_smp.c sparc32, leon: Align ccall_info to prevent unaligned traps on crosscall 2014-12-11 18:51:56 -08:00
Makefile sparc32: drop tadpole specific code 2014-05-18 19:01:29 -07:00
mdesc.c new helpers: no_seek_end_llseek{,_size}() 2015-12-23 10:41:31 -05:00
misctrap.S
module.c mm: vmalloc: pass additional vm_flags to __vmalloc_node_range() 2015-02-13 21:21:42 -08:00
nmi.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
of_device_32.c sparc32: rename sparc_irq_config to sparc_config 2012-04-15 10:28:49 -07:00
of_device_64.c devicetree: add helper inline for retrieving a node's full name 2012-07-06 07:16:34 -05:00
of_device_common.c sparc: fix sparse warnings in of_device_common.c 2014-04-29 01:12:27 -04:00
of_device_common.h
pci_common.c sparc/PCI: Add mem64 resource parsing for root bus 2015-10-29 17:35:46 -05:00
pci_fire.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
pci_impl.h sparc/PCI: Add mem64 resource parsing for root bus 2015-10-29 17:35:46 -05:00
pci_msi.c PCI/MSI: Rename mask/unmask_msi_irq treewide 2014-11-23 13:01:45 +01:00
pci_psycho.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
pci_sabre.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
pci_schizo.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
pci_sun4v_asm.S
pci_sun4v.c iommu-common: Fix error code used in iommu_tbl_range_{alloc,free}(). 2015-11-04 11:30:57 -08:00
pci_sun4v.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
pci.c sparc/pci: Refactor dev_archdata initialization into pci_init_dev_archdata 2016-04-21 16:43:45 -04:00
pcic.c PCI: Assign resources before drivers claim devices (pci_scan_bus()) 2015-03-12 15:04:01 -05:00
pcr.c sparc: perf: Add support M7 processor 2015-03-19 18:54:49 -07:00
perf_event.c sparc64: Perf should save/restore fault info 2015-12-24 12:12:46 -05:00
pmc.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
power.c sparc: kernel: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
process_32.c sched, sparc32: Update scheduler comments in copy_thread() 2015-08-04 09:48:12 +02:00
process_64.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
prom_32.c sparc: remove several unnecessary module.h include instances 2011-10-31 19:30:54 -04:00
prom_64.c sparc64: fix sparse warning in prom_64.c 2014-05-18 19:01:31 -07:00
prom_common.c of: Fix locking vs. interrupts 2013-06-13 22:12:14 +01:00
prom_irqtrans.c sparc: Remove unnecessary semicolons 2011-06-07 16:06:34 -07:00
prom.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
psycho_common.c sparc: Remove unnecessary semicolons 2011-06-07 16:06:34 -07:00
psycho_common.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
ptrace_32.c sparc32: fix sparse warning in ptrace_32.c 2014-04-29 01:12:26 -04:00
ptrace_64.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
reboot.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
rtrap_32.S sparc32: introduce support for run-time patching for all shared assembler code 2012-05-27 23:52:49 -07:00
rtrap_64.S sparc64: Don't set %pil in rtrap_nmi too early 2015-12-24 12:07:16 -05:00
sbus.c sparc: kernel/sbus.c: fix memory leakage 2013-01-21 14:33:00 -08:00
setup_32.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
setup_64.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
signal32.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
signal_32.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
signal_64.c sparc64: Fix sparc64_set_context stack handling. 2016-03-01 00:25:32 -05:00
sigutil_32.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
sigutil_64.c Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
sigutil.h sparc: Allow handling signals when stack is corrupted. 2011-08-20 17:14:54 -07:00
smp_32.c arch/hotplug: Call into idle with a proper state 2016-03-01 20:36:57 +01:00
smp_64.c arch/hotplug: Call into idle with a proper state 2016-03-01 20:36:57 +01:00
sparc_ksyms_32.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
sparc_ksyms_64.c Add sun4v_wdt watchdog driver 2016-01-31 11:06:24 -08:00
spiterrs.S
sstate.c sparc: Set reboot-cmd using reboot data hypervisor call if available. 2011-08-02 21:28:52 -07:00
stacktrace.c sparc: move symbol exporters to use export.h not module.h 2011-10-31 19:30:53 -04:00
starfire.c arch: sparc: kernel: starfire.c: Remove unused function 2015-03-01 21:33:58 -08:00
sun4d_irq.c sparc/irq: Use helper irq_data_get_irq_handler_data() 2015-07-31 22:20:05 +02:00
sun4d_smp.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
sun4m_irq.c sparc/irq: Use helper irq_data_get_irq_handler_data() 2015-07-31 22:20:05 +02:00
sun4m_smp.c sparc/time: Migrate to new 'set-state' interface 2015-08-10 11:41:05 +02:00
sun4v_ivec.S
sun4v_tlb_miss.S sparc64: sun4v TLB error power off events 2014-09-16 17:46:44 -07:00
sys32.S sparc: Hook up renameat2 syscall. 2014-07-21 22:27:56 -07:00
sys_sparc32.c sparc64: fix sparse warnings in sys_sparc32.c 2014-05-18 19:01:31 -07:00
sys_sparc_32.c sparc32: fix sparse warnings in sys_sparc_32.c 2014-05-18 19:01:28 -07:00
sys_sparc_64.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
syscalls.S sparc: Fix system call tracing register handling. 2016-01-21 16:06:00 -08:00
sysfs.c sparc: Fix misspellings in comments. 2016-03-20 21:28:58 -07:00
systbls_32.S sparc: Write up preadv2/pwritev2 syscalls. 2016-03-29 18:39:26 -07:00
systbls_64.S sparc: Write up preadv2/pwritev2 syscalls. 2016-03-29 18:39:26 -07:00
systbls.h sparc64: fix sparse warnings in sys_sparc32.c 2014-05-18 19:01:31 -07:00
time_32.c sparc/time: Migrate to new 'set-state' interface 2015-08-10 11:41:05 +02:00
time_64.c sparc/time: Migrate to new 'set-state' interface 2015-08-10 11:41:05 +02:00
trampoline_32.S sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
trampoline_64.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
traps_32.c sparc: Remove signal translation and exec_domain 2015-04-12 21:03:21 +02:00
traps_64.c sparc: Remove signal translation and exec_domain 2015-04-12 21:03:21 +02:00
tsb.S sparc64: Fix corrupted thread fault code. 2014-10-18 23:03:09 -04:00
ttable_32.S sparc32: move trap table to a separate file 2012-05-19 23:27:25 -07:00
ttable_64.S sparc64: renamed ttable.S to ttable_64.S 2012-05-19 23:26:41 -07:00
una_asm_32.S sparc32: unaligned memory access (MNA) trap handler bug 2011-02-01 12:39:59 -08:00
una_asm_64.S sparc: Fix .size directive for do_int_load 2011-03-16 18:19:15 -07:00
unaligned_32.c sparc: use %s for unaligned panic 2014-07-21 21:37:06 -07:00
unaligned_64.c sparc: Convert naked unsigned uses to unsigned int 2016-03-20 21:28:58 -07:00
utrap.S
vio.c sparc64: Add vio_set_intr() to enable/disable Rx interrupts 2014-09-30 14:40:45 -07:00
viohs.c sparc: VIO protocol version 1.6 2014-09-30 14:17:08 -07:00
visemul.c sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads. 2012-10-26 15:18:37 -07:00
vmlinux.lds.S arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
windows.c sparc32: fix sparse warnings in windows.c 2014-04-29 01:12:25 -04:00
winfixup.S sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads. 2012-10-26 15:18:37 -07:00
wof.S sparc32: introduce support for run-time patching for all shared assembler code 2012-05-27 23:52:49 -07:00
wuf.S sparc32: introduce support for run-time patching for all shared assembler code 2012-05-27 23:52:49 -07:00