From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Ofir Bitton <obitton@habana.ai>
Subject: [PATCH 5/5] habanalabs: give FW a grace time for configuring iATU
Date: Wed, 28 Apr 2021 14:33:23 +0300 [thread overview]
Message-ID: <20210428113323.17222-5-ogabbay@kernel.org> (raw)
In-Reply-To: <20210428113323.17222-1-ogabbay@kernel.org>
From: Ofir Bitton <obitton@habana.ai>
iATU (internal Address Translation Unit of the PCI controller)
configuration is being done by FW right after driver enables
the PCI device. Hence, driver must add a minor sleep afterwards
in order to make sure FW finishes configuring iATU regions.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
drivers/misc/habanalabs/common/pci/pci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/misc/habanalabs/common/pci/pci.c b/drivers/misc/habanalabs/common/pci/pci.c
index 9ef6c46a3146..8e7982be6191 100644
--- a/drivers/misc/habanalabs/common/pci/pci.c
+++ b/drivers/misc/habanalabs/common/pci/pci.c
@@ -430,6 +430,10 @@ int hl_pci_init(struct hl_device *hdev)
goto unmap_pci_bars;
}
+ /* Driver must sleep in order for FW to finish the iATU configuration */
+ if (hdev->asic_prop.iatu_done_by_fw)
+ usleep_range(2000, 3000);
+
return 0;
unmap_pci_bars:
--
2.25.1
prev parent reply other threads:[~2021-04-28 11:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 11:33 [PATCH 1/5] habanalabs: use common fw_version read Oded Gabbay
2021-04-28 11:33 ` [PATCH 2/5] habanalabs: dynamic fw load reset protocol Oded Gabbay
2021-04-28 11:33 ` [PATCH 3/5] habanalabs: expose ASIC specific PCI info to common code Oded Gabbay
2021-04-28 11:33 ` [PATCH 4/5] habanalabs: update to latest f/w headers Oded Gabbay
2021-04-28 11:33 ` Oded Gabbay [this message]
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=20210428113323.17222-5-ogabbay@kernel.org \
--to=ogabbay@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=obitton@habana.ai \
/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