Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp971536rdb; Tue, 30 Jan 2024 04:27:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdvG3eDiGeGkMXcS0/GgI8nZ7UzedXLGy6KljqwpyuDPndtZN1t2r1Gup1u/oaZw0/CpUn X-Received: by 2002:a62:e706:0:b0:6db:ad5c:80b8 with SMTP id s6-20020a62e706000000b006dbad5c80b8mr6314764pfh.7.1706617667605; Tue, 30 Jan 2024 04:27:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706617667; cv=pass; d=google.com; s=arc-20160816; b=ntJwjGzwGGlBUP0I3iEKhlQQW85E4iy5dGmULPe7+F5V/ZmFLus/qb+8SY5KSodMrh PdsKhdC2l8kMgU2fviz5rX6gsOLWdIiJpFJ+p0thWBE2E6iLZoqp8KmR6nVtgfFeJ6Jf LMGGF7gjeG+mu9qYAdWu4oHYrz8w55r/vdpo8QF/kvPt7Mruh5EHerdm3FOaAwTuXQnm IK2uUjSNH+gWdqxYW/0SIocfY1FPMJkNQW5DxeHRduFWKVNnRPA8acHzJAerG8bILXnv fEkVlvOFSsCGTdiZsVg72J3qiXnxAQvCm5U5v/T2qI8o6nQa1SsJgZuOPjnenfH9LXaP uEGw== 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=CaFBqdRlhUniBL8gUGIS7/8DUcKqf9iXmJ/5scyN6fk=; fh=VhJBtzCdArrpNd6S2a4Zu5LjEdFK7+Moum3LMpywWqM=; b=KYbGEF9qNFMCmZ/vN2O17j6u7jVxbSisZfHjAHSItRHYz8Ag8bqp233TZs3afg4Y8r 9rSgwxPNSrzypxAgRRqfcBit7B+/wOT/oBT4n06KiQpfKssmDyCeqZGMRMl8jf4+D6rE HHEpAKAmK6TyWoPZu5Bavmp+tyHaZHhSP4sgYWuXjTL6Wch1ycwuCwlNwuRMQnLwBsNo GgZwWKegHN5S6LzKCdSbWL8w36vbPT4qDwQdA/wqMMyc8HXoiCI9V8m//NRS2Qw7iM0t +JSY+uq+utw9BTfzxKc/KDnxc476qeCc1UHaIEP+tjzv7EI1jmCOrsj6smti6rV2/PHs 7+UA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ge9fH80I; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44337-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44337-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n24-20020a056a000d5800b006d9906df4ccsi7312302pfv.162.2024.01.30.04.27.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:27:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44337-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ge9fH80I; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44337-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44337-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 A55DC28CFBD for ; Tue, 30 Jan 2024 10:02:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3CD667E69; Tue, 30 Jan 2024 09:59:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ge9fH80I" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 5D9EE67A04; Tue, 30 Jan 2024 09:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608746; cv=none; b=VkjdOwuEanzc/M1FeL9qj65fKE5ylNqdH4+irtAmCVywH45jhVHBJq9CMYA8p5R3gXL3USoB17jcv0ID73k5gIO3AQlIoraTefiofaxmUzbDisgqqzORDQWmNy9N1H3sMAg5LPirAZuBtcU3wcJSrX0BLegxChqmeyLNFdJrFWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608746; c=relaxed/simple; bh=NLufhWI/HuTT3DCLkEBOo/5dp1Sv2l5FbL/NzMCPhxI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FXE7zBLikr4Lc/1+FX4goAHBMrvnju+yM5oJWQ4fDc289anacWFvISaXYMETjQo8OG9YbH1CSqxzYvoEb341xzpxPAXJZNeVdBk9epU1VgBie5K1AsHStkeSJrBbqM8+B3V0FrRAbUGCNP7xlWq/AVWCGCvh9Cu+kDhbr3T/Vfs= 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=Ge9fH80I; arc=none smtp.client-ip=198.175.65.13 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=1706608745; x=1738144745; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=NLufhWI/HuTT3DCLkEBOo/5dp1Sv2l5FbL/NzMCPhxI=; b=Ge9fH80IP7rIRmkxnW0+PgeJdc1mG/0nlJkTHVvhUGDBL/iSnJ3nd87V Hpc/h+kifprX8UtM2+HA8P6u6IltPUC8tUeqiEmyAWv5O4+K2ZDloRWFj rA/vdlyF1wMeHT2nc++EG91c8lN2k3trq/IDnnwIOnYaSYLCYtlkx6LON gmDWG8YSKop+OnfjwwgsBG1zK4Hjed7qtiR5klpDg0AuhZ/DwzzGP/S2d sX6Q7U/injysfCWs+7D5nbFdAjB1Lk/7KOBOZ6f76HQdZc2R3Wd9uA6vq FcxH2Yt2Ya70DglWECmBxrRiGrHQL7bwn7XFtOSYETiShnkt6v9XYcrX0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10968"; a="10334359" X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="10334359" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 01:59:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10968"; a="737720407" X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="737720407" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orsmga003.jf.intel.com with ESMTP; 30 Jan 2024 01:59:00 -0800 Date: Tue, 30 Jan 2024 17:55:35 +0800 From: Xu Yilun To: Matthew Gerlach 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: <20240125233715.861883-1-matthew.gerlach@linux.intel.com> 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(). Thanks, Yilun > transaction layer packet (TLP) transactions and invalid data > being returned. > > Signed-off-by: Matthew Gerlach > > --- > v2: > - Update commit message for clarity > - Remove potentially confusing dev_info message. > --- > drivers/fpga/dfl-afu-main.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c > index c0a75ca360d6..42fe27660ab7 100644 > --- a/drivers/fpga/dfl-afu-main.c > +++ b/drivers/fpga/dfl-afu-main.c > @@ -417,7 +417,15 @@ static const struct attribute_group port_hdr_group = { > static int port_hdr_init(struct platform_device *pdev, > struct dfl_feature *feature) > { > - port_reset(pdev); > + void __iomem *base; > + u8 rev; > + > + base = dfl_get_feature_ioaddr_by_id(&pdev->dev, PORT_FEATURE_ID_HEADER); > + > + rev = dfl_feature_revision(base); > + > + if (rev < 2) > + port_reset(pdev); > > return 0; > } > -- > 2.34.1 > >