From patchwork Mon Mar 17 13:29:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 14019304 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 6DE0724169A; Mon, 17 Mar 2025 13:29:30 +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=1742218172; cv=none; b=GknlNtn1swAJfsPWXUU7VLsUpC86urmSV3MdS1E9c9go0pcDEC3y2MxWWmeSTUU5RzyE7kiV6/75/HT5Vl+l5jPU0UBOCWqagpt/rAytjEj2oxmEAeU+fRmh+Pe5q7sgcSQZW6zuRVfOPvOzeUdKC12uEEEtxoe4NYtaGyOp8Kc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742218172; c=relaxed/simple; bh=p1T7rPE6PheQf1PP3APwWVg7WjhczJsCxKMiW9/IOi4=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=gidLd/DyGMKINI1WD6aJkfkN85kmakiTIQ3UWvNWWW2bQhuzk45+m0mD71H/Ub9MUmG/bspw5fydnWALh7usAcKdM74dV29KfCdJfOoBK3Wk+LeN6zVtHYTy6hZOGpPhmLjwz6WKH4ZC3qtBOUyX0A8+YAdT/g5bllLYGYxfu+Y= 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=I+lmDMBo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kD+t1zcj; 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="I+lmDMBo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kD+t1zcj" Message-ID: <20250317092946.075206592@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742218168; 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=3/dRMN7oC/HSArm4ElW7bOG9bX8b/YPinUN++M1pXqM=; b=I+lmDMBoCXWAe1aotpi9TzLp2syIkoYuxIIkcAv2AlYOPe2S/+dhRwasZEUe1P1bkGhVA9 408wd+oLUdwowQzLUtOzZlhI0kOmujCj3CtzG5vdX+GDCQN80WcxQFm6pWqfF9uu/yLAwo Qf+rugx8daut868JVXE+JaG6zsIgbiQh7B8Qli/TFav+bjjI8aZsJ9e2rqw4Lgf5cwt9Lc rvGCV/Jzfy1LEA9nvKEVvLlyY7pFKMyL/z8kiZZQfdNJJh5OMwEqOB6iuloxiT/iLQsTJS Swh8sq5Mx67ukMmheyWs8D5uE5jootv55P9+VmlsqmNWS/Xm9Hn3N1GNmbdZOg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742218168; 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=3/dRMN7oC/HSArm4ElW7bOG9bX8b/YPinUN++M1pXqM=; b=kD+t1zcjj/G+g2DMtE4DoeqeCmi99mS8B8MhBunWIJqfeR6v1OSO6xWw1rXnRRonnrYdAH sfpNSZc2I8ZJbCAw== From: Thomas Gleixner To: LKML Cc: Marc Zyngier , Peter Zijlstra , Jonathan Cameron , Michael Kelley , Wei Liu , Bjorn Helgaas , Haiyang Zhang , linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Nishanth Menon , Dhruva Gole , Tero Kristo , Santosh Shilimkar , Logan Gunthorpe , Dave Jiang , Jon Mason , Allen Hubbe , ntb@lists.linux.dev, Wei Huang , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Jonathan Cameron Subject: [patch V3 06/10] PCI: hv: 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:28 +0100 (CET) Convert the code to use the new guard(msi_descs_lock). No functional change intended. Signed-off-by: Thomas Gleixner Reviewed-by: Jonathan Cameron Reviewed-by: Michael Kelley Acked-by: Wei Liu Acked-by: Bjorn Helgaas Cc: Haiyang Zhang Cc: linux-hyperv@vger.kernel.org Cc: linux-pci@vger.kernel.org --- drivers/pci/controller/pci-hyperv.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3976,24 +3976,18 @@ static int hv_pci_restore_msi_msg(struct { struct irq_data *irq_data; struct msi_desc *entry; - int ret = 0; if (!pdev->msi_enabled && !pdev->msix_enabled) return 0; - msi_lock_descs(&pdev->dev); + guard(msi_descs_lock)(&pdev->dev); msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) { irq_data = irq_get_irq_data(entry->irq); - if (WARN_ON_ONCE(!irq_data)) { - ret = -EINVAL; - break; - } - + if (WARN_ON_ONCE(!irq_data)) + return -EINVAL; hv_compose_msi_msg(irq_data, &entry->msg); } - msi_unlock_descs(&pdev->dev); - - return ret; + return 0; } /*