From patchwork Mon Mar 17 13:29:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 14019301 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 DC45F23F404; Mon, 17 Mar 2025 13:29:26 +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=1742218168; cv=none; b=CJH5OdICIC6OUmJtZyFvq2lrayoMcLThWmPtPwiO+jDiqjbk7gKSmZlVRghXnL93/uXqlQchVoktEI/i6QPwmncKPpN9xl4LXqH1lsene/UGIJTMkABoBei0uWo2dNUW2ftQBxkFj6x3ep7Mluf7NbkHjGExB8OPjdbkr+P1aOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742218168; c=relaxed/simple; bh=RvJxo5ar40+unPIeF/B/OFE+2jPTP7dHPiKnIeqq5Ws=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=oYXww3dhOfTyxTq31oUzaLKOHKdCEywtUd/zcWuKBk9gvnKRXP5ZCvxulxHUxH510dNUghQe5Ay9I8sxpzrNIma0oJf3HBfX601NvTeSXBik9V1W6tXgLFuX/jgWgQ2GYCdhxhrqy7oMEApenJEs5lLraMTOZS7UbmyP6HY0c3E= 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=ZXgDw2Xg; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=v5VcbI0Y; 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="ZXgDw2Xg"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="v5VcbI0Y" Message-ID: <20250317092945.889932275@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742218165; 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=Au16aChR8IOH+YeFbnBW4TcQleO7ukWx0zDehmMH2S0=; b=ZXgDw2XgxMHj0HftP/VDW1yVeAZ8nzFkaGjuOfO8cRtoswl1ExtC5xQyQxpBoeuijYHOg4 MkJ2gghxl3eRl0wdd8jqGVrxSp6sT+lMu8WedWlOiLdXTtiKgorxTw+GbXLiyBcCLMARYw nF0ap//kj5Tw7249Gma2UsXb78dFQV2dkY0jp5Vj7zvnZHF08Hzr/ZpuDwKAfylW2yXOYV iJuDni3zUp2P1ByxoDbNZm8SxUbzmnYexL8SOwPpiDQQFb5YGLft2c11YC5MiMEWh8Xfwx y8zcbqqT+xTcRo1ZAqYVwKE2SDqIIWolGr6AX0vz1IPG2Foeh3ghz+YdMGJ74A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742218165; 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=Au16aChR8IOH+YeFbnBW4TcQleO7ukWx0zDehmMH2S0=; b=v5VcbI0YRMhLvO4XpGpSQD8ONn1g2PrWR38hWuuzs7bjf/FDh/7NRXJvvZoI9SJQOU+70x 2bK7aLTu3JJmyGAw== 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, 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, Jonathan Cameron Subject: [patch V3 03/10] soc: ti: ti_sci_inta_msi: Switch MSI descriptor locking to guard() 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:24 +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);