Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2709094rdb; Mon, 5 Feb 2024 15:31:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEi2A64+7e8brqt/9heMMLbkGt1CwMP1q3x/nWuqDKv6rtVehY3GfwiHM1jG61SslFMpRQ2 X-Received: by 2002:a54:4714:0:b0:3bf:dda2:c8b8 with SMTP id k20-20020a544714000000b003bfdda2c8b8mr1184407oik.28.1707175876333; Mon, 05 Feb 2024 15:31:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707175876; cv=pass; d=google.com; s=arc-20160816; b=Wc90ge8EPBLvVXxOmRwS/f0V36Gr2w6gxCMrND8t3KZXVtG8HobcFSMtd192C4DRVJ Peyqkfc9IdWVSsD27AC852kwWW4eeFWChkUqf2x7vcX5xdHLTC07vW+yF6RikqMQrzMn LqBcV+pb/76f84fROoSVVqk554Kpowo77e6UafGCMilKeKC7n9JdOBrFLW5xzdQZfkzd Io6hs1/63JrlY8wSaUD8zNdr4BZu5F24bQYdB5JjMXvxa5m9qLPiqXvxhBBPhOYVdSAH jeIWlfry3tkzr/OvMh654LrzHBu6Zxh6ClacsYZGIvbixFsRDB96BjTSSi/iVAmZBk9U P1lw== 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 :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=WQBd1xuRRRnknKmll7t9RXLJ1dOgqggPqjzvppeV88k=; fh=CrrrwrCvXnDYLpq9cpqPrvjGW6iIiMrRnAfP3XR7x9w=; b=mEaLWuO8SWc4J9bOTljEAMqcH+W0xpDR+rUU+8C5o+aRQ9AzYoT9caFmgoxsPzwir4 D/ZsPy3w7WvROpo1ugJktpAHNroFQJxmRNgfcmhRHmTrlkxcUGzv0fCAnzRDNzPt8fbd QXBG7YoWuQa9hRO3WRkKqoo6IkXiRtAKxgkeowjx6xM7LzJHKIDNBjNT3b/Cpf8gYoo1 s5SNxDHFjrT7PIYDRRMhRrScG4Rml0qYuN3+tj23vLhcXpyZu7HcEPwXdzY5jkonWh5U 4HVhyabCGB15bzmVssWyB36IR4bwh9UQSvVOl+XmWu0ocm4tX8I2WYd+JBSPgur4vivx CBKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WtP491pU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-54086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54086-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; AJvYcCW/uDaBdaB1+Y+GOd+SiuWcHE+2vbnm3wN3D15lnpesFQis1KQwIs69lpvvAfs7KaflArvBEVcZwMxkqUsHmsSaf2gBxdNmIYxQh/dOAA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v8-20020a05620a122800b0078341830e2esi955068qkj.337.2024.02.05.15.31.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 15:31:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54086-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=WtP491pU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-54086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54086-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 0B4DD1C237A3 for ; Mon, 5 Feb 2024 23:31:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF9FF495D6; Mon, 5 Feb 2024 23:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WtP491pU" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 E683A1EF1D; Mon, 5 Feb 2024 23:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707175868; cv=none; b=tzOLciUWcK3HyOvfnTmFK1j+MJrwfpa4Xqj44TFzOoTTeMV33bwNOXNWawO7HgdT2XnHkth5jgVADJJT0LaUYBFdQMXOVNC8bF4xZmoywigO5PF1oM01oa04/ipYH24IOp0TLHh/uGcyjyUUG1baEYOl4naMDaWXsJrouwsig18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707175868; c=relaxed/simple; bh=JKQq0v2G4CXuGavU90HKWmX/FivxnNgkRXeV39/RDl0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=qcHWdu0icf3CVlJgLh9xY3ZQPuOLSfEm8pJo0ArwIXaKOsrI2DsgCw8K0xaXz1RfnP9pVcDFW+DQtiCpM5h21p6IBiQWG32C68Tm7sfpG6tnw6YqgIBMfD+yIR+NrCJJk9Cd+KDfNjrmaiZWV7JuftvjZQDQDjMaF4aEhsAnJAM= 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=WtP491pU; arc=none smtp.client-ip=192.198.163.8 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=1707175867; x=1738711867; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=JKQq0v2G4CXuGavU90HKWmX/FivxnNgkRXeV39/RDl0=; b=WtP491pUyblL1cbLJWW+oCY82Es1jlgWl8rV22SI2l9VXM1HC9sRes0V tUhoGFVcYb7YWgKYcAZnqFBC7Ts88E6PpeAIKvxtJlz97gH/hXlOEHTEF AaFqU8OEWaPUi9Oj8kbVrhEatcDGS4llNT3gCTaQBcRp3NwMT+oMV4gHR 5GS6bPzVwAzv3lMEXBwkX+ey5o+h1C13mjYm8fS0JE3MxuJ0ZVCa0xde+ bjyXP6eVR0CAB1pb3ozT9gx18iwVzt2zzyvdTfXFfrDesLtvj9r/8TSZL Q0SY+LBAnHOa3p0Q/by7PQpQZQNuXxF8DLxZ8wQVOMuMdcZ52X+HGj0Lu g==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="18153696" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="18153696" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 15:31:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="909432355" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="909432355" Received: from sj-4150-psse-sw-opae-dev2.sj.intel.com ([10.233.115.162]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 15:31:06 -0800 Date: Mon, 5 Feb 2024 15:30:55 -0800 (PST) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@sj-4150-psse-sw-opae-dev2 To: Xu Yilun 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 In-Reply-To: Message-ID: References: <20240122172433.537525-1-matthew.gerlach@linux.intel.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) 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; format=flowed On Mon, 5 Feb 2024, Xu Yilun wrote: > 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. The initial port reset will no longer be after version 1. The requirement for the initial state of the logic in side the port to be valid will remain. Thanks, Matthew > > 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. >>>>>> >>>>> >>> >>> >