From: Xu Yilun <yilun.xu@linux.intel.com>
To: Matthew Gerlach <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
Date: Tue, 30 Jan 2024 17:55:35 +0800 [thread overview]
Message-ID: <ZbjHl8ptQG5FdHvC@yilunxu-OptiPlex-7050> (raw)
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 <matthew.gerlach@linux.intel.com>
>
> ---
> 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
>
>
next prev parent reply other threads:[~2024-01-30 9:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 23:37 Matthew Gerlach
2024-01-30 9:55 ` Xu Yilun [this message]
2024-01-30 18:00 ` matthew.gerlach
2024-01-31 5:43 ` Xu Yilun
2024-02-01 0:26 ` matthew.gerlach
2024-02-05 2:31 ` Xu Yilun
2024-02-07 16:40 ` matthew.gerlach
2024-02-18 3:23 ` Xu Yilun
2024-02-21 1:49 ` matthew.gerlach
2024-02-21 16:14 ` Xu Yilun
2024-03-01 20:39 ` matthew.gerlach
2024-03-02 11:39 ` Xu Yilun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZbjHl8ptQG5FdHvC@yilunxu-OptiPlex-7050 \
--to=yilun.xu@linux.intel.com \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.gerlach@linux.intel.com \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®