Message ID | 152848834128.11888.12263280185471104825.stgit@bhelgaas-glaptop.roam.corp.google.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
On Fri, Jun 08, 2018 at 03:05:41PM -0500, Bjorn Helgaas wrote: > The aer_irq() declaration is the only thing needed by aer_inject.c. Move > it to portdrv.h so we eventually get rid of aerdrv.h completely. No > functional change intended. Nothing against what you're doing here, but it does seem odd that aer_irq is required to be exported just for the error injection to directly call it. I feel like aer-inject should route it through the irq subsystem, like with generic_handle_irq. ?
On Fri, Jun 08, 2018 at 02:17:13PM -0600, Keith Busch wrote: > On Fri, Jun 08, 2018 at 03:05:41PM -0500, Bjorn Helgaas wrote: > > The aer_irq() declaration is the only thing needed by aer_inject.c. Move > > it to portdrv.h so we eventually get rid of aerdrv.h completely. No > > functional change intended. > > Nothing against what you're doing here, but it does seem odd that aer_irq > is required to be exported just for the error injection to directly call > it. I feel like aer-inject should route it through the irq subsystem, > like with generic_handle_irq. ? I totally agree, that's ugly, but I don't have a good idea for how to fix it yet. (And I don't want to do anything more than the simplest possible code moves at this stage, since I think restructuring like this would have to be done at the end of the merge window to avoid major disruption to people working on this code.) Thanks for taking a look over it! Bjorn
diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c index a49090935303..6c5fda96778a 100644 --- a/drivers/pci/pcie/aer/aer_inject.c +++ b/drivers/pci/pcie/aer/aer_inject.c @@ -21,7 +21,8 @@ #include <linux/uaccess.h> #include <linux/stddef.h> #include <linux/device.h> -#include "aerdrv.h" + +#include "../portdrv.h" /* Override the existing corrected and uncorrected error masks */ static bool aer_mask_override; diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h index b0c4aaa79d9c..9867950635df 100644 --- a/drivers/pci/pcie/aer/aerdrv.h +++ b/drivers/pci/pcie/aer/aerdrv.h @@ -76,6 +76,4 @@ struct aer_rpc { */ }; -irqreturn_t aer_irq(int irq, void *context); - #endif /* _AERDRV_H_ */ diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 6a261dc7cd4c..6ffc797a0dc1 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h @@ -121,6 +121,10 @@ static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev) } #endif +#ifdef CONFIG_PCIEAER +irqreturn_t aer_irq(int irq, void *context); +#endif + struct pcie_port_service_driver *pcie_port_find_service(struct pci_dev *dev, u32 service); struct device *pcie_port_find_device(struct pci_dev *dev, u32 service);