From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ne/OBRA7" 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