提交 2a189488 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

Revert "iommu/arm-smmu-v3: Abort all transactions if SMMU is enabled in kdump kernel"

euler inclusion
category: bugfix
bugzilla: 5452
CVE: NA

This patchset is add a kernel parameter to avoid kdump
problem on Hi1620ES. It will be revert when we have better
solution on Hi1620CS.

[PATCH 1/4] Revert "iommu/arm-smmu-v3: Abort all transactions if SMMU is enabled in kdump kernel"
[PATCH 2/4] device: add device_shutdown_one() helper
[PATCH 3/4] device: add device_shutdown_by_driver() helper
[PATCH 4/4] kexec: add kexec_device_shutdown()

------------------------------------------------

This reverts commit b63b3439.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e192e87c
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/acpi_iort.h> #include <linux/acpi_iort.h>
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/crash_dump.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/dma-iommu.h> #include <linux/dma-iommu.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -2244,12 +2243,8 @@ static int arm_smmu_update_gbpa(struct arm_smmu_device *smmu, u32 set, u32 clr) ...@@ -2244,12 +2243,8 @@ static int arm_smmu_update_gbpa(struct arm_smmu_device *smmu, u32 set, u32 clr)
reg &= ~clr; reg &= ~clr;
reg |= set; reg |= set;
writel_relaxed(reg | GBPA_UPDATE, gbpa); writel_relaxed(reg | GBPA_UPDATE, gbpa);
ret = readl_relaxed_poll_timeout(gbpa, reg, !(reg & GBPA_UPDATE), return readl_relaxed_poll_timeout(gbpa, reg, !(reg & GBPA_UPDATE),
1, ARM_SMMU_POLL_TIMEOUT_US); 1, ARM_SMMU_POLL_TIMEOUT_US);
if (ret)
dev_err(smmu->dev, "GBPA not responding to update\n");
return ret;
} }
static void arm_smmu_free_msis(void *data) static void arm_smmu_free_msis(void *data)
...@@ -2429,15 +2424,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) ...@@ -2429,15 +2424,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
/* Clear CR0 and sync (disables SMMU and queue processing) */ /* Clear CR0 and sync (disables SMMU and queue processing) */
reg = readl_relaxed(smmu->base + ARM_SMMU_CR0); reg = readl_relaxed(smmu->base + ARM_SMMU_CR0);
if (reg & CR0_SMMUEN) { if (reg & CR0_SMMUEN)
if (is_kdump_kernel()) {
arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
arm_smmu_device_disable(smmu);
return -EBUSY;
}
dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n"); dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n");
}
ret = arm_smmu_device_disable(smmu); ret = arm_smmu_device_disable(smmu);
if (ret) if (ret)
...@@ -2535,8 +2523,10 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass) ...@@ -2535,8 +2523,10 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
enables |= CR0_SMMUEN; enables |= CR0_SMMUEN;
} else { } else {
ret = arm_smmu_update_gbpa(smmu, 0, GBPA_ABORT); ret = arm_smmu_update_gbpa(smmu, 0, GBPA_ABORT);
if (ret) if (ret) {
dev_err(smmu->dev, "GBPA not responding to update\n");
return ret; return ret;
}
} }
ret = arm_smmu_write_reg_sync(smmu, enables, ARM_SMMU_CR0, ret = arm_smmu_write_reg_sync(smmu, enables, ARM_SMMU_CR0,
ARM_SMMU_CR0ACK); ARM_SMMU_CR0ACK);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册