Commit dba27c7f authored by Thomas Gleixner's avatar Thomas Gleixner

platform-msi: Use msi_desc::msi_index

Use the common msi_index member and get rid of the pointless wrapper struct.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarNishanth Menon <nm@ti.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211210221814.413638645@linutronix.de
parent 20c6d424
...@@ -40,7 +40,7 @@ static irq_hw_number_t platform_msi_calc_hwirq(struct msi_desc *desc) ...@@ -40,7 +40,7 @@ static irq_hw_number_t platform_msi_calc_hwirq(struct msi_desc *desc)
{ {
u32 devid = desc->dev->msi.data->platform_data->devid; u32 devid = desc->dev->msi.data->platform_data->devid;
return (devid << (32 - DEV_ID_SHIFT)) | desc->platform.msi_index; return (devid << (32 - DEV_ID_SHIFT)) | desc->msi_index;
} }
static void platform_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc) static void platform_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
...@@ -112,8 +112,8 @@ static void platform_msi_free_descs(struct device *dev, int base, int nvec) ...@@ -112,8 +112,8 @@ static void platform_msi_free_descs(struct device *dev, int base, int nvec)
struct msi_desc *desc, *tmp; struct msi_desc *desc, *tmp;
list_for_each_entry_safe(desc, tmp, dev_to_msi_list(dev), list) { list_for_each_entry_safe(desc, tmp, dev_to_msi_list(dev), list) {
if (desc->platform.msi_index >= base && if (desc->msi_index >= base &&
desc->platform.msi_index < (base + nvec)) { desc->msi_index < (base + nvec)) {
list_del(&desc->list); list_del(&desc->list);
free_msi_entry(desc); free_msi_entry(desc);
} }
...@@ -129,7 +129,7 @@ static int platform_msi_alloc_descs_with_irq(struct device *dev, int virq, ...@@ -129,7 +129,7 @@ static int platform_msi_alloc_descs_with_irq(struct device *dev, int virq,
if (!list_empty(dev_to_msi_list(dev))) { if (!list_empty(dev_to_msi_list(dev))) {
desc = list_last_entry(dev_to_msi_list(dev), desc = list_last_entry(dev_to_msi_list(dev),
struct msi_desc, list); struct msi_desc, list);
base = desc->platform.msi_index + 1; base = desc->msi_index + 1;
} }
for (i = 0; i < nvec; i++) { for (i = 0; i < nvec; i++) {
...@@ -137,7 +137,7 @@ static int platform_msi_alloc_descs_with_irq(struct device *dev, int virq, ...@@ -137,7 +137,7 @@ static int platform_msi_alloc_descs_with_irq(struct device *dev, int virq,
if (!desc) if (!desc)
break; break;
desc->platform.msi_index = base + i; desc->msi_index = base + i;
desc->irq = virq ? virq + i : 0; desc->irq = virq ? virq + i : 0;
list_add_tail(&desc->list, dev_to_msi_list(dev)); list_add_tail(&desc->list, dev_to_msi_list(dev));
......
...@@ -666,7 +666,7 @@ static void hidma_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg) ...@@ -666,7 +666,7 @@ static void hidma_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
struct device *dev = msi_desc_to_dev(desc); struct device *dev = msi_desc_to_dev(desc);
struct hidma_dev *dmadev = dev_get_drvdata(dev); struct hidma_dev *dmadev = dev_get_drvdata(dev);
if (!desc->platform.msi_index) { if (!desc->msi_index) {
writel(msg->address_lo, dmadev->dev_evca + 0x118); writel(msg->address_lo, dmadev->dev_evca + 0x118);
writel(msg->address_hi, dmadev->dev_evca + 0x11C); writel(msg->address_hi, dmadev->dev_evca + 0x11C);
writel(msg->data, dmadev->dev_evca + 0x120); writel(msg->data, dmadev->dev_evca + 0x120);
...@@ -702,7 +702,7 @@ static int hidma_request_msi(struct hidma_dev *dmadev, ...@@ -702,7 +702,7 @@ static int hidma_request_msi(struct hidma_dev *dmadev,
return rc; return rc;
for_each_msi_entry(desc, &pdev->dev) { for_each_msi_entry(desc, &pdev->dev) {
if (!desc->platform.msi_index) if (!desc->msi_index)
dmadev->msi_virqbase = desc->irq; dmadev->msi_virqbase = desc->irq;
rc = devm_request_irq(&pdev->dev, desc->irq, rc = devm_request_irq(&pdev->dev, desc->irq,
......
...@@ -3142,7 +3142,7 @@ static void arm_smmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg) ...@@ -3142,7 +3142,7 @@ static void arm_smmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
phys_addr_t doorbell; phys_addr_t doorbell;
struct device *dev = msi_desc_to_dev(desc); struct device *dev = msi_desc_to_dev(desc);
struct arm_smmu_device *smmu = dev_get_drvdata(dev); struct arm_smmu_device *smmu = dev_get_drvdata(dev);
phys_addr_t *cfg = arm_smmu_msi_cfg[desc->platform.msi_index]; phys_addr_t *cfg = arm_smmu_msi_cfg[desc->msi_index];
doorbell = (((u64)msg->address_hi) << 32) | msg->address_lo; doorbell = (((u64)msg->address_hi) << 32) | msg->address_lo;
doorbell &= MSI_CFG0_ADDR_MASK; doorbell &= MSI_CFG0_ADDR_MASK;
...@@ -3183,7 +3183,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu) ...@@ -3183,7 +3183,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
} }
for_each_msi_entry(desc, dev) { for_each_msi_entry(desc, dev) {
switch (desc->platform.msi_index) { switch (desc->msi_index) {
case EVTQ_MSI_INDEX: case EVTQ_MSI_INDEX:
smmu->evtq.q.irq = desc->irq; smmu->evtq.q.irq = desc->irq;
break; break;
......
...@@ -1484,7 +1484,7 @@ static void flexrm_mbox_msi_write(struct msi_desc *desc, struct msi_msg *msg) ...@@ -1484,7 +1484,7 @@ static void flexrm_mbox_msi_write(struct msi_desc *desc, struct msi_msg *msg)
{ {
struct device *dev = msi_desc_to_dev(desc); struct device *dev = msi_desc_to_dev(desc);
struct flexrm_mbox *mbox = dev_get_drvdata(dev); struct flexrm_mbox *mbox = dev_get_drvdata(dev);
struct flexrm_ring *ring = &mbox->rings[desc->platform.msi_index]; struct flexrm_ring *ring = &mbox->rings[desc->msi_index];
/* Configure per-Ring MSI registers */ /* Configure per-Ring MSI registers */
writel_relaxed(msg->address_lo, ring->regs + RING_MSI_ADDR_LS); writel_relaxed(msg->address_lo, ring->regs + RING_MSI_ADDR_LS);
...@@ -1609,7 +1609,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev) ...@@ -1609,7 +1609,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
/* Save alloced IRQ numbers for each ring */ /* Save alloced IRQ numbers for each ring */
for_each_msi_entry(desc, dev) { for_each_msi_entry(desc, dev) {
ring = &mbox->rings[desc->platform.msi_index]; ring = &mbox->rings[desc->msi_index];
ring->irq = desc->irq; ring->irq = desc->irq;
} }
......
...@@ -106,14 +106,6 @@ struct pci_msi_desc { ...@@ -106,14 +106,6 @@ struct pci_msi_desc {
}; };
}; };
/**
* platform_msi_desc - Platform device specific msi descriptor data
* @msi_index: The index of the MSI descriptor for multi MSI
*/
struct platform_msi_desc {
u16 msi_index;
};
/** /**
* fsl_mc_msi_desc - FSL-MC device specific msi descriptor data * fsl_mc_msi_desc - FSL-MC device specific msi descriptor data
* @msi_index: The index of the MSI descriptor * @msi_index: The index of the MSI descriptor
...@@ -145,7 +137,6 @@ struct ti_sci_inta_msi_desc { ...@@ -145,7 +137,6 @@ struct ti_sci_inta_msi_desc {
* *
* @msi_index: Index of the msi descriptor * @msi_index: Index of the msi descriptor
* @pci: [PCI] PCI speficic msi descriptor data * @pci: [PCI] PCI speficic msi descriptor data
* @platform: [platform] Platform device specific msi descriptor data
* @fsl_mc: [fsl-mc] FSL MC device specific msi descriptor data * @fsl_mc: [fsl-mc] FSL MC device specific msi descriptor data
* @inta: [INTA] TISCI based INTA specific msi descriptor data * @inta: [INTA] TISCI based INTA specific msi descriptor data
*/ */
...@@ -167,7 +158,6 @@ struct msi_desc { ...@@ -167,7 +158,6 @@ struct msi_desc {
u16 msi_index; u16 msi_index;
union { union {
struct pci_msi_desc pci; struct pci_msi_desc pci;
struct platform_msi_desc platform;
struct fsl_mc_msi_desc fsl_mc; struct fsl_mc_msi_desc fsl_mc;
struct ti_sci_inta_msi_desc inta; struct ti_sci_inta_msi_desc inta;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment