Skip to content

Commit

Permalink
genirq/msi: Rename msi_[un]lock_descs()
Browse files Browse the repository at this point in the history
Now that all abuse is gone and the legit users are converted to
guard(msi_descs_lock), rename the lock functions and document them as
internal.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
Link: https://lore.kernel.org/all/20250313130322.027190131@linutronix.de
  • Loading branch information
Thomas Gleixner committed Mar 13, 2025
1 parent fc87dd5 commit 8327df4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions include/linux/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ struct msi_dev_domain {

int msi_setup_device_data(struct device *dev);

void msi_lock_descs(struct device *dev);
void msi_unlock_descs(struct device *dev);
void __msi_lock_descs(struct device *dev);
void __msi_unlock_descs(struct device *dev);

DEFINE_LOCK_GUARD_1(msi_descs_lock, struct device, msi_lock_descs(_T->lock),
msi_unlock_descs(_T->lock));
DEFINE_LOCK_GUARD_1(msi_descs_lock, struct device, __msi_lock_descs(_T->lock),
__msi_unlock_descs(_T->lock));

struct msi_desc *msi_domain_first_desc(struct device *dev, unsigned int domid,
enum msi_desc_filter filter);
Expand Down
16 changes: 10 additions & 6 deletions kernel/irq/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,26 +338,30 @@ int msi_setup_device_data(struct device *dev)
}

/**
* msi_lock_descs - Lock the MSI descriptor storage of a device
* __msi_lock_descs - Lock the MSI descriptor storage of a device
* @dev: Device to operate on
*
* Internal function for guard(msi_descs_lock). Don't use in code.
*/
void msi_lock_descs(struct device *dev)
void __msi_lock_descs(struct device *dev)
{
mutex_lock(&dev->msi.data->mutex);
}
EXPORT_SYMBOL_GPL(msi_lock_descs);
EXPORT_SYMBOL_GPL(__msi_lock_descs);

/**
* msi_unlock_descs - Unlock the MSI descriptor storage of a device
* __msi_unlock_descs - Unlock the MSI descriptor storage of a device
* @dev: Device to operate on
*
* Internal function for guard(msi_descs_lock). Don't use in code.
*/
void msi_unlock_descs(struct device *dev)
void __msi_unlock_descs(struct device *dev)
{
/* Invalidate the index which was cached by the iterator */
dev->msi.data->__iter_idx = MSI_XA_MAX_INDEX;
mutex_unlock(&dev->msi.data->mutex);
}
EXPORT_SYMBOL_GPL(msi_unlock_descs);
EXPORT_SYMBOL_GPL(__msi_unlock_descs);

static struct msi_desc *msi_find_desc(struct msi_device_data *md, unsigned int domid,
enum msi_desc_filter filter)
Expand Down

0 comments on commit 8327df4

Please sign in to comment.