2021-11-27 01:26:10

by Thomas Gleixner

[permalink] [raw]
Subject: [patch 04/37] PCI/MSI: Use lock from msi_device_data

Remove the register lock from struct device and use the one in
struct msi_device_data.

Signed-off-by: Thomas Gleixner <[email protected]>
---
drivers/base/core.c | 1 -
drivers/pci/msi/msi.c | 2 +-
include/linux/device.h | 2 --
3 files changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2875,7 +2875,6 @@ void device_initialize(struct device *de
device_pm_init(dev);
set_dev_node(dev, NUMA_NO_NODE);
#ifdef CONFIG_GENERIC_MSI_IRQ
- raw_spin_lock_init(&dev->msi_lock);
INIT_LIST_HEAD(&dev->msi_list);
#endif
INIT_LIST_HEAD(&dev->links.consumers);
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -18,7 +18,7 @@ int pci_msi_ignore_mask;

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 = &desc->dev->msi.data->lock;
unsigned long flags;

if (!desc->pci.msi_attrib.can_mask)
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -422,7 +422,6 @@ struct dev_msi_info {
* @em_pd: device's energy model performance domain
* @pins: For device pin management.
* 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
* @numa_node: NUMA node this device is close to.
* @dma_ops: DMA mapping operations for this device.
@@ -520,7 +519,6 @@ struct device {
#endif
struct dev_msi_info msi;
#ifdef CONFIG_GENERIC_MSI_IRQ
- raw_spinlock_t msi_lock;
struct list_head msi_list;
#endif
#ifdef CONFIG_DMA_OPS



2021-11-27 12:15:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [patch 04/37] PCI/MSI: Use lock from msi_device_data

On Sat, Nov 27, 2021 at 02:20:13AM +0100, Thomas Gleixner wrote:
> Remove the register lock from struct device and use the one in
> struct msi_device_data.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> ---
> drivers/base/core.c | 1 -
> drivers/pci/msi/msi.c | 2 +-
> include/linux/device.h | 2 --
> 3 files changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Greg Kroah-Hartman <[email protected]>