Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2162912rdb; Sun, 4 Feb 2024 18:55:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWu41r6+DjOELSr+wUvnRAX3JRWEvoQwUgCUv4k4u5bdxe9DxgMjx6lR9BekK01QuRC0zj X-Received: by 2002:a05:6a20:9f93:b0:19a:834f:3b05 with SMTP id mm19-20020a056a209f9300b0019a834f3b05mr16936698pzb.47.1707101757429; Sun, 04 Feb 2024 18:55:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707101757; cv=pass; d=google.com; s=arc-20160816; b=nlENrWbOVM1HU4ztBaAPf5+KI0Pi6KaTFRCGPgcHWIQQzbui2MMjyLZJ0roqMbJyXY lpSm1tApIb0eEUByaaQrGo3mqquRGCutJ1i/dza1/TK7RwuHDqTASmqzy2E1Juj+dXvQ /ENuzhYC1e69WV+H5fYXaKhjgUy5vnvUf4/TOaLHsBDy40mzW5mb67eTcUiNe8So9zSe 3KSyAs0hXI1w5YAA+NZROsS6tbaSVVmZHn9WvRPYJq/9K3JB3URiaCut2wY4EqaXnpth 0YqdXDB/C2I5t5GNz+JJnH5W/4zHqbWRJMnKXdvUZNR4iA1xHOFfc5kqaLlOsG/k4D5m QVhw== 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=A8V9tNi7kkLOElM7bo8EdBksFrIqBi9xNudOaOOu/G8=; fh=ixvv/Ub+7hE9Gwb1/IYULsyk8oTUhEIHKli3sMsSwFg=; b=fsb+kxxdL1FDdzz7eaMlJsnTHWP3Cz4koz/0tbvNFOusBtE/5FQgnWwTV2arSLdoC0 wWSZR7hZEGSpTtTY0y/q9wF9ggr/OOhgll11V1C5Km/HpwR9jaSEIXhfWAIjNIoyFOlG eS3FX4CoykYYIwrI3r4ppVBf1tvKnNC6i0vsGGa1sSymXeFQYM5G9baPfgMvivM78fws wPgJ6j12I1CtogRDnRVvxkzigTs1q7V8p3Z1Zuq6kuByEixxlmn4r47JLfvrwQSX8gf0 Zacc9/GEVf3690mzgqeoLbMVGWkErVi7tMGw+DhIel7II0QOViXCqEUNgeSUeT8tujgR dINA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g0vWJC2Z; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51998-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; AJvYcCVhD4VDnF2polW7WNhueBGVqk6+UpoOKxc938sNLfds0jtAu3lP8tosckXSfv5Pr6DWNzJIqglPR6PcBTmNWOweqIQ7/R0aXW7RYutqJg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cp17-20020a17090afb9100b00296675f0cc4si3034568pjb.106.2024.02.04.18.55.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 18:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g0vWJC2Z; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51998-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 02096283132 for ; Mon, 5 Feb 2024 02:55:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8128EB671; Mon, 5 Feb 2024 02:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="g0vWJC2Z" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 F08438F40; Mon, 5 Feb 2024 02:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707101735; cv=none; b=nFPV4VcF2oIs/wt/VW7QAUG2Il8HCUZvDjqY+/ru2IQdjcKxtNIvRxlW2KdXjJn7AaenFIz5gyejtymrxf/lXaObufkkdqizBwZJr14mQsynTY8C79hxDmas7W+wccgdIAXk6odLEk22CiJ/Hov7YYdbHgs5Ni++ysMymJoEa5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707101735; c=relaxed/simple; bh=4AEV8Os8oxrL8TTjB0jQgYbL/z8pFobotn5bWihXYBM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=B6L68c1i1oclAsK1SQTt2VAaxjG0iI0M65qoeIbnnbLxVl6DMBmTpVWlReg+1ts5Fap3gl3Dq2o6tS0RfYn72NBJtPYhlDPpCaBKOK6/YoRVjkRSAtv+5D3gomLjKfCgL1aDMcvWvjkBmCMn/w43Ez9D1sRDa45P2EiBxF893FM= 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=g0vWJC2Z; arc=none smtp.client-ip=192.198.163.19 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=1707101734; x=1738637734; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=4AEV8Os8oxrL8TTjB0jQgYbL/z8pFobotn5bWihXYBM=; b=g0vWJC2Z9hRPJzUXtC/ILMudRyGdSWsDMjjK+rkazxqBhHHvqZi4qdoj A8vxlDF53oGwFLaGaVp9hfk7l5LWxsjR88SyHKkwOm8KUO7MmIcrucugn gQHo7yyW8kG6u/TF4QOa1Mtte0f/ME+5yxda1uBjSEO5xhlk3R8ysp32z czIKodm9oyM/aJvKBIrbOUh0O2LYGPSHoRdmDNQQWA0oPAsM9dtjCDSdK eweYXsuR1bpatF3ZprBLlY5s0nQKPjHYPgJ34pTmONgMRqR/zaO+gmIcp KCClILwU1+4VhIkmDab8JwaUQtHdG41Lu21Panxc+jdDn3Daiejv5VEt9 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10974"; a="336185" X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="336185" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2024 18:55:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="892042" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orviesa006.jf.intel.com with ESMTP; 04 Feb 2024 18:55:31 -0800 Date: Mon, 5 Feb 2024 10:51:57 +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] fpga: dfl: afu: update initialization of port_hdr driver Message-ID: References: <20240122172433.537525-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 03:53:23PM -0800, matthew.gerlach@linux.intel.com wrote: > > > On Wed, 31 Jan 2024, Xu Yilun wrote: > > > On Tue, Jan 30, 2024 at 09:13:56AM -0800, matthew.gerlach@linux.intel.com wrote: > > > > > > > > > On Tue, 30 Jan 2024, Xu Yilun wrote: > > > > > > > On Wed, Jan 24, 2024 at 11:40:05AM -0800, matthew.gerlach@linux.intel.com wrote: > > > > > > > > > > > > > > > On Tue, 23 Jan 2024, Xu Yilun wrote: > > > > > > > > > > > On Mon, Jan 22, 2024 at 09:24:33AM -0800, Matthew Gerlach wrote: > > > > > > > Revision 2 of the Device Feature List (DFL) Port feature has > > > > > > > slightly different requirements than revision 1. Revision 2 > > > > > > > does not need the port to reset at driver startup. In fact, > > > > > > > > > > > > Please help illustrate what's the difference between Revision 1 & 2, and > > > > > > why revision 2 needs not. > > > > > > > > > > I will update the commit message to clarify the differences between revision > > > > > 1 and 2. > > > > > > > > > > > > > > > > > > performing a port reset during driver initialization can cause > > > > > > > driver race conditions when the port is connected to a different > > > > > > > > > > > > Please reorganize this part, in this description there seems be a > > > > > > software racing bug and the patch is a workaround. But the fact is port > > > > > > reset shouldn't been done for a new HW. > > > > > > > > > > Reorganizing the commit message a bit will help to clarify why port reset > > > > > should not be performed during driver initialization with revision 2 of the > > > > > hardware. > > > > > > > > > > > > > > > > > BTW: Is there a way to tell whether the port is connected to a different > > > > > > PF? Any guarantee that revision 3, 4 ... would need a port reset or not? > > > > > > > > > > The use of revision 2 of the port_hdr IP block indicates that the port can > > > > > be connected multiple PFs, but there is nothing explicitly stating which PFs > > > > > > > > Sorry, I mean any specific indicator other than enumerate the revision > > > > number? As you said below, checking revision number may not make further > > > > things right, then you need to amend code each time. > > > > > > Using a revision number to indicate the level of functionality for a > > > particular IP block seems to be a widely used approach. What other indicator > > > > If you still want to make the existing driver work, some capability indication > > would have more compatibility. That's more reasonable approach. Or you > > need to change existing behavior for each new revision, that's not > > actually widely used. > > I understand some capability indication would be better for compatibility > implementation. A revision number change is not as explicit or precise as > capability lists. > > > > > > of functionality level did you have in mind? > > > > I'm not trying to make the design. You tell me. > > One could use parameter blocks introduced in version 1 of the Device Feature > Header (DFH), or capability registers could be added the IP block. > In this particular case it seems the least impact to upstreamed software is > to keep the DFH and the register map unchanged, except for an incremented > revision number field. > > > > > If finally no indicator could be used, we have to use revision number. That's > > OK but make SW work harder, so I'm asking if anything could be done to > > avoid that. > > In this case, I don't think anything else can be done without bigger impacts > to the SW. Changing the existing SW is not a problem, repeat the same change every time is a problem. So if we make sure port reset is no longer needed after version 1, then this patch is OK. Otherwise, please re-evaluate. Thanks, Yilun > > > > > > > > > The revision number of an IP block would change when new functionality is > > > added to an IP block or the behavior of the IP block changes. It would be > > > expected that SW might need to change in order to use the new functionality > > > or to handle the change in behavior of the IP block. Ideally the new > > > revision of an IP block would be compatible with existing SW, but that > > > cannot be guaranteed. > > > > People make the IP block, and be compatible should be the concern if it > > want upstream support. > > Agreed, and making sure some capability mechanism exists when an IP is > created would be a great start. > > Thanks, > Matthew > > > > > Thanks, > > Yilun > > > > > > > > Thanks, > > > Matthew > > > > > > > > > > > Thanks, > > > > Yilun > > > > > > > > > the port is connected to. > > > > > > > > > > It is hard to predict the requirements and implementation of a future > > > > > revision of an IP block. If a requirement of a future revision is to work > > > > > with existing software, then the future revision would not require a port > > > > > reset at driver initialization. > > > > > > > > > > > > >