mirror of https://gitee.com/openkylin/linux.git
powerpc/eeh: Remove eeh_dev.c
The only thing in this file is eeh_dev_init() which is allocates and initialises an eeh_dev based on a pci_dn. This is only ever called from pci_dn.c so move it into there and remove the file. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200725081231.39076-2-oohall@gmail.com
This commit is contained in:
parent
475028efc7
commit
d74ee8e9d1
|
@ -293,7 +293,6 @@ void eeh_pe_restore_bars(struct eeh_pe *pe);
|
|||
const char *eeh_pe_loc_get(struct eeh_pe *pe);
|
||||
struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe);
|
||||
|
||||
struct eeh_dev *eeh_dev_init(struct pci_dn *pdn);
|
||||
void eeh_show_enabled(void);
|
||||
int __init eeh_ops_register(struct eeh_ops *ops);
|
||||
int __exit eeh_ops_unregister(const char *name);
|
||||
|
@ -339,11 +338,6 @@ static inline bool eeh_enabled(void)
|
|||
|
||||
static inline void eeh_show_enabled(void) { }
|
||||
|
||||
static inline void *eeh_dev_init(struct pci_dn *pdn, void *data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void eeh_dev_phb_init_dynamic(struct pci_controller *phb) { }
|
||||
|
||||
static inline int eeh_check_failure(const volatile void __iomem *token)
|
||||
|
|
|
@ -71,7 +71,7 @@ obj-$(CONFIG_PPC_RTAS_DAEMON) += rtasd.o
|
|||
obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
|
||||
obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
|
||||
obj-$(CONFIG_PPC_DT_CPU_FTRS) += dt_cpu_ftrs.o
|
||||
obj-$(CONFIG_EEH) += eeh.o eeh_pe.o eeh_dev.o eeh_cache.o \
|
||||
obj-$(CONFIG_EEH) += eeh.o eeh_pe.o eeh_cache.o \
|
||||
eeh_driver.o eeh_event.o eeh_sysfs.o
|
||||
obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
|
||||
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* The file intends to implement dynamic creation of EEH device, which will
|
||||
* be bound with OF node and PCI device simutaneously. The EEH devices would
|
||||
* be foundamental information for EEH core components to work proerly. Besides,
|
||||
* We have to support multiple situations where dynamic creation of EEH device
|
||||
* is required:
|
||||
*
|
||||
* 1) Before PCI emunation starts, we need create EEH devices according to the
|
||||
* PCI sensitive OF nodes.
|
||||
* 2) When PCI emunation is done, we need do the binding between PCI device and
|
||||
* the associated EEH device.
|
||||
* 3) DR (Dynamic Reconfiguration) would create PCI sensitive OF node. EEH device
|
||||
* will be created while PCI sensitive OF node is detected from DR.
|
||||
* 4) PCI hotplug needs redoing the binding between PCI device and EEH device. If
|
||||
* PHB is newly inserted, we also need create EEH devices accordingly.
|
||||
*
|
||||
* Copyright Benjamin Herrenschmidt & Gavin Shan, IBM Corporation 2012.
|
||||
*/
|
||||
|
||||
#include <linux/export.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <asm/pci-bridge.h>
|
||||
#include <asm/ppc-pci.h>
|
||||
|
||||
/**
|
||||
* eeh_dev_init - Create EEH device according to OF node
|
||||
* @pdn: PCI device node
|
||||
*
|
||||
* It will create EEH device according to the given OF node. The function
|
||||
* might be called by PCI emunation, DR, PHB hotplug.
|
||||
*/
|
||||
struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
|
||||
{
|
||||
struct eeh_dev *edev;
|
||||
|
||||
/* Allocate EEH device */
|
||||
edev = kzalloc(sizeof(*edev), GFP_KERNEL);
|
||||
if (!edev)
|
||||
return NULL;
|
||||
|
||||
/* Associate EEH device with OF node */
|
||||
pdn->edev = edev;
|
||||
edev->pdn = pdn;
|
||||
edev->bdfn = (pdn->busno << 8) | pdn->devfn;
|
||||
edev->controller = pdn->phb;
|
||||
|
||||
return edev;
|
||||
}
|
|
@ -124,6 +124,26 @@ struct pci_dn *pci_get_pdn(struct pci_dev *pdev)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EEH
|
||||
static struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
|
||||
{
|
||||
struct eeh_dev *edev;
|
||||
|
||||
/* Allocate EEH device */
|
||||
edev = kzalloc(sizeof(*edev), GFP_KERNEL);
|
||||
if (!edev)
|
||||
return NULL;
|
||||
|
||||
/* Associate EEH device with OF node */
|
||||
pdn->edev = edev;
|
||||
edev->pdn = pdn;
|
||||
edev->bdfn = (pdn->busno << 8) | pdn->devfn;
|
||||
edev->controller = pdn->phb;
|
||||
|
||||
return edev;
|
||||
}
|
||||
#endif /* CONFIG_EEH */
|
||||
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
static struct pci_dn *add_one_sriov_vf_pdn(struct pci_dn *parent,
|
||||
int vf_index,
|
||||
|
|
Loading…
Reference in New Issue