Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2157618rdb; Sun, 4 Feb 2024 18:35:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeN4TgHGuCmkMYf/8Yx3dUU97hm3ME1K1UOta5u6WK6MHpSAYBQ/05BzaXWFUp8M1XFJch X-Received: by 2002:ae9:e603:0:b0:783:c579:c246 with SMTP id z3-20020ae9e603000000b00783c579c246mr13621509qkf.45.1707100525219; Sun, 04 Feb 2024 18:35:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707100525; cv=pass; d=google.com; s=arc-20160816; b=TOHGt9C6GmF5ScjE/tkxV6gzJxgzMh55BwSQdQyfWdL4sx6sFzIKKHUGlCPBcqxGzX pEEB7KavJ8oZO+MxhDVV9JTpQ37tQ2f0C+L2ttU0TBC1FKqxpqkC+ukvVl8v0eHqTiJp klYr5WFxRTvGz8NBVE7oa4Nb9vNpIqW+NGq1hwaL4ogaJdHoncIrY6DYGMdTumEoh6oU AAexQWaetfexPo4H0tNf+GvOEZbHmLU8yMwavGlGhDREZqsq9ndTQ9vbhMsmfmWNvseJ QL2wMH586OqwxE0he5YHdZk6Mw5FE7y9/rxLcd/U/8nMuby3zYI4YVVYdt/sThjDjOZS hrZg== 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=k0q85wlBH1qP/rODRb/lFD849CHxVQ8YcOU1mK4A370=; fh=j1qkIfoWON9nqHVahnz8kek2OINR86z5u7uuUaLIzYc=; b=ht5tn+ELhPXssaF5IVAoUHQD5/9uJemsgUGMzbLZw52TouwOKePraqT0IvaK4BViTp O8kU1yoyZO/msmd+R3MgWM5d/Y2W9tslj5j+mwownUxRmMkkb+foMl37CXL6tGKdt+2w LWm0alxh2CRwdZlwKIZ0+l2Ut2xuvrRzjxGKce1PoXX3DhgfKplyV1zIm3Bt0kMFz9nc 2RtTakD+KGr2O5mILp/Xj0xZGJ1AXNCTwnDjWlixs4rbmvSbVu3tf9qgxbqxHA1ymDOx NnSDF/WORA0H4upkIi0ePdAszGA+i8S+/2ittcGtB7XsB+TvdG0KBH1SVEEoqS3KH7jJ Mo/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bU8cl9ku; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51993-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUWuAfvi8zr4gSkliUGnTk0PfX6pNdMORQl3iZCfcP4Xwzl3kAL17MgH42UbXZXfC2GrHpJQWKFrhJI4r9Y2KVGTXcW+cMF9TlG4474kA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e25-20020a05620a12d900b007833ac2b003si7767582qkl.378.2024.02.04.18.35.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 18:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bU8cl9ku; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51993-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51993-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F0A541C20C75 for ; Mon, 5 Feb 2024 02:35:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AA6B944D; Mon, 5 Feb 2024 02:35:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bU8cl9ku" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 878F68F49; Mon, 5 Feb 2024 02:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707100520; cv=none; b=PAbEN4k/hoav+3hLpACGbAY4kfzvItdqmuwKweN/Owz40JX4DacpToui3DnqTRpXruWoa902IF2dv60r+2l8+YTGqtRX/QhsFW7/cRGhadl71Qw7pz164C1SE33wEHmd2ez+tQzp643VBEBQTOueemlGtTjn5S3owTWSJ7X7BKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707100520; c=relaxed/simple; bh=dr9DDXAdyJ3pofZryHHuOExHQj18z6GN6Uo15RMgnGE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sOFikHWKDNsy0uXU1Qakis7PriMPbJjw2SzEVvDL9zWiVrDqoLDYd/YbwcetooF7PULSQx5Z9Wy0iM8M+ellnhZN8CqPjmZICBv7uAgQwPdfPjKlAusqkY6+xp/UG+Nw7tclJZ74GqIwLZ2N3vFKOg8z1LvcltJ1J6wvv+IHLlM= 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=bU8cl9ku; arc=none smtp.client-ip=198.175.65.12 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=1707100518; x=1738636518; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=dr9DDXAdyJ3pofZryHHuOExHQj18z6GN6Uo15RMgnGE=; b=bU8cl9ku77XvPknmX2Z3J8clMdML2+8fP02DhAUnEK7jEKTg+Smu9fDs HJf5KG9fApx3vfID6twUUMgdTE7Ry3DalB1kU7TlyW1gRkYogpCZeucSy G0Kg7W2D+MHz8VYgex620vldLzx6Nv2V8Wf1pAYVJDpuk+XVEjJe4HtCp rtHU5slC3qvgqf5JRcFQj6HO7/iw25UOa8djFv3YsBhuC4WcLm8qog0rd IzVbBByeJg8C3nkOtjOH7GqxjHLfO6iv1DIRJWnvwBOkIOMOXRldw40g6 RjWg1K+r5YNT5tMfOE4Es8E1RNnqCaQAeeQQdILtBYjQ+ZuLCnSvRBWqh A==; X-IronPort-AV: E=McAfee;i="6600,9927,10974"; a="11794809" X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="11794809" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2024 18:35:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="802734" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmviesa008.fm.intel.com with ESMTP; 04 Feb 2024 18:35:15 -0800 Date: Mon, 5 Feb 2024 10:31:41 +0800 From: Xu Yilun To: matthew.gerlach@linux.intel.com Cc: hao.wu@intel.com, trix@redhat.com, mdf@kernel.org, yilun.xu@intel.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] fpga: dfl: afu: support Rev 2 of DFL Port feature Message-ID: References: <20240125233715.861883-1-matthew.gerlach@linux.intel.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 Wed, Jan 31, 2024 at 04:26:27PM -0800, matthew.gerlach@linux.intel.com wrote: > > > On Wed, 31 Jan 2024, Xu Yilun wrote: > > > On Tue, Jan 30, 2024 at 10:00:16AM -0800, matthew.gerlach@linux.intel.com wrote: > > > > > > > > > On Tue, 30 Jan 2024, Xu Yilun wrote: > > > > > > > On Thu, Jan 25, 2024 at 03:37:15PM -0800, Matthew Gerlach wrote: > > > > > Revision 2 of the Device Feature List (DFL) Port feature > > > > > adds support for connecting the contents of the port to > > > > > multiple PCIe Physical Functions (PF). > > > > > > > > > > This new functionality requires changing the port reset > > > > > behavior during FPGA and software initialization from > > > > > revision 1 of the port feature. With revision 1, the initial > > > > > state of the logic inside the port was not guaranteed to > > > > > be valid until a port reset was performed by software during > > > > > driver initialization. With revision 2, the initial state > > > > > of the logic inside the port is guaranteed to be valid, > > > > > and a port reset is not required during driver initialization. > > > > > > > > > > This change in port reset behavior avoids a potential race > > > > > condition during PCI enumeration when a port is connected to > > > > > multiple PFs. Problems can occur if the driver attached to > > > > > the PF managing the port asserts reset in its probe function > > > > > when a driver attached to another PF accesses the port in its > > > > > own probe function. The potential problems include failed or hung > > > > > > > > Only racing during probe functions? I assume any time port_reset() > > > > would fail TLPs for the other PF. And port_reset() could be triggered > > > > at runtime by ioctl(). > > > > > > Yes, a port_reset() triggered by ioctl could result in failed TLP for the > > > other PFs. The user space SW performing the ioctl needs to ensure all PFs > > > involved are properly quiesced before the port_reset is performed. > > > > How would user get an insight into other PF drivers to know everything > > is quiesced? I mean do we need driver level management for this? > > Since this is an FPGA, the number of other PFs and the drivers bound to > those PFs depends on the FPGA image. There would also be user space software > stacks involved with the other PFs as well. The user would have to ensure > all the SW stacks and drivers are quiesced as appropriate for the FPGA User may not know everything about the device, they only get part of the controls that drivers grant. This is still true for vfio + userspace drivers. > image. I don't think the driver performing the port_reset() can know all the Other PF drivers should know their own components. They should be aware that their devices are being reset. > components to be able to provide any meaningful management. If the reset provider and reset consumer are not in the same driver, they should interact with each other. IIRC, some reset controller class works for this purpose. Thanks, Yilun > > Thanks, > Matthew > > > > > Thanks, > > Yilun > > > > > > > > Do you want me to update the commit message with this information? > > > > > > Thanks, > > > Matthew > > > >