[patch 10/22] genirq/msi, treewide: Use a named struct for PCI/MSI attributes

2021-11-26 Thread Thomas Gleixner
The unnamed struct sucks and is in the way of further cleanups. Stick the
PCI related MSI data into a real data structure and cleanup all users.

No functional change.

Signed-off-by: Thomas Gleixner 
Cc: Greg Kroah-Hartman 
Cc: sparcli...@vger.kernel.org
Cc: x...@kernel.org
Cc: xen-de...@lists.xenproject.org
Cc: ath...@lists.infradead.org
---
 arch/powerpc/platforms/cell/axon_msi.c|2 
 arch/powerpc/platforms/powernv/pci-ioda.c |4 -
 arch/powerpc/platforms/pseries/msi.c  |6 -
 arch/sparc/kernel/pci_msi.c   |4 -
 arch/x86/kernel/apic/msi.c|2 
 arch/x86/pci/xen.c|6 -
 drivers/net/wireless/ath/ath11k/pci.c |2 
 drivers/pci/msi.c |  116 +++---
 drivers/pci/xen-pcifront.c|2 
 include/linux/msi.h   |   84 ++---
 kernel/irq/msi.c  |4 -
 11 files changed, 115 insertions(+), 117 deletions(-)

--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -212,7 +212,7 @@ static int setup_msi_msg_address(struct
entry = first_pci_msi_entry(dev);
 
for (; dn; dn = of_get_next_parent(dn)) {
-   if (entry->msi_attrib.is_64) {
+   if (entry->pci.msi_attrib.is_64) {
prop = of_get_property(dn, "msi-address-64", &len);
if (prop)
break;
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2154,10 +2154,10 @@ static void pnv_msi_compose_msg(struct i
int rc;
 
rc = __pnv_pci_ioda_msi_setup(phb, pdev, d->hwirq,
- entry->msi_attrib.is_64, msg);
+ entry->pci.msi_attrib.is_64, msg);
if (rc)
dev_err(&pdev->dev, "Failed to setup %s-bit MSI #%ld : %d\n",
-   entry->msi_attrib.is_64 ? "64" : "32", d->hwirq, rc);
+   entry->pci.msi_attrib.is_64 ? "64" : "32", d->hwirq, 
rc);
 }
 
 /*
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -332,7 +332,7 @@ static int check_msix_entries(struct pci
 
expected = 0;
for_each_pci_msi_entry(entry, pdev) {
-   if (entry->msi_attrib.entry_nr != expected) {
+   if (entry->pci.msi_attrib.entry_nr != expected) {
pr_debug("rtas_msi: bad MSI-X entries.\n");
return -EINVAL;
}
@@ -449,7 +449,7 @@ static int pseries_msi_ops_prepare(struc
 {
struct pci_dev *pdev = to_pci_dev(dev);
struct msi_desc *desc = first_pci_msi_entry(pdev);
-   int type = desc->msi_attrib.is_msix ? PCI_CAP_ID_MSIX : PCI_CAP_ID_MSI;
+   int type = desc->pci.msi_attrib.is_msix ? PCI_CAP_ID_MSIX : 
PCI_CAP_ID_MSI;
 
return rtas_prepare_msi_irqs(pdev, nvec, type, arg);
 }
@@ -580,7 +580,7 @@ static int pseries_irq_domain_alloc(stru
int hwirq;
int i, ret;
 
-   hwirq = rtas_query_irq_number(pci_get_pdn(pdev), 
desc->msi_attrib.entry_nr);
+   hwirq = rtas_query_irq_number(pci_get_pdn(pdev), 
desc->pci.msi_attrib.entry_nr);
if (hwirq < 0) {
dev_err(&pdev->dev, "Failed to query HW IRQ: %d\n", hwirq);
return hwirq;
--- a/arch/sparc/kernel/pci_msi.c
+++ b/arch/sparc/kernel/pci_msi.c
@@ -146,13 +146,13 @@ static int sparc64_setup_msi_irq(unsigne
msiqid = pick_msiq(pbm);
 
err = ops->msi_setup(pbm, msiqid, msi,
-(entry->msi_attrib.is_64 ? 1 : 0));
+(entry->pci.msi_attrib.is_64 ? 1 : 0));
if (err)
goto out_msi_free;
 
pbm->msi_irq_table[msi - pbm->msi_first] = *irq_p;
 
-   if (entry->msi_attrib.is_64) {
+   if (entry->pci.msi_attrib.is_64) {
msg.address_hi = pbm->msi64_start >> 32;
msg.address_lo = pbm->msi64_start & 0x;
} else {
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -163,7 +163,7 @@ int pci_msi_prepare(struct irq_domain *d
struct msi_desc *desc = first_pci_msi_entry(pdev);
 
init_irq_alloc_info(arg, NULL);
-   if (desc->msi_attrib.is_msix) {
+   if (desc->pci.msi_attrib.is_msix) {
arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX;
} else {
arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSI;
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -306,7 +306,7 @@ static int xen_initdom_setup_msi_irqs(st
return -EINVAL;
 
map_irq.table_base = pci_resource_start(dev, bir);
-   map_irq.entry_nr = msidesc->msi_attrib.entry_nr;
+   map_irq.entry_nr = msidesc->pci.msi_attrib.entry_nr;
}
 
ret = -EINVAL;
@@

Re: [patch 10/22] genirq/msi, treewide: Use a named struct for PCI/MSI attributes

2021-11-29 Thread Kalle Valo
Thomas Gleixner  writes:

> The unnamed struct sucks and is in the way of further cleanups. Stick the
> PCI related MSI data into a real data structure and cleanup all users.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner 
> Cc: Greg Kroah-Hartman 
> Cc: sparcli...@vger.kernel.org
> Cc: x...@kernel.org
> Cc: xen-de...@lists.xenproject.org
> Cc: ath...@lists.infradead.org
> ---
>  arch/powerpc/platforms/cell/axon_msi.c|2 
>  arch/powerpc/platforms/powernv/pci-ioda.c |4 -
>  arch/powerpc/platforms/pseries/msi.c  |6 -
>  arch/sparc/kernel/pci_msi.c   |4 -
>  arch/x86/kernel/apic/msi.c|2 
>  arch/x86/pci/xen.c|6 -
>  drivers/net/wireless/ath/ath11k/pci.c |2 

For ath11k:

Acked-by: Kalle Valo 

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches