Commit cd119b09 authored by Thomas Gleixner's avatar Thomas Gleixner

PCI/MSI: Move msi_lock to struct pci_dev

It's only required for PCI/MSI. So no point in having it in every struct
device.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20211206210224.925241961@linutronix.de
parent 85aa607e
...@@ -2875,7 +2875,6 @@ void device_initialize(struct device *dev) ...@@ -2875,7 +2875,6 @@ void device_initialize(struct device *dev)
device_pm_init(dev); device_pm_init(dev);
set_dev_node(dev, NUMA_NO_NODE); set_dev_node(dev, NUMA_NO_NODE);
#ifdef CONFIG_GENERIC_MSI_IRQ #ifdef CONFIG_GENERIC_MSI_IRQ
raw_spin_lock_init(&dev->msi_lock);
INIT_LIST_HEAD(&dev->msi_list); INIT_LIST_HEAD(&dev->msi_list);
#endif #endif
INIT_LIST_HEAD(&dev->links.consumers); INIT_LIST_HEAD(&dev->links.consumers);
......
...@@ -18,7 +18,7 @@ int pci_msi_ignore_mask; ...@@ -18,7 +18,7 @@ int pci_msi_ignore_mask;
static noinline void pci_msi_update_mask(struct msi_desc *desc, u32 clear, u32 set) static noinline void pci_msi_update_mask(struct msi_desc *desc, u32 clear, u32 set)
{ {
raw_spinlock_t *lock = &desc->dev->msi_lock; raw_spinlock_t *lock = &to_pci_dev(desc->dev)->msi_lock;
unsigned long flags; unsigned long flags;
if (!desc->pci.msi_attrib.can_mask) if (!desc->pci.msi_attrib.can_mask)
......
...@@ -2311,7 +2311,9 @@ struct pci_dev *pci_alloc_dev(struct pci_bus *bus) ...@@ -2311,7 +2311,9 @@ struct pci_dev *pci_alloc_dev(struct pci_bus *bus)
INIT_LIST_HEAD(&dev->bus_list); INIT_LIST_HEAD(&dev->bus_list);
dev->dev.type = &pci_dev_type; dev->dev.type = &pci_dev_type;
dev->bus = pci_bus_get(bus); dev->bus = pci_bus_get(bus);
#ifdef CONFIG_PCI_MSI
raw_spin_lock_init(&dev->msi_lock);
#endif
return dev; return dev;
} }
EXPORT_SYMBOL(pci_alloc_dev); EXPORT_SYMBOL(pci_alloc_dev);
......
...@@ -407,7 +407,6 @@ struct dev_links_info { ...@@ -407,7 +407,6 @@ struct dev_links_info {
* @em_pd: device's energy model performance domain * @em_pd: device's energy model performance domain
* @pins: For device pin management. * @pins: For device pin management.
* See Documentation/driver-api/pin-control.rst for details. * See Documentation/driver-api/pin-control.rst for details.
* @msi_lock: Lock to protect MSI mask cache and mask register
* @msi_list: Hosts MSI descriptors * @msi_list: Hosts MSI descriptors
* @msi_domain: The generic MSI domain this device is using. * @msi_domain: The generic MSI domain this device is using.
* @numa_node: NUMA node this device is close to. * @numa_node: NUMA node this device is close to.
...@@ -508,7 +507,6 @@ struct device { ...@@ -508,7 +507,6 @@ struct device {
struct dev_pin_info *pins; struct dev_pin_info *pins;
#endif #endif
#ifdef CONFIG_GENERIC_MSI_IRQ #ifdef CONFIG_GENERIC_MSI_IRQ
raw_spinlock_t msi_lock;
struct list_head msi_list; struct list_head msi_list;
#endif #endif
#ifdef CONFIG_DMA_OPS #ifdef CONFIG_DMA_OPS
......
...@@ -474,6 +474,7 @@ struct pci_dev { ...@@ -474,6 +474,7 @@ struct pci_dev {
#endif #endif
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
void __iomem *msix_base; void __iomem *msix_base;
raw_spinlock_t msi_lock;
const struct attribute_group **msi_irq_groups; const struct attribute_group **msi_irq_groups;
#endif #endif
struct pci_vpd vpd; struct pci_vpd vpd;
......
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