From nobody Wed Mar 30 07:11:15 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A6F8D1A3FB7C; Wed, 30 Mar 2022 07:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KSyJz4L38z4hCQ; Wed, 30 Mar 2022 07:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648624275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9Hu6XQjQATnqDLlFMKGa1H+HRQCtUUHH+YLeu+MuH0=; b=WhLhgNv+cPmCPUGg4qSTz245aCtPQ4KghHTLBArvjMqxgEWxFGvshehrQyETpIzFY+DkkY prKCynV9cn0E8V2OFgPaKVdLPCgRftkUPs/jmFs/h5nLMMsPapgcsXjHKJZdCTFZkyJ9GA 3YI89IsUdgZ7x0q2OQTDR4NWig2yqTkP6aYkWcKHppieAht6lHt8moTVfj8sl5QfsMWgi3 80l4ZAJHZkja/ANVYhSXgb8Eat9064XCNpZNkGTaB5hUbiuJMXYOJ4nrPPat/JPde/e77N l4P4Slv+ZN4afCG9RCxg8iGxkIaLCCE7RPDCMDrhWYVEQeuvfxgVUed9LTV7xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7505C674A; Wed, 30 Mar 2022 07:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22U7BFKt025183; Wed, 30 Mar 2022 07:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22U7BFIB025182; Wed, 30 Mar 2022 07:11:15 GMT (envelope-from git) Date: Wed, 30 Mar 2022 07:11:15 GMT Message-Id: <202203300711.22U7BFIB025182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: 5473dee73005 - main - Hyper-V: vPCI: Write back original BAR values after prepopulating bars List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5473dee7300507de64c2e6c140b87c9bde8e4462 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648624275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9Hu6XQjQATnqDLlFMKGa1H+HRQCtUUHH+YLeu+MuH0=; b=irMsUnPGsvRqI7V6cAHOHvQMMgoki5CI1wSWNe2EIx74pZ6zN8x8wds5fQ2VuqdD7rhcWq GXvoWMgXXia1z4kWsUtVDG2oyq4g6rYI07WXHmeCbLG72Apvyzmsrv4SdVdMe2D5gdKmoi 3b8QKoi/gANyFtaPnqFUEHbkbqQuMniA9bK8YdbK194fYvAYvPyQnGSzhcLmelmH8mNRYw 6lx8W4azfYWxdNM8qQK4lAxqHw+Eq7yIpD6Sq8qUWdm7HPKODUfwyFrXlXkWL7LQzg+ZGY bJBpFCcE6y8rNEKpGxzIf0jsMfdjnNBTvycPi2Et/kXH6aqzArdQ9tVI+OaKxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648624275; a=rsa-sha256; cv=none; b=HIRbVGgULQ2hXjSCJCTwazw/gb+vVsO3r1zVUEEATUYpXpXIbBfMAjPJDpCx+toiEc1nfb aA7wOxNhWr4kGDGOKV/QcNMLv+EFxMREtoFEhWGGMyUblqIB+T2nmL4IkmNdAFFIFF7TKI WTL1iW7+9yKUfDmkEKuR+v8G79B8gvVu7UrU6N8wgSusXEzRG/aU6qjb9Tpx1vYmACAIfe wiZTDLPFCQE0H1FMtsh+obLptnZwAfswSUYwL7VKBYFaDrCiDL/f9P1+DwS3UAFhtFem9+ MLfjBCOBO0M+UoktQiAIMkLFghKRdcZilqSzr65caF1Xw39HSntvAWcenM7yJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=5473dee7300507de64c2e6c140b87c9bde8e4462 commit 5473dee7300507de64c2e6c140b87c9bde8e4462 Author: Wei Hu AuthorDate: 2022-03-30 06:56:09 +0000 Commit: Wei Hu CommitDate: 2022-03-30 06:56:09 +0000 Hyper-V: vPCI: Write back original BAR values after prepopulating bars In vmbus_pcib_prepopulate_bars(), after writing all 1's to the avialable device bars, those without being configured by device driver are also set to its initialized values. However, this could cause weird problem which results to device failure. The issue has been reported to happen on LSI 9211-8i HBA card for DDA access on Hyper-V. Writing back the orignal BAR values seem to work around this problem. Reported by: Alexander Motin Tested by: Mathias Kraut Fixes: 75412a521f6 Hyper-V: vPCI: Prepopulate device bars MFC after: 1 month --- sys/dev/hyperv/pcib/vmbus_pcib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index fd2b732267f0..81b05a6da055 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -1391,6 +1391,10 @@ vmbus_pcib_prepopulate_bars(struct hv_pcibus *hbus) _hv_pcifront_write_config(hpdev, PCIR_BAR(i), 4, 0xffffffff); + + /* Now write the original value back */ + _hv_pcifront_write_config(hpdev, PCIR_BAR(i), + 4, bar_val); } } }