Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp978008lqs; Fri, 14 Jun 2024 10:54:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWyelw36Iz5Z0PQgcFJ0qTxNW9wValFVcw7fwvGAuUgSdD0x/COAcZxuiQKsO44aByDmQf0M6Eu5i4rQ9EdkY3jdvoJJjLOXyALO+9USw== X-Google-Smtp-Source: AGHT+IEcWfK8ZlV27UKpILi8rsNDN90FaldnWCLyfqqIvb1Y8K+goB7XXGfLlX1LTroa4quiRSlz X-Received: by 2002:a17:902:6e08:b0:1f8:67e4:3985 with SMTP id d9443c01a7336-1f867e44580mr24775625ad.49.1718387669900; Fri, 14 Jun 2024 10:54:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718387669; cv=pass; d=google.com; s=arc-20160816; b=I9jI2IAYetvGBtEnY8j0NexDDfIA5ESbJuPu4T6sg2f/nXi2wcd8wppWKGKQY3QPzF A3akIbgNs+H+0urD1ES7+AFf4Cg8ve9GQrfInZ+G/IumH/dT9Ot/cPBjuIsqSiDRdwqd lOxAxUrYxFwBq4GwXyhlYRnn+JOSmMIB6k5LsHjnJSqjJnf9s7FY0wqGvec8Ev1ppad5 ftEJ8v2DDGdx7KSAy15PstfunQB3UEaSp2XQ4NN4/gma9Ql4O5de8ku4E2+10YDGv57R DULgaaUG1C6QexMPsBNCSItkwSJVl8nNXFQmLw0PndZrSjztRMt8QcLLeXwSyUBQrgQM Q93g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=5NIjfiRFL0LMgY1srJOfuq2R8RDvzN4oNUYKCC5cRN4=; fh=xYDdjTO16nx+gOiBuKmnT92QREUZ7Atyws0NSrAcD78=; b=qOUPGahZVzszX285eBnbjyV16nYwmAIJW2DychDpwrUUEjAREoJ2utvqULwcEJkvw1 Lcu252p8X8fBsd7TrCJfH44ckpoqK4VZW6ZVQ0iCdxC6fRvjpP0PkiqkaF30W8vQNPM3 wPKNj2M6O2aMX+flsFP5Mor/Ctv41F8dkT0W8DmiMQ1N13uQOji+yDJD8O0LhdMyk+RT YlLcOkw0ccQpJ6jPeAhTtGOLDKPSSrXvM9Xpn7aQqLrPP0YZGFDhSfEq+IZrX4UYSC3/ mad7pp6PlFe7nhy7e+Im4RUi59Eoh/+bnDoz7mOK2eWvBdi47Ftske2JIuuTipqIn0jZ CR8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="mRjipV/G"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-214923-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214923-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f855efeaeesi39295105ad.465.2024.06.14.10.54.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 10:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214923-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="mRjipV/G"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-214923-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214923-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ECAE3289BD9 for ; Fri, 14 Jun 2024 13:01:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A597D19AA4F; Fri, 14 Jun 2024 13:01:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mRjipV/G" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 5143D14884C; Fri, 14 Jun 2024 13:01:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718370070; cv=none; b=kFVem0+/s4tzxeP4kfYPf0mWUrLYGj5nszfIMo0oVJDndhQyekYHeeKpPTS//fyludZLqaVEUp/DyPFLfU0VG94ymEdAwYPjeZktgU+HNnNRckrBEUc2HMkC9p2nxSbssBaIboIRh2iGTlQ6M9bH1n5SMKYwztfSX0dbNe5ptxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718370070; c=relaxed/simple; bh=9w0oxfZW3tzeT9Qsfui1ClN8mhXS4JJ7xFStryXFdiE=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=qQB74gRI3enBNJs+Lmof5sqzE/J/7cKdCifRynRiVpVvQSqLasuUn4RfFI+XxhDCPnBz56off4KOrxoxS6PLy37frG5Nc+zdLBHXenOckLxf6tuS5pc08subEdt0RpX3uO5/9pyp0uu51kIK/IEGnmDhypounnmySVMp/Z21lLM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mRjipV/G; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718370069; x=1749906069; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=9w0oxfZW3tzeT9Qsfui1ClN8mhXS4JJ7xFStryXFdiE=; b=mRjipV/G82fWpCS8EVGxRhFstjypPIFlMWweNXguoDZ1KJ6iCwcizH4e BcXYcOFOBbK8W7i7Tj69Yhbgwq+XWewE3500L2o6WQuq8W1urqbM6FMJI nNif96g84n+o/HwcpEC0r8sPUHxMV8BrCQRMlcCm3Yif2wsmxdf35dCoc DzRSv/ix7Ira4w3rMtiq1HzM3lVA1UG4oKiL31O8sq5Y8PLyEbIWD2r7F Bx7+2utx3bLb7ucTF4jUVKt6wbViQBy6t0UV8Yvbx3pNPxKntdiCp/IZX JsoMzFYc8OaBay7i7onF06ETFbHJFRsojsk+IjpLhTuPQH6EC5w/N4jDq w==; X-CSE-ConnectionGUID: aweVGN1eQ0SHI+ae25G0zQ== X-CSE-MsgGUID: Pjmls1RxToyt1cwfiWNpaw== X-IronPort-AV: E=McAfee;i="6700,10204,11103"; a="18174144" X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="18174144" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 06:01:08 -0700 X-CSE-ConnectionGUID: XcaeA88/TC6G0Aa5E0hrSg== X-CSE-MsgGUID: hX1ZIzpIQzC6QNcKUEiMkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="63695069" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.222]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 06:01:04 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Fri, 14 Jun 2024 16:01:01 +0300 (EEST) To: Dan Carpenter cc: Frank Li , Jon Mason , Dave Jiang , Allen Hubbe , Manivannan Sadhasivam , =?ISO-8859-2?Q?Krzysztof_Wilczy=F1ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , ntb@lists.linux.dev, linux-pci@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/2] PCI: endpoint: Fix epf_ntb_epc_cleanup() a bit In-Reply-To: Message-ID: <7ae11357-6284-9afa-2272-19e796bc2018@linux.intel.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-1326312854-1718370061=:1013" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1326312854-1718370061=:1013 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 10 Jun 2024, Dan Carpenter wrote: > There are two issues related to epf_ntb_epc_cleanup(). > 1) It should call epf_ntb_config_sspad_bar_clear(). > 2) The epf_ntb_bind() function should call epf_ntb_epc_cleanup() > to cleanup. >=20 > I also changed the ordering a bit. Unwinding should be done in the > mirror order from how they are allocated. >=20 > Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and = EP") > Signed-off-by: Dan Carpenter > --- > drivers/pci/endpoint/functions/pci-epf-vntb.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/= endpoint/functions/pci-epf-vntb.c > index 7f05a44e9a9f..874cb097b093 100644 > --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c > +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c > @@ -799,8 +799,9 @@ static int epf_ntb_epc_init(struct epf_ntb *ntb) > */ > static void epf_ntb_epc_cleanup(struct epf_ntb *ntb) > { > -=09epf_ntb_db_bar_clear(ntb); > =09epf_ntb_mw_bar_clear(ntb, ntb->num_mws); > +=09epf_ntb_db_bar_clear(ntb); > +=09epf_ntb_config_sspad_bar_clear(ntb); > } > =20 > #define EPF_NTB_R(_name)=09=09=09=09=09=09\ > @@ -1337,7 +1338,7 @@ static int epf_ntb_bind(struct pci_epf *epf) > =09ret =3D pci_register_driver(&vntb_pci_driver); > =09if (ret) { > =09=09dev_err(dev, "failure register vntb pci driver\n"); > -=09=09goto err_bar_alloc; > +=09=09goto err_epc_cleanup; > =09} > =20 > =09ret =3D vpci_scan_bus(ntb); > @@ -1348,6 +1349,8 @@ static int epf_ntb_bind(struct pci_epf *epf) > =20 > err_unregister: > =09pci_unregister_driver(&vntb_pci_driver); > +err_epc_cleanup: > +=09epf_ntb_epc_cleanup(ntb); > err_bar_alloc: > =09epf_ntb_config_spad_bar_free(ntb); Reviewed-by: Ilpo J=E4rvinen --=20 i. --8323328-1326312854-1718370061=:1013--