Fixed crash in direct submission dtor

Crash on an attempt to read from tag address when ring is not started

Related-to: NEO-5869

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-12-05 22:32:20 +00:00
committed by Compute-Runtime-Automation
parent 68aea5bf62
commit 88121a6f24
4 changed files with 69 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ class DirectSubmissionHw {
bool initialize(bool submitOnInit);
bool stopRingBuffer();
MOCKABLE_VIRTUAL bool stopRingBuffer();
bool startRingBuffer();
@@ -73,7 +73,7 @@ class DirectSubmissionHw {
static constexpr size_t prefetchSize = 8 * MemoryConstants::cacheLineSize;
static constexpr size_t prefetchNoops = prefetchSize / sizeof(uint32_t);
bool allocateResources();
void deallocateResources();
MOCKABLE_VIRTUAL void deallocateResources();
MOCKABLE_VIRTUAL bool makeResourcesResident(DirectSubmissionAllocations &allocations);
virtual bool allocateOsResources() = 0;
virtual bool submit(uint64_t gpuAddress, size_t size) = 0;

View File

@@ -34,7 +34,7 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
uint64_t updateTagValue() override;
void getTagAddressValue(TagData &tagData) override;
void wait(uint32_t taskCountToWait);
MOCKABLE_VIRTUAL void wait(uint32_t taskCountToWait);
TagData currentTagData;
volatile uint32_t *tagAddress;

View File

@@ -50,8 +50,10 @@ DrmDirectSubmission<GfxFamily, Dispatcher>::DrmDirectSubmission(Device &device,
template <typename GfxFamily, typename Dispatcher>
inline DrmDirectSubmission<GfxFamily, Dispatcher>::~DrmDirectSubmission() {
this->stopRingBuffer();
this->wait(static_cast<uint32_t>(this->currentTagData.tagValue));
if (this->ringStart) {
this->stopRingBuffer();
this->wait(static_cast<uint32_t>(this->currentTagData.tagValue));
}
this->deallocateResources();
}