Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1229999rdb; Tue, 30 Jan 2024 11:43:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWyANbwhdpGd+ySlccgWqk2QzfkNj6x4M4dt9hyLHwVBBOaiHpi0RXD/eDeqkOU4RzhtVM X-Received: by 2002:a05:6214:29ef:b0:68c:56ab:c555 with SMTP id jv15-20020a05621429ef00b0068c56abc555mr3522225qvb.60.1706643835687; Tue, 30 Jan 2024 11:43:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706643835; cv=pass; d=google.com; s=arc-20160816; b=wQRDsqjjQkJ5d63feoxaMShO9ZlDIIRXNtw28lFDJiwwsXYhzyvT35NC+7a9w3naas eITUYeuD/SyWMuCtsIXAbvRo8l/+ugse3OC+vlhKJJKNQAbYbT6mqQK/T8qohuODD6x3 C4Q6S+Uvr+hOkTtY+o+SvghXSZg5tFsddEANRxHWfHLx7IW8yjRgZCLlJWllma+ANbg8 yyQaqG0EPCKOTM18k5/Jyo+e+KK0nXLFEUaEOkHLpGM6u3CNvAGBN6rZcQHsg775P+yH HH/cUON4KWArk123+FwSmINSeU+p83HTr0DXk2Hvl6tkd+2FK7q8YUjwhNCQ2y0AL6Py zV9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=j4+bJQ9KxQsfmcSvVjFQIdprlT+3DSC8gPFh/+1/c+8=; fh=vOLjcuJJ0RZwC/YJdS6wmvR68dGf0pjn3cyXHIgdHyk=; b=FSC8HlMvCTNSGDYk+axUubgumrrKQ1DdsZnwMq7GAdoxKdJmkv3ofOT7dUGR8OJ5Fk 7+LudMThfavT7cDrpeY0lHo8cXZTJpUJz1L5KotxLbO8K1bzkmxY5UtMujLn0V0sSC0s kZhkXNp1p21oEntXXqc3pFffKEJLX7iTSztfz7PGJlJ/lJaUR6ExsqQEiNELDFa3f7ln NEx3wW+mtutbyCLC65aohFiXO1dJMEtotiq3sI25zfLmxXHcClFOQClK8qTFpJfFMGqB Aqjgw+jY5o5m8mf3W09TEkzw8zTJsKwpfx51tVAZcCALgteRwiYIBvuyhUwec7CtAvg5 VXaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ne/OBRA7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-45215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pt17-20020a056214049100b0067a92d7c4b7si11364531qvb.319.2024.01.30.11.43.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 11:43:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ne/OBRA7"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-45215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 70D3D1C241FB for ; Tue, 30 Jan 2024 19:43:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0405869E12; Tue, 30 Jan 2024 19:43:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ne/OBRA7" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 229187B3C3; Tue, 30 Jan 2024 19:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643818; cv=none; b=Mk+ziVp9O+8QznMjaJOS0ZVq8ZSgZ0pLWxC5ahrTbBe8aUu1VBjQdvG/Nhm2tKr1rHUhY5467Mo/nXAdvE0WpxpeKi0Esjsu8SgUdHsffFCX8JriXXT8rZ0/UMJKu5+viQkOnkAqC37FsM34jsO+30tZ1cuAw0497U6NC6TKEZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643818; c=relaxed/simple; bh=jTu+NxsYyIa/g4xgHaisI+TEdtR6uBQYEZWvKOLa+ws=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z9fwl2O3d03dDk40yivhCd12wCeOZLGNkQTdP2EuKn2pJUHYsOYg9UUQ+6deKTW3eu/Ar1VoRJ92+jftETUnxhq6Jrsi12qto37gQg2rZpzvF3F+1SyeAsnoO20R9Wei6Yt9gAhEdV+nI0+3cuWsr0SFRTwIyhwp86Fi0tvnp3E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ne/OBRA7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A25BC43390; Tue, 30 Jan 2024 19:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706643817; bh=jTu+NxsYyIa/g4xgHaisI+TEdtR6uBQYEZWvKOLa+ws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ne/OBRA7S3YHZT2GZm9YQY9/wBnEzTd9uJ740fF4+RSeqDfY4m0MjonevaOgKNuU4 VNnfCUcn8RlcfzLHEWT3iMHyQEhjfXjNnEUwRlnlSXrXNK0WxIhscvoi7BI08MXeGB A6bqBFs8hh0VEih2vhPjCToY8RSALHW0uo1oF+X8q4hZhDfaydo5054VxZPtiKiokd 6DGR8rEUV/vnzQpvPCGbxXC/6eiYL7F93xr+E+n4iY0jVLTbZ6llnxmQ9hfba5exvh pGq5QfuZSzxCwvT9/qtmBnNTMwahkAPEfQZFKiH96x5hHUmUBwwc1S7IMvlv6t6z5s SPmzcqG1dAMlw== Date: Tue, 30 Jan 2024 20:43:24 +0100 From: Niklas Cassel To: Frank Li Cc: mani@kernel.org, allenbh@gmail.com, bhelgaas@google.com, dave.jiang@intel.com, imx@lists.linux.dev, jdmason@kudzu.us, kishon@kernel.org, kw@linux.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, ntb@lists.linux.dev Subject: Re: [PATCH v4 1/1] PCI: endpoint: pci-epf-vntb: Fix transfer failure for fixed size BARs Message-ID: References: <20240108151015.2030469-1-Frank.Li@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Jan 25, 2024 at 10:33:19AM -0500, Frank Li wrote: > On Mon, Jan 08, 2024 at 10:10:15AM -0500, Frank Li wrote: > > For the inbound MEM/IO TLPs, iATU on the endpoint expects the target > > address to be aligned to the size of the BAR. For configurable BARs, there > > is no issue because both host and endpoint will know the exact size of the > > BAR region. But for fixed size BARs available in some controllers, if the > > BAR size advertised by the endpoint is not same as of the actual BAR size > > used in the controller, then the MEM/IO TLPs generated by the host will not > > be translated properly by the endpoint iATU. > > > > So if the fixed size BARs are available in endpoint controllers, always use > > the actual BAR size. > > > > This only fixes doorbell (DB) BAR. A similar fix is needed for memory map > > windows(MW) BARs. > > > > Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP") > > Cc: stable@vger.kernel.org > > Reviewed-by: Manivannan Sadhasivam > > Signed-off-by: Frank Li > > --- > > @lpieralisi: > > Could you please pick this fix patch? Hello Frank, Lorenzo, Mani, Frank, sorry for not seeing this patch earlier. Could you please see if this series fixes your issue: https://lore.kernel.org/linux-pci/20240130193214.713739-1-cassel@kernel.org/T/#t I think it is nicer since: 1) It doesn't add copy pasted code from pci-epf-test.c to pci-epf-vntb.c. 2) I would expect it to handle both the doorbell BAR and the MW BARs. Kind regards, Niklas