From patchwork Mon Mar 17 13:29:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 14019308 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CD362459C6; Mon, 17 Mar 2025 13:29:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742218176; cv=none; b=d89UmpQeePWrWtXeauw4A4tEf2JYXnsE5nHqL7CRbO04ug4UYTgXR+UUo4HUR44wKNCLelU+DpQDiU6in5zyupemhc/a3ZOMu9Lb4POzionl0jZQYohTlO1sAzphP0AJVBNjackflA9CPzErNjKIBx6P1Luc7xubCVa3UwOs56Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742218176; c=relaxed/simple; bh=OsAT6D9CldSVNahrghb7ysAo5aIZUfq3/QpPX5ODrUA=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=OJxH/4a53zTCVc7YpABLvbcdZJMmenxcjuI/B5CZGrq8ao/l5Qehjg11auNP9k2dwCcoo4d9YChFfuA1/KuTF5afTrOHCsAeD7wFPbDwqPxmlfGZZKJ3nB7OWWqZd0VYtByY7342ezyj0yPqqw3te61KiTVd8AWDOvyfr+NiJoM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=w58zQrDa; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uKTLVrch; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="w58zQrDa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uKTLVrch" Message-ID: <20250317092946.328138598@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742218173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=ia2tEh37yjsfzlatAAKITICyRXBXhsYCZirmqzcl6Tc=; b=w58zQrDaR37YtihrS3LzLZ/Z/H2aikA987p75/CIGz3gQSOYNYHwChnsLAPhw0qpYckVXk VqJjGAYMf+V13ZeKwexivKjbE0uld1SLY6VFxmKteflqQSLKUts/Iz/QZucBJB2HlDSftG gq/oWLFMO6TAyop/OOHVmTHW79LCSoZm43qfOvr1CPNCIPzHqzNGNfXbfow88tffhtoh8P vJl0B9tJc66VzxHNl5hnio6yiJuMv1YaSmQ4pfLFHL1AHDxIj6tnoNAITd1yGCvdMkEgHl wy40lt9bqE3RUQGVeJVkmsvmzCjrkGqFxDAQujpDnFdCZYqMUrU/Z9i8OUbfow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742218173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=ia2tEh37yjsfzlatAAKITICyRXBXhsYCZirmqzcl6Tc=; b=uKTLVrcht/LXQCye+FwJgpfJTT2+/bln1MD8dmbjx/rEUxv7f52EMIrPOzIMJE+v3zAXJ8 08cOmwCYVxbhIIBQ== From: Thomas Gleixner To: LKML Cc: Marc Zyngier , Peter Zijlstra , Jonathan Cameron , Jonathan Cameron , Nishanth Menon , Dhruva Gole , Tero Kristo , Santosh Shilimkar , Logan Gunthorpe , Dave Jiang , Jon Mason , Allen Hubbe , ntb@lists.linux.dev, Bjorn Helgaas , linux-pci@vger.kernel.org, Michael Kelley , Wei Liu , Haiyang Zhang , linux-hyperv@vger.kernel.org, Wei Huang , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [patch V3 10/10] genirq/msi: Rename msi_[un]lock_descs() References: <20250317092919.008573387@linutronix.de> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 17 Mar 2025 14:29:33 +0100 (CET) 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 Reviewed-by: Jonathan Cameron --- include/linux/msi.h | 8 ++++---- kernel/irq/msi.c | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -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); --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -337,26 +337,30 @@ int msi_setup_device_data(struct device } /** - * 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)