android_kernel_oneplus_msm8998/arch/sparc
Sowmini Varadhan c300313d48 sparc/pci: Refactor dev_archdata initialization into pci_init_dev_archdata
[ Upstream commit 9a78d4fc28904785ffe4c2d361e25b251b479704 ]

The function pcibios_add_device() added by commit d0c31e020057
("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10 07:41:37 -08:00
..
boot
configs
crypto crypto: sparc - initialize blkcipher.ivsize 2015-10-08 21:36:48 +08:00
include sparc64: Make atomic_xchg() an inline function rather than a macro. 2018-05-30 07:49:08 +02:00
kernel sparc/pci: Refactor dev_archdata initialization into pci_init_dev_archdata 2018-11-10 07:41:37 -08:00
lib sparc64: Delete now unused user copy fixup functions. 2016-11-21 10:06:42 +01:00
math-emu
mm sparc64/mm: set fields in deferred pages 2017-12-16 10:33:55 +01:00
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-06 00:43:52 -05:00
oprofile
power sparc64: Prevent perf from running during super critical sections 2017-08-12 19:29:09 -07:00
prom
Kbuild
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-11-18 11:11:07 +01:00
Kconfig.debug
Makefile