From patchwork Wed Mar 19 10:56:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 14022463 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 BD15D25523C; Wed, 19 Mar 2025 10:56:44 +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=1742381806; cv=none; b=qLkdEgpHBLH/DzG2lf9ibK5OgnyBf6xxnOBcVGY3pA4nol2LtCmiZPNzHAqAGGqLPNY4iImMDTEAVASJ5+M8LQa0FtqUCXx/5cUHYrfYmLBBSxsETcpv5q8MKWe9LhJUBOozHhz3QHxE8bJLDx/AfTxVf3xAt7ILmjElCU00zg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742381806; c=relaxed/simple; bh=gVMGNDCIzEC7gP1ELqJUnuWuiZU7ZW3gNVIXfeuimdA=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=K1eHIbw/p7bOKmixmQj9vnzevjfalrzw9wsGmzzEXiNXWO+2GZBClQ+BwSPouBcsTDQqm7tiPQDKBlXK9hssmEz7k2QRTkuMnOrg3NAfpMWUheYdbqFupU6zrQNdAgLz9CWjFX+tri5/TFbLYj3Q/U1izmxWHbuizaYPacSIYAI= 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=mSNqkk4o; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=iPMKH+Sf; 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="mSNqkk4o"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iPMKH+Sf" Message-ID: <20250319105506.203802081@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742381803; 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=3HVy4coZe9OEdGiZgYg3FWqwXg+pamrMoCzDhEhsOwI=; b=mSNqkk4oL7Li5xvEy0+K+0Fjkj68H31Qpffqbm3umEH25AXeTopx/PYDTLOkbywBA19+8u 4cxiftKlWdLnd8OwmspfoQw1KX53Kq3ucuK+/7sUO8Q1okwqPnoHnNkDchpIi2NQwwr6tN 30WDrI+h4z7ohSrK5xaDiFXQyATSq6HbHnZnoL2H3Qj0U3nyUMuBoVRgcDDIXgaiA3haoT 4jZiba+ynfxAvY2SxLopI9uwpOVlidvbQJV5ipDUTRrH0P+wfPy3++lhfR+cccijFnAJas TTGDqtksCzClW0mVJxW7SQ1f7Z9BJYLy2iY/rwi8pB+Ihw53FPCW1LiVTtgBVA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742381803; 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=3HVy4coZe9OEdGiZgYg3FWqwXg+pamrMoCzDhEhsOwI=; b=iPMKH+SfUJS4QuY40+uh5VfF+embdT/2hEum93jHk27kjHtQ2XfXu/3A+cotayev8/Hm/+ NShPyJPzBz3xnnAw== From: Thomas Gleixner To: LKML Cc: Marc Zyngier , Peter Zijlstra , Nishanth Menon , Jonathan Cameron , Dhruva Gole , Tero Kristo , Santosh Shilimkar , Logan Gunthorpe , Dave Jiang , Jon Mason , Allen Hubbe , ntb@lists.linux.dev, Michael Kelley , Wei Liu , Bjorn Helgaas , Haiyang Zhang , linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Wei Huang , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Jonathan Cameron Subject: [patch V4 03/14] soc: ti: ti_sci_inta_msi: Switch MSI descriptor locking to guard() References: <20250319104921.201434198@linutronix.de> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Wed, 19 Mar 2025 11:56:42 +0100 (CET) Convert the code to use the new guard(msi_descs_lock). No functional change intended. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Jonathan Cameron Reviewed-by: Dhruva Gole Cc: Tero Kristo Cc: Santosh Shilimkar --- drivers/soc/ti/ti_sci_inta_msi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) --- a/drivers/soc/ti/ti_sci_inta_msi.c +++ b/drivers/soc/ti/ti_sci_inta_msi.c @@ -103,19 +103,15 @@ int ti_sci_inta_msi_domain_alloc_irqs(st if (ret) return ret; - msi_lock_descs(dev); + guard(msi_descs_lock)(dev); nvec = ti_sci_inta_msi_alloc_descs(dev, res); - if (nvec <= 0) { - ret = nvec; - goto unlock; - } + if (nvec <= 0) + return nvec; /* Use alloc ALL as it's unclear whether there are gaps in the indices */ ret = msi_domain_alloc_irqs_all_locked(dev, MSI_DEFAULT_DOMAIN, nvec); if (ret) dev_err(dev, "Failed to allocate IRQs %d\n", ret); -unlock: - msi_unlock_descs(dev); return ret; } EXPORT_SYMBOL_GPL(ti_sci_inta_msi_domain_alloc_irqs);