Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp769201pxb; Wed, 3 Feb 2021 18:07:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuSbJ75HoT2kpEArH5EjLqQUqpe4tZYNK06+1qxRSsZ6pNfIku85Av75ydmEV5B2Ka9o/E X-Received: by 2002:a17:906:388a:: with SMTP id q10mr5822236ejd.496.1612404477107; Wed, 03 Feb 2021 18:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612404477; cv=none; d=google.com; s=arc-20160816; b=z2w4AyHw8ymPE6uYVexQHawl3qX+FgUMGp4LOYjQ4kw+P7cwyGVSBQGN+98uzJy7Xp Iuxg0GHVvjP5m5PrBFqV3lBugOGTH+XDnVpimCsCQ3+wZO77dmGvXemg0djlFWMN2swo Ka+UcvI6MDaGotgdhG3t24fYiIzTZqrj/HdofsVmjwRjmtFIxr+rAOcjy+8YM/SnBrl1 dgZ05U56M7j8MaufYJfh7ICfGMgHrtq79z6iiQoGhKrl7jV58/C/pslKwslWX3+LSi3n 0ziON8mUG226OoICt+c+A5F4MSIXicvNRzIXHqTumGtpz6nXiGIBjQNMIEPWoGMLRdRi r0Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=A6ObGkyZ1kTg1MK2sRituatDJJ2jj+NhCr4nvroyzoc=; b=NiytVscuXy50Z+rQ5VtidRSd7BVxZVr3WDkp4+51V2CfI6X80cX35IaURNdZsN8A65 hHmRg9BTPn4mssx0/3OqLGtF/HYHx0lbecK3nORxnT/etRmSEb8YomleioUyxMCQkX/+ 7WFYZi8TyFg01Sr5q9b35RGgGVdrXBnTBCsagciEnbPl0fpx3DaJN4m4Ip/y1IrYTvAB GYUxaJ0BnDekvXyIUHj3gDuXcYgEtBa/6PME8vEFKsYlxvbCjw5FGQCBmPB3jqba18RT CXm3yB0D8vLpxajJA67uNaefPUN2pME9p9NNN8of5Nz7+98yY6MQy8JB/yt0UHDzEDE6 l8rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si2352082ejz.419.2021.02.03.18.07.32; Wed, 03 Feb 2021 18:07:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbhBCWoK (ORCPT + 99 others); Wed, 3 Feb 2021 17:44:10 -0500 Received: from mga02.intel.com ([134.134.136.20]:23638 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbhBCWoF (ORCPT ); Wed, 3 Feb 2021 17:44:05 -0500 IronPort-SDR: 0PiRG2fXlXiS4ZKs9tNDzCp4V3hcGhd52hwU70WRWyxKw2f0gOLKHYGkjXRvVr5HTbA5yDNAJW lFNgSDH7NftA== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="168240570" X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="168240570" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 14:43:22 -0800 IronPort-SDR: sFoMAdrNkxTVXmy/YRxe75/aIh5a4ygS21WDWlN7PWYgLnzaGHo4OFTpw74NH6aCUuMp5uVl3i k0XagAOd1PbQ== X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="396839883" Received: from rhweight-mobl2.amr.corp.intel.com (HELO [10.0.2.4]) ([10.212.187.111]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 14:43:21 -0800 Subject: Re: [PATCH v2 1/1] fpga: dfl: afu: harden port enable logic To: "Wu, Hao" , "mdf@kernel.org" , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: "trix@redhat.com" , "lgoncalv@redhat.com" , "Xu, Yilun" , "Gerlach, Matthew" References: <20200917183219.3603-1-russell.h.weight@intel.com> <8ab0e288-97f0-d167-50f0-624e05d77944@intel.com> From: Russ Weight Message-ID: <25ada056-e591-4a6d-2e0e-704b099d00bf@intel.com> Date: Wed, 3 Feb 2021 14:43:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/3/21 1:28 AM, Wu, Hao wrote: >> Subject: Re: [PATCH v2 1/1] fpga: dfl: afu: harden port enable logic >> >> Sorry for the delay on this patch. It seemed like a lower priority patch than >> others, since we haven't seen any issues with current products. Please my >> responses inline. >> >> On 9/17/20 7:08 PM, Wu, Hao wrote: >>>> -----Original Message----- >>>> From: Russ Weight >>>> Sent: Friday, September 18, 2020 2:32 AM >>>> To: mdf@kernel.org; linux-fpga@vger.kernel.org; linux- >>>> kernel@vger.kernel.org >>>> Cc: trix@redhat.com; lgoncalv@redhat.com; Xu, Yilun ; >>>> Wu, Hao ; Gerlach, Matthew >>>> ; Weight, Russell H >>>> >>>> Subject: [PATCH v2 1/1] fpga: dfl: afu: harden port enable logic >>>> >>>> Port enable is not complete until ACK = 0. Change >>>> __afu_port_enable() to guarantee that the enable process >>>> is complete by polling for ACK == 0. >>> The description of this port reset ack bit is >>> >>> " After initiating a Port soft reset, SW should monitor this bit. HW >>> will set this bit when all outstanding requests initiated by this port >>> have been drained, and the minimum soft reset pulse width has >>> elapsed. " >>> >>> But no description about what to do when clearing a Port soft reset >>> to enable the port. >>> >>> So we need to understand clearly on why we need this change >>> (e.g. what may happen without this change), and will it apply for all >>> existing DFL devices and future ones, or just for one specific card. >>> Could you please help? : ) >> I touched bases with the hardware engineers. The recommendation to wait >> for ACK to be cleared is new with OFS and is documented in the latest >> OFS specification as follows (see step #4): >> >>> 3.7.1 AFU Soft Resets >>> Software may cause a soft reset to be issued to the AFU as follows: >>> 1. Assert the PortSoftReset field of the PORT_CONTROL register >>> 2. Wait for the Port to acknowledge the soft reset by monitoring the >>> PortSoftResetAck field of the PORT_CONTROL register, i.e. >> PortSoftResetAck=1 >>> 3. Deasserting the PortSoftReset field >>> 4. Wait for the Port to acknowledge the soft reset de-assertion by monitoring >> the >>> PortSoftResetAck field of the PORT_CONTROL register, i.e. >> PortSoftResetAck=0 >>> This sequence ensures that outstanding transactions are suitably flushed and >>> that the FIM minimum reset pulse width is respected. Failing to follow this >>> sequence leaves the AFU in an undefined state. >> The OFS specification has not been posted publicly, yet. >> >> Also, this is how it was explained to me: >> >>> In most scenario, port will be able to get out of reset soon enough >>> when SW releases the port reset, especially on all the PAC products >>> which have been verified before release. >>> >>> Polling for HW to clear the ACK is meant to handle the following scenarios: >>> >>> * Different platform can take variable period of time to get out of reset >>> * Bug in the HW that hold the port in reset >> So this change is not required for the currently released PAC cards, >> but it is needed for OFS based products. I don't think there is any reason >> to hold off on the patch, as it is still valid for current products. > As you know, this driver is used for different cards, and we need to make > sure new changes introduced in new version spec, don't break old products > as we are sharing the same driver. and we are not sure if in the future some > new products but still uses old specs, and then things may be broken if the > driver which always perform new flow. Another method is that introduce 1 > bit in hardware register to tell the driver to perform the additional steps, > then it can avoid impacts to the old products. If this can't be done, then > we at least need to verify this change on all existing hardware and suggest > users to follow new spec only. According to the HW engineers, the RTL implementation has not changed; it is the same as the RTL in the current PAC products. Polling for HW to clear the ACK is something we could have (should have?) been doing all along. The timing hasn't been an issue for the current PAC products, as proven by our testing. However, with OFS we cannot anticipate what the timing will be for customer designed products, so the specification is calling out this requirement as a precaution. I am using a development machine that has the older PAC devices installed. I cleared port errors on these cards as a quick check, and the reset completes without hanging - which indicates that the ACK bit is in fact getting cleared. So there is not need for any device-specific conditional statements here. - Russ > > Hao