Cleanup IRQ type definitions
Subsystems (22)
v2 cover Cleanup IRQ type definitions
The first patch renames PCI_IRQ_LEGACY to PCI_IRQ_INTX as suggested by Bjorn (hence the patch authorship is given to him).
The second patch removes the redundant IRQ type definitions PCI_EPC_IRQ_XXX and replace these with a direct use of the PCI_IRQ_XXX definitions. Going forward, more cleanups renaming "legacy" to "intx" in various drivers can be added on top of this series.
Changes from v1:
- Updated first patch Signed-of tag and commit message as suggested by Bjorn.
- Added review tags.
Bjorn Helgaas (1):
PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
Damien Le Moal (1):
PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 ++++----- drivers/pci/controller/dwc/pci-dra7xx.c | 6 +++--- drivers/pci/controller/dwc/pci-imx6.c | 9 ++++----- drivers/pci/controller/dwc/pci-keystone.c | 9 ++++----- drivers/pci/controller/dwc/pci-layerscape-ep.c | 8 ++++---- drivers/pci/controller/dwc/pcie-artpec6.c | 8 ++++---- drivers/pci/controller/dwc/pcie-designware-ep.c | 2 +- drivers/pci/controller/dwc/pcie-designware-plat.c | 9 ++++----- drivers/pci/controller/dwc/pcie-designware.h | 2 +- drivers/pci/controller/dwc/pcie-keembay.c | 13 ++++++------- drivers/pci/controller/dwc/pcie-qcom-ep.c | 6 +++--- drivers/pci/controller/dwc/pcie-tegra194.c | 9 ++++----- drivers/pci/controller/dwc/pcie-uniphier-ep.c | 7 +++---- drivers/pci/controller/pcie-rcar-ep.c | 7 +++---- drivers/pci/controller/pcie-rockchip-ep.c | 7 +++---- drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +- drivers/pci/endpoint/functions/pci-epf-ntb.c | 4 ++-- drivers/pci/endpoint/functions/pci-epf-test.c | 6 +++--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 7 ++----- drivers/pci/endpoint/pci-epc-core.c | 2 +- include/linux/pci-epc.h | 11 ++--------- include/linux/pci.h | 4 +++- 22 files changed, 65 insertions(+), 82 deletions(-)
Signature · 1 line
2.41.0
PATCH v2 1/2 PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
From: Bjorn Helgaas <[email protected]>
Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX to be more explicit about the type of IRQ being referenced as well as to match the PCI specifications terms. Redefine PCI_IRQ_LEGACY as an alias to PCI_IRQ_INTX to avoid the need for doing the renaming tree-wide. New drivers and new code should now prefer using PCI_IRQ_INTX instead of PCI_IRQ_LEGACY.
--- include/linux/pci.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/pci.h +3 -1
@@ -1048,11 +1048,13 @@ enum { PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */ }; -#define PCI_IRQ_LEGACY (1 << 0)/* Allow legacy interrupts */ +#define PCI_IRQ_INTX (1 << 0)/* Allow INTx interrupts */ #define PCI_IRQ_MSI (1 << 1)/* Allow MSI interrupts */ #define PCI_IRQ_MSIX (1 << 2)/* Allow MSI-X interrupts */ #define PCI_IRQ_AFFINITY (1 << 3)/* Auto-assign affinity */ +#define PCI_IRQ_LEGACY PCI_IRQ_INTX/* prefer PCI_IRQ_INTX */ +/* These external functions are only available when PCI support is enabled */ #ifdef CONFIG_PCI
Signature · 1 line
2.41.0
PATCH v2 2/2 PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
In reply to Damien Le Moallinux/pci.h defines the IRQ flags PCI_IRQ_INTX, PCI_IRQ_MSI and PCI_IRQ_MSIX. Let's use these flags directly instead of the endpoint definitions provided by enum pci_epc_irq_type. This removes the need for defining this enum type completely.
--- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 ++++----- drivers/pci/controller/dwc/pci-dra7xx.c | 6 +++--- drivers/pci/controller/dwc/pci-imx6.c | 9 ++++----- drivers/pci/controller/dwc/pci-keystone.c | 9 ++++----- drivers/pci/controller/dwc/pci-layerscape-ep.c | 8 ++++---- drivers/pci/controller/dwc/pcie-artpec6.c | 8 ++++---- drivers/pci/controller/dwc/pcie-designware-ep.c | 2 +- drivers/pci/controller/dwc/pcie-designware-plat.c | 9 ++++----- drivers/pci/controller/dwc/pcie-designware.h | 2 +- drivers/pci/controller/dwc/pcie-keembay.c | 13 ++++++------- drivers/pci/controller/dwc/pcie-qcom-ep.c | 6 +++--- drivers/pci/controller/dwc/pcie-tegra194.c | 9 ++++----- drivers/pci/controller/dwc/pcie-uniphier-ep.c | 7 +++---- drivers/pci/controller/pcie-rcar-ep.c | 7 +++---- drivers/pci/controller/pcie-rockchip-ep.c | 7 +++---- drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +- drivers/pci/endpoint/functions/pci-epf-ntb.c | 4 ++-- drivers/pci/endpoint/functions/pci-epf-test.c | 6 +++--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 7 ++----- drivers/pci/endpoint/pci-epc-core.c | 2 +- include/linux/pci-epc.h | 11 ++--------- 21 files changed, 62 insertions(+), 81 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-ep.c +4 -5
@@ -531,25 +531,24 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn, }static int cdns_pcie_ep_raise_irq (struct pci_epc *epc,u8 fn,u8 vfn, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct cdns_pcie_ep *ep =epc_get_drvdata (epc);struct cdns_pcie *pcie = &ep->pcie;struct device *dev = pcie->dev;switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :if (vfn >0 ) {dev_err (dev,"Cannot raise legacy interrupts for VF\n" );return -EINVAL ; }return cdns_pcie_ep_send_legacy_irq (ep, fn, vfn,0 ); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return cdns_pcie_ep_send_msi_irq (ep, fn, vfn, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return cdns_pcie_ep_send_msix_irq (ep, fn, vfn, interrupt_num);default :
drivers/pci/controller/dwc/pci-dra7xx.c +3 -3
@@ -404,16 +404,16 @@ static void dra7xx_pcie_raise_msi_irq(struct dra7xx_pcie *dra7xx, }static int dra7xx_pcie_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);struct dra7xx_pcie *dra7xx =to_dra7xx_pcie (pci);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :dra7xx_pcie_raise_legacy_irq (dra7xx);break ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :dra7xx_pcie_raise_msi_irq (dra7xx, interrupt_num);break ;default :
drivers/pci/controller/dwc/pci-imx6.c +4 -5
@@ -1057,17 +1057,16 @@ static void imx6_pcie_ep_init(struct dw_pcie_ep *ep) }static int imx6_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"UNKNOWN IRQ type\n" );
drivers/pci/controller/dwc/pci-keystone.c +4 -5
@@ -900,20 +900,19 @@ static void ks_pcie_am654_raise_legacy_irq(struct keystone_pcie *ks_pcie) }static int ks_pcie_am654_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);struct keystone_pcie *ks_pcie =to_keystone_pcie (pci);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :ks_pcie_am654_raise_legacy_irq (ks_pcie);break ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);break ; -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);break ;default :
drivers/pci/controller/dwc/pci-layerscape-ep.c +4 -4
@@ -150,16 +150,16 @@ static void ls_pcie_ep_init(struct dw_pcie_ep *ep) }static int ls_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq_doorbell (ep, func_no, interrupt_num);default :
drivers/pci/controller/dwc/pcie-artpec6.c +4 -4
@@ -352,15 +352,15 @@ static void artpec6_pcie_ep_init(struct dw_pcie_ep *ep) }static int artpec6_pcie_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : -dev_err (pci->dev,"EP cannot trigger legacy IRQs\n" ); +case PCI_IRQ_INTX : +dev_err (pci->dev,"EP cannot trigger INTx IRQs\n" );return -EINVAL ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"UNKNOWN IRQ type\n" );
drivers/pci/controller/dwc/pcie-designware-ep.c +1 -1
@@ -426,7 +426,7 @@ static int dw_pcie_ep_set_msix(struct pci_epc *epc, u8 func_no, u8 vfunc_no, }static int dw_pcie_ep_raise_irq (struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie_ep *ep =epc_get_drvdata (epc);
drivers/pci/controller/dwc/pcie-designware-plat.c +4 -5
@@ -42,17 +42,16 @@ static void dw_plat_pcie_ep_init(struct dw_pcie_ep *ep) }static int dw_plat_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"UNKNOWN IRQ type\n" );
drivers/pci/controller/dwc/pcie-designware.h +1 -1
@@ -320,7 +320,7 @@ struct dw_pcie_rp {struct dw_pcie_ep_ops {void (*ep_init)(struct dw_pcie_ep *ep);int (*raise_irq)(struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num); +unsigned int type,u16 interrupt_num);const struct pci_epc_features * (*get_features)(struct dw_pcie_ep *ep);/* * Provide a method to implement the different func config space
drivers/pci/controller/dwc/pcie-keembay.c +6 -7
@@ -289,19 +289,18 @@ static void keembay_pcie_ep_init(struct dw_pcie_ep *ep) }static int keembay_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : -/* Legacy interrupts are not supported in Keem Bay */ -dev_err (pci->dev,"Legacy IRQ is not supported\n" ); +case PCI_IRQ_INTX : +/* INTx interrupts are not supported in Keem Bay */ +dev_err (pci->dev,"INTx IRQ is not supported\n" );return -EINVAL ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"Unknown IRQ type %d\n" , type);
drivers/pci/controller/dwc/pcie-qcom-ep.c +3 -3
@@ -655,14 +655,14 @@ static int qcom_pcie_ep_enable_irq_resources(struct platform_device *pdev, }static int qcom_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"Unknown IRQ type\n" );
drivers/pci/controller/dwc/pcie-tegra194.c +4 -5
@@ -1992,20 +1992,19 @@ static int tegra_pcie_ep_raise_msix_irq(struct tegra_pcie_dw *pcie, u16 irq) }static int tegra_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);struct tegra_pcie_dw *pcie =to_tegra_pcie (pci);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return tegra_pcie_ep_raise_legacy_irq (pcie, interrupt_num); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return tegra_pcie_ep_raise_msi_irq (pcie, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return tegra_pcie_ep_raise_msix_irq (pcie, interrupt_num);default :
drivers/pci/controller/dwc/pcie-uniphier-ep.c +3 -4
@@ -256,15 +256,14 @@ static int uniphier_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, }static int uniphier_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return uniphier_pcie_ep_raise_legacy_irq (ep); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return uniphier_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);default :
drivers/pci/controller/pcie-rcar-ep.c +3 -4
@@ -402,16 +402,15 @@ static int rcar_pcie_ep_assert_msi(struct rcar_pcie *pcie, }static int rcar_pcie_ep_raise_irq (struct pci_epc *epc,u8 fn,u8 vfn, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct rcar_pcie_endpoint *ep =epc_get_drvdata (epc);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return rcar_pcie_ep_assert_intx (ep, fn,0 ); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return rcar_pcie_ep_assert_msi (&ep->pcie, fn, interrupt_num);default :
drivers/pci/controller/pcie-rockchip-ep.c +3 -4
@@ -407,15 +407,14 @@ static int rockchip_pcie_ep_send_msi_irq(struct rockchip_pcie_ep *ep, u8 fn, }static int rockchip_pcie_ep_raise_irq (struct pci_epc *epc,u8 fn,u8 vfn, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct rockchip_pcie_ep *ep =epc_get_drvdata (epc);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_LEGACY :return rockchip_pcie_ep_send_legacy_irq (ep, fn,0 ); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return rockchip_pcie_ep_send_msi_irq (ep, fn, interrupt_num);default :return -EINVAL ;
drivers/pci/endpoint/functions/pci-epf-mhi.c +1 -1
@@ -177,7 +177,7 @@ static void pci_epf_mhi_raise_irq(struct mhi_ep_cntrl *mhi_cntrl, u32 vector)* MHI supplies 0 based MSI vectors but the API expects the vector * number to start from 1, so we need to increment the vector by 1. */ -pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no,PCI_EPC_IRQ_MSI , +pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no,PCI_IRQ_MSI , vector +1 ); }
drivers/pci/endpoint/functions/pci-epf-ntb.c +2 -2
@@ -140,9 +140,9 @@ static struct pci_epf_header epf_ntb_header = {static int epf_ntb_link_up (struct epf_ntb *ntb,bool link_up) {enum pci_epc_interface_type type; -enum pci_epc_irq_type irq_type;struct epf_ntb_epc *ntb_epc;struct epf_ntb_ctrl *ctrl; +unsigned int irq_type;struct pci_epc *epc;u8 func_no, vfunc_no;bool is_msix;
@@ -159,7 +159,7 @@ static int epf_ntb_link_up(struct epf_ntb *ntb, bool link_up) ctrl->link_status |=LINK_STATUS_UP ; else ctrl->link_status &= ~LINK_STATUS_UP; - irq_type = is_msix ?PCI_EPC_IRQ_MSIX :PCI_EPC_IRQ_MSI ; + irq_type = is_msix ?PCI_IRQ_MSIX :PCI_IRQ_MSI ; ret =pci_epc_raise_irq (epc, func_no, vfunc_no, irq_type,1 );if (ret) { dev_err(&epc->dev,
drivers/pci/endpoint/functions/pci-epf-test.c +3 -3
@@ -602,7 +602,7 @@ static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test,switch (reg->irq_type) {case IRQ_TYPE_LEGACY :pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no, -PCI_EPC_IRQ_LEGACY ,0 ); +PCI_IRQ_INTX ,0 );break ;case IRQ_TYPE_MSI : count =pci_epc_get_msi (epc, epf->func_no, epf->vfunc_no);
@@ -612,7 +612,7 @@ static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test,return ; }pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no, -PCI_EPC_IRQ_MSI , reg->irq_number); +PCI_IRQ_MSI , reg->irq_number);break ;case IRQ_TYPE_MSIX : count =pci_epc_get_msix (epc, epf->func_no, epf->vfunc_no);
@@ -622,7 +622,7 @@ static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test,return ; }pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no, -PCI_EPC_IRQ_MSIX , reg->irq_number); +PCI_IRQ_MSIX , reg->irq_number);break ;default :dev_err (dev,"Failed to raise IRQ, unknown type\n" );
drivers/pci/endpoint/functions/pci-epf-vntb.c +2 -5
@@ -1172,11 +1172,8 @@ static int vntb_epf_peer_db_set(struct ntb_dev *ndev, u64 db_bits) func_no = ntb->epf->func_no; vfunc_no = ntb->epf->vfunc_no; - ret =pci_epc_raise_irq (ntb->epf->epc, - func_no, - vfunc_no, -PCI_EPC_IRQ_MSI , - interrupt_num +1 ); + ret =pci_epc_raise_irq (ntb->epf->epc, func_no, vfunc_no, +PCI_IRQ_MSI , interrupt_num +1 );if (ret)dev_err (&ntb->ntb.dev,"Failed to raise IRQ\n" );
drivers/pci/endpoint/pci-epc-core.c +1 -1
@@ -217,7 +217,7 @@ EXPORT_SYMBOL_GPL(pci_epc_start);* Invoke to raise an legacy, MSI or MSI-X interrupt */ int pci_epc_raise_irq (struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {int ret;
include/linux/pci-epc.h +2 -9
@@ -19,13 +19,6 @@ enum pci_epc_interface_type { SECONDARY_INTERFACE, }; -enum pci_epc_irq_type { -PCI_EPC_IRQ_UNKNOWN , -PCI_EPC_IRQ_LEGACY , -PCI_EPC_IRQ_MSI , -PCI_EPC_IRQ_MSIX , -}; -static inline const char *pci_epc_interface_string (enum pci_epc_interface_type type) {
@@ -79,7 +72,7 @@ struct pci_epc_ops { u16 interrupts, enum pci_barno, u32 offset);int (*get_msix)(struct pci_epc *epc,u8 func_no,u8 vfunc_no);int (*raise_irq)(struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num); +unsigned int type,u16 interrupt_num); int (*map_msi_irq)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t phys_addr, u8 interrupt_num, u32 entry_size, u32 *msi_data,
@@ -229,7 +222,7 @@ int pci_epc_map_msi_irq(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t phys_addr, u8 interrupt_num, u32 entry_size, u32 *msi_data, u32 *msi_addr_offset);int pci_epc_raise_irq (struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num); +unsigned int type,u16 interrupt_num);int pci_epc_start (struct pci_epc *epc);void pci_epc_stop (struct pci_epc *epc); const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc,
Signature · 1 line
2.41.0
Re: [PATCH v2 1/2] PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
In reply to Damien Le MoalQuoted 22 lines · Damien Le Moal
From: Bjorn Helgaas <[email protected]>
Rename
PCI_IRQ_LEGACYtoPCI_IRQ_INTXto be more explicit about the type of IRQ being referenced as well as to match the PCI specifications terms. RedefinePCI_IRQ_LEGACYas an alias toPCI_IRQ_INTXto avoid the need for doing the renaming tree-wide. New drivers and new code should now prefer usingPCI_IRQ_INTXinstead ofPCI_IRQ_LEGACY.Signed-off-by Bjorn Helgaas <[email protected]>Signed-off-by Damien Le Moal <[email protected]>Reviewed-by Yoshihiro Shimoda <[email protected]>--- include/linux/pci.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/linux/pci.h +0
-0@@ -1048,11 +1048,13 @@ enum { PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */ };
include/linux/pci.h enum { · line 1058
Quoted 10 lines
include/linux/pci.h +3
-1-#define PCI_IRQ_LEGACY (1 << 0)/* Allow legacy interrupts */ +#define PCI_IRQ_INTX (1 << 0)/* Allow INTx interrupts */ #define PCI_IRQ_MSI (1 << 1)/* Allow MSI interrupts */ #define PCI_IRQ_MSIX (1 << 2)/* Allow MSI-X interrupts */ #define PCI_IRQ_AFFINITY (1 << 3)/* Auto-assign affinity */ +#define PCI_IRQ_LEGACY PCI_IRQ_INTX/* prefer PCI_IRQ_INTX */ +
I would have been more strict about using this macro and explicitly stated that the macro is deprecated:
+#define PCI_IRQ_LEGACY PCI_IRQ_INTX /* Deprecated! Use PCI_IRQ_INTX */
+
In anyway:
-Serge(y)
Quoted 6 lines
include/linux/pci.h +0
-0/* These external functions are only available when PCI support is enabled */ #ifdef CONFIG_PCI Signature · 2 lines
-- 2.41.0
Re: [PATCH v2 1/2] PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
Quoted 37 lines · Serge Semin
Quoted 22 lines · Damien Le Moal
From: Bjorn Helgaas <[email protected]>
Rename
PCI_IRQ_LEGACYtoPCI_IRQ_INTXto be more explicit about the type of IRQ being referenced as well as to match the PCI specifications terms. RedefinePCI_IRQ_LEGACYas an alias toPCI_IRQ_INTXto avoid the need for doing the renaming tree-wide. New drivers and new code should now prefer usingPCI_IRQ_INTXinstead ofPCI_IRQ_LEGACY.Signed-off-by Bjorn Helgaas <[email protected]>Signed-off-by Damien Le Moal <[email protected]>Reviewed-by Yoshihiro Shimoda <[email protected]>--- include/linux/pci.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/linux/pci.h +0
-0@@ -1048,11 +1048,13 @@ enum { PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */ };include/linux/pci.h enum { · line 1058
Quoted 10 lines
include/linux/pci.h +3
-1-#define PCI_IRQ_LEGACY (1 << 0)/* Allow legacy interrupts */ +#define PCI_IRQ_INTX (1 << 0)/* Allow INTx interrupts */ #define PCI_IRQ_MSI (1 << 1)/* Allow MSI interrupts */ #define PCI_IRQ_MSIX (1 << 2)/* Allow MSI-X interrupts */ #define PCI_IRQ_AFFINITY (1 << 3)/* Auto-assign affinity */ +#define PCI_IRQ_LEGACY PCI_IRQ_INTX/* prefer PCI_IRQ_INTX */ +I would have been more strict about using this macro and explicitly stated that the macro is deprecated:
Review
Quoted 2 lines
(quoted diff) +2
-0+#define PCI_IRQ_LEGACY PCI_IRQ_INTX /* Deprecated! Use PCI_IRQ_INTX */ +
Works for me.
Bjorn, Krzysztof,
Do you want me to resend a v3 or can fix that up when applying ?
Quoted 12 lines
In anyway:
Reviewed-by Serge Semin <[email protected]>-Serge(y)
Quoted 6 lines
include/linux/pci.h +0
-0/* These external functions are only available when PCI support is enabled */ #ifdef CONFIG_PCI Signature · 2 lines
-- 2.41.0
Signature · 2 lines
Damien Le Moal Western Digital Research
Re: [PATCH v2 2/2] PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
In reply to Damien Le MoalQuoted 381 lines · Damien Le Moal
linux/pci.hdefines the IRQ flagsPCI_IRQ_INTX,PCI_IRQ_MSIandPCI_IRQ_MSIX. Let's use these flags directly instead of the endpoint definitions provided by enumpci_epc_irq_type. This removes the need for defining this enum type completely.Signed-off-by Damien Le Moal <[email protected]>Reviewed-by Yoshihiro Shimoda <[email protected]>--- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 ++++----- drivers/pci/controller/dwc/pci-dra7xx.c | 6 +++--- drivers/pci/controller/dwc/pci-imx6.c | 9 ++++----- drivers/pci/controller/dwc/pci-keystone.c | 9 ++++----- drivers/pci/controller/dwc/pci-layerscape-ep.c | 8 ++++---- drivers/pci/controller/dwc/pcie-artpec6.c | 8 ++++---- drivers/pci/controller/dwc/pcie-designware-ep.c | 2 +- drivers/pci/controller/dwc/pcie-designware-plat.c | 9 ++++----- drivers/pci/controller/dwc/pcie-designware.h | 2 +- drivers/pci/controller/dwc/pcie-keembay.c | 13 ++++++------- drivers/pci/controller/dwc/pcie-qcom-ep.c | 6 +++--- drivers/pci/controller/dwc/pcie-tegra194.c | 9 ++++----- drivers/pci/controller/dwc/pcie-uniphier-ep.c | 7 +++---- drivers/pci/controller/pcie-rcar-ep.c | 7 +++---- drivers/pci/controller/pcie-rockchip-ep.c | 7 +++---- drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +- drivers/pci/endpoint/functions/pci-epf-ntb.c | 4 ++-- drivers/pci/endpoint/functions/pci-epf-test.c | 6 +++--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 7 ++----- drivers/pci/endpoint/pci-epc-core.c | 2 +- include/linux/pci-epc.h | 11 ++--------- 21 files changed, 62 insertions(+), 81 deletions(-)drivers/pci/controller/cadence/pcie-cadence-ep.c +4
-5@@ -531,25 +531,24 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn, }static int cdns_pcie_ep_raise_irq (struct pci_epc *epc,u8 fn,u8 vfn, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct cdns_pcie_ep *ep =epc_get_drvdata (epc);struct cdns_pcie *pcie = &ep->pcie;struct device *dev = pcie->dev;switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :if (vfn >0 ) {dev_err (dev,"Cannot raise legacy interrupts for VF\n" );return -EINVAL ; }return cdns_pcie_ep_send_legacy_irq (ep, fn, vfn,0 ); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return cdns_pcie_ep_send_msi_irq (ep, fn, vfn, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return cdns_pcie_ep_send_msix_irq (ep, fn, vfn, interrupt_num);default :drivers/pci/controller/dwc/pci-dra7xx.c +3
-3@@ -404,16 +404,16 @@ static void dra7xx_pcie_raise_msi_irq(struct dra7xx_pcie *dra7xx, }static int dra7xx_pcie_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);struct dra7xx_pcie *dra7xx =to_dra7xx_pcie (pci);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :dra7xx_pcie_raise_legacy_irq (dra7xx);break ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :dra7xx_pcie_raise_msi_irq (dra7xx, interrupt_num);break ;default :drivers/pci/controller/dwc/pci-imx6.c +4
-5@@ -1057,17 +1057,16 @@ static void imx6_pcie_ep_init(struct dw_pcie_ep *ep) }static int imx6_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"UNKNOWN IRQ type\n" );drivers/pci/controller/dwc/pci-keystone.c +4
-5@@ -900,20 +900,19 @@ static void ks_pcie_am654_raise_legacy_irq(struct keystone_pcie *ks_pcie) }static int ks_pcie_am654_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);struct keystone_pcie *ks_pcie =to_keystone_pcie (pci);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :ks_pcie_am654_raise_legacy_irq (ks_pcie);break ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);break ; -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);break ;default :drivers/pci/controller/dwc/pci-layerscape-ep.c +4
-4@@ -150,16 +150,16 @@ static void ls_pcie_ep_init(struct dw_pcie_ep *ep) }static int ls_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq_doorbell (ep, func_no, interrupt_num);default :drivers/pci/controller/dwc/pcie-artpec6.c +4
-4@@ -352,15 +352,15 @@ static void artpec6_pcie_ep_init(struct dw_pcie_ep *ep) }static int artpec6_pcie_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : -dev_err (pci->dev,"EP cannot trigger legacy IRQs\n" ); +case PCI_IRQ_INTX : +dev_err (pci->dev,"EP cannot trigger INTx IRQs\n" );return -EINVAL ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"UNKNOWN IRQ type\n" );drivers/pci/controller/dwc/pcie-designware-ep.c +1
-1@@ -426,7 +426,7 @@ static int dw_pcie_ep_set_msix(struct pci_epc *epc, u8 func_no, u8 vfunc_no, }static int dw_pcie_ep_raise_irq (struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie_ep *ep =epc_get_drvdata (epc);drivers/pci/controller/dwc/pcie-designware-plat.c +4
-5@@ -42,17 +42,16 @@ static void dw_plat_pcie_ep_init(struct dw_pcie_ep *ep) }static int dw_plat_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"UNKNOWN IRQ type\n" );drivers/pci/controller/dwc/pcie-designware.h +1
-1@@ -320,7 +320,7 @@ struct dw_pcie_rp {struct dw_pcie_ep_ops {void (*ep_init)(struct dw_pcie_ep *ep);int (*raise_irq)(struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num); +unsigned int type,u16 interrupt_num);const struct pci_epc_features * (*get_features)(struct dw_pcie_ep *ep);/* * Provide a method to implement the different func config space drivers/pci/controller/dwc/pcie-keembay.c +6
-7@@ -289,19 +289,18 @@ static void keembay_pcie_ep_init(struct dw_pcie_ep *ep) }static int keembay_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : -/* Legacy interrupts are not supported in Keem Bay */ -dev_err (pci->dev,"Legacy IRQ is not supported\n" ); +case PCI_IRQ_INTX : +/* INTx interrupts are not supported in Keem Bay */ +dev_err (pci->dev,"INTx IRQ is not supported\n" );return -EINVAL ; -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return dw_pcie_ep_raise_msix_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"Unknown IRQ type %d\n" , type);drivers/pci/controller/dwc/pcie-qcom-ep.c +3
-3@@ -655,14 +655,14 @@ static int qcom_pcie_ep_enable_irq_resources(struct platform_device *pdev, }static int qcom_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return dw_pcie_ep_raise_legacy_irq (ep, func_no); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return dw_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);default :dev_err (pci->dev,"Unknown IRQ type\n" );drivers/pci/controller/dwc/pcie-tegra194.c +4
-5@@ -1992,20 +1992,19 @@ static int tegra_pcie_ep_raise_msix_irq(struct tegra_pcie_dw *pcie, u16 irq) }static int tegra_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);struct tegra_pcie_dw *pcie =to_tegra_pcie (pci);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return tegra_pcie_ep_raise_legacy_irq (pcie, interrupt_num); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return tegra_pcie_ep_raise_msi_irq (pcie, interrupt_num); -case PCI_EPC_IRQ_MSIX : +case PCI_IRQ_MSIX :return tegra_pcie_ep_raise_msix_irq (pcie, interrupt_num);default :drivers/pci/controller/dwc/pcie-uniphier-ep.c +3
-4@@ -256,15 +256,14 @@ static int uniphier_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, }static int uniphier_pcie_ep_raise_irq (struct dw_pcie_ep *ep,u8 func_no, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct dw_pcie *pci =to_dw_pcie_from_ep (ep);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return uniphier_pcie_ep_raise_legacy_irq (ep); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return uniphier_pcie_ep_raise_msi_irq (ep, func_no, interrupt_num);default :drivers/pci/controller/pcie-rcar-ep.c +3
-4@@ -402,16 +402,15 @@ static int rcar_pcie_ep_assert_msi(struct rcar_pcie *pcie, }static int rcar_pcie_ep_raise_irq (struct pci_epc *epc,u8 fn,u8 vfn, -enum pci_epc_irq_type type, -u16 interrupt_num) +unsigned int type,u16 interrupt_num) {struct rcar_pcie_endpoint *ep =epc_get_drvdata (epc);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_INTX :return rcar_pcie_ep_assert_intx (ep, fn,0 ); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return rcar_pcie_ep_assert_msi (&ep->pcie, fn, interrupt_num);default :drivers/pci/controller/pcie-rockchip-ep.c +0
-0@@ -407,15 +407,14 @@ static int rockchip_pcie_ep_send_msi_irq(struct rockchip_pcie_ep *ep, u8 fn, } static int rockchip_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, u8 vfn,
drivers/pci/controller/pcie-rockchip-ep.c static int rockchip_pcie_ep_send_msi_irq(struct rockchip_pcie_ep *ep, u8 fn, · line 416
Quoted 10 lines
drivers/pci/controller/pcie-rockchip-ep.c +2
-3- enum pci_epc_irq_type type, - u16 interrupt_num) + unsigned int type, u16 interrupt_num) {struct rockchip_pcie_ep *ep =epc_get_drvdata (epc);switch (type) { -case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_LEGACY :
This shifty kiddy slipped in past your catchy eyes.
-Serge(y)
Quoted 144 lines
drivers/pci/controller/pcie-rockchip-ep.c +1
-1return rockchip_pcie_ep_send_legacy_irq (ep, fn,0 ); -case PCI_EPC_IRQ_MSI : +case PCI_IRQ_MSI :return rockchip_pcie_ep_send_msi_irq (ep, fn, interrupt_num);default :drivers/pci/controller/pcie-rockchip-ep.c +0
-0return -EINVAL ;drivers/pci/endpoint/functions/pci-epf-mhi.c +1
-1@@ -177,7 +177,7 @@ static void pci_epf_mhi_raise_irq(struct mhi_ep_cntrl *mhi_cntrl, u32 vector)* MHI supplies 0 based MSI vectors but the API expects the vector * number to start from 1, so we need to increment the vector by 1. */ -pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no,PCI_EPC_IRQ_MSI , +pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no,PCI_IRQ_MSI , vector +1 ); }drivers/pci/endpoint/functions/pci-epf-ntb.c +2
-2@@ -140,9 +140,9 @@ static struct pci_epf_header epf_ntb_header = {static int epf_ntb_link_up (struct epf_ntb *ntb,bool link_up) {enum pci_epc_interface_type type; -enum pci_epc_irq_type irq_type;struct epf_ntb_epc *ntb_epc;struct epf_ntb_ctrl *ctrl; +unsigned int irq_type;struct pci_epc *epc;u8 func_no, vfunc_no;bool is_msix;@@ -159,7 +159,7 @@ static int epf_ntb_link_up(struct epf_ntb *ntb, bool link_up) ctrl->link_status |=LINK_STATUS_UP ; else ctrl->link_status &= ~LINK_STATUS_UP; - irq_type = is_msix ?PCI_EPC_IRQ_MSIX :PCI_EPC_IRQ_MSI ; + irq_type = is_msix ?PCI_IRQ_MSIX :PCI_IRQ_MSI ; ret =pci_epc_raise_irq (epc, func_no, vfunc_no, irq_type,1 );if (ret) { dev_err(&epc->dev,drivers/pci/endpoint/functions/pci-epf-test.c +3
-3@@ -602,7 +602,7 @@ static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test,switch (reg->irq_type) {case IRQ_TYPE_LEGACY :pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no, -PCI_EPC_IRQ_LEGACY ,0 ); +PCI_IRQ_INTX ,0 );break ;case IRQ_TYPE_MSI : count =pci_epc_get_msi (epc, epf->func_no, epf->vfunc_no);@@ -612,7 +612,7 @@ static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test,return ; }pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no, -PCI_EPC_IRQ_MSI , reg->irq_number); +PCI_IRQ_MSI , reg->irq_number);break ;case IRQ_TYPE_MSIX : count =pci_epc_get_msix (epc, epf->func_no, epf->vfunc_no);@@ -622,7 +622,7 @@ static void pci_epf_test_raise_irq(struct pci_epf_test *epf_test,return ; }pci_epc_raise_irq (epc, epf->func_no, epf->vfunc_no, -PCI_EPC_IRQ_MSIX , reg->irq_number); +PCI_IRQ_MSIX , reg->irq_number);break ;default :dev_err (dev,"Failed to raise IRQ, unknown type\n" );drivers/pci/endpoint/functions/pci-epf-vntb.c +2
-5@@ -1172,11 +1172,8 @@ static int vntb_epf_peer_db_set(struct ntb_dev *ndev, u64 db_bits) func_no = ntb->epf->func_no; vfunc_no = ntb->epf->vfunc_no; - ret =pci_epc_raise_irq (ntb->epf->epc, - func_no, - vfunc_no, -PCI_EPC_IRQ_MSI , - interrupt_num +1 ); + ret =pci_epc_raise_irq (ntb->epf->epc, func_no, vfunc_no, +PCI_IRQ_MSI , interrupt_num +1 );if (ret)dev_err (&ntb->ntb.dev,"Failed to raise IRQ\n" );drivers/pci/endpoint/pci-epc-core.c +1
-1@@ -217,7 +217,7 @@ EXPORT_SYMBOL_GPL(pci_epc_start);* Invoke to raise an legacy, MSI or MSI-X interrupt */ int pci_epc_raise_irq (struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num) +unsigned int type,u16 interrupt_num) {int ret;include/linux/pci-epc.h +2
-9@@ -19,13 +19,6 @@ enum pci_epc_interface_type { SECONDARY_INTERFACE, }; -enum pci_epc_irq_type { -PCI_EPC_IRQ_UNKNOWN , -PCI_EPC_IRQ_LEGACY , -PCI_EPC_IRQ_MSI , -PCI_EPC_IRQ_MSIX , -}; -static inline const char *pci_epc_interface_string (enum pci_epc_interface_type type) {@@ -79,7 +72,7 @@ struct pci_epc_ops { u16 interrupts, enum pci_barno, u32 offset);int (*get_msix)(struct pci_epc *epc,u8 func_no,u8 vfunc_no);int (*raise_irq)(struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num); +unsigned int type,u16 interrupt_num); int (*map_msi_irq)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t phys_addr, u8 interrupt_num, u32 entry_size, u32 *msi_data,@@ -229,7 +222,7 @@ int pci_epc_map_msi_irq(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t phys_addr, u8 interrupt_num, u32 entry_size, u32 *msi_data, u32 *msi_addr_offset);int pci_epc_raise_irq (struct pci_epc *epc,u8 func_no,u8 vfunc_no, -enum pci_epc_irq_type type,u16 interrupt_num); +unsigned int type,u16 interrupt_num);int pci_epc_start (struct pci_epc *epc);void pci_epc_stop (struct pci_epc *epc); const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc,Signature · 1 line
2.41.0
Re: [PATCH v2 2/2] PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
Quoted 5 lines · Serge Semin
drivers/pci/controller/pcie-rockchip-ep.c static int rockchip_pcie_ep_send_msi_irq(struct rockchip_pcie_ep *ep, u8 fn, · line 415
Quoted 2 lines
drivers/pci/controller/pcie-rockchip-ep.c +1
-1-case PCI_EPC_IRQ_LEGACY : +case PCI_IRQ_LEGACY :This shifty kiddy slipped in past your catchy eyes.
Arg ! And I did check the patch several times :)
Thanks for catching. Sending v3.
Signature · 2 lines
Damien Le Moal Western Digital Research