Commit 0ff06c44 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

s390/ism: ignore some errors during deregistration

Prior to dma unmap/free operations the ism driver tries to ensure
that the memory is no longer accessed by the HW. When errors
during deregistration of memory regions from the HW occur the ism
driver will not unmap/free this memory.

When we receive notification from the hypervisor that a PCI function
has been detached we can no longer access the device and would never
unmap/free these memory regions which led to complaints by the DMA
debug API.

Treat this kind of errors during the deregistration of memory regions
from the HW as success since it is already ensured that the memory
is no longer accessed by HW.
Reported-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Reported-by: default avatarHans Wippel <hwippel@linux.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 86a86804
...@@ -141,10 +141,13 @@ static int register_ieq(struct ism_dev *ism) ...@@ -141,10 +141,13 @@ static int register_ieq(struct ism_dev *ism)
static int unregister_sba(struct ism_dev *ism) static int unregister_sba(struct ism_dev *ism)
{ {
int ret;
if (!ism->sba) if (!ism->sba)
return 0; return 0;
if (ism_cmd_simple(ism, ISM_UNREG_SBA)) ret = ism_cmd_simple(ism, ISM_UNREG_SBA);
if (ret && ret != ISM_ERROR)
return -EIO; return -EIO;
dma_free_coherent(&ism->pdev->dev, PAGE_SIZE, dma_free_coherent(&ism->pdev->dev, PAGE_SIZE,
...@@ -158,10 +161,13 @@ static int unregister_sba(struct ism_dev *ism) ...@@ -158,10 +161,13 @@ static int unregister_sba(struct ism_dev *ism)
static int unregister_ieq(struct ism_dev *ism) static int unregister_ieq(struct ism_dev *ism)
{ {
int ret;
if (!ism->ieq) if (!ism->ieq)
return 0; return 0;
if (ism_cmd_simple(ism, ISM_UNREG_IEQ)) ret = ism_cmd_simple(ism, ISM_UNREG_IEQ);
if (ret && ret != ISM_ERROR)
return -EIO; return -EIO;
dma_free_coherent(&ism->pdev->dev, PAGE_SIZE, dma_free_coherent(&ism->pdev->dev, PAGE_SIZE,
...@@ -287,7 +293,7 @@ static int ism_unregister_dmb(struct smcd_dev *smcd, struct smcd_dmb *dmb) ...@@ -287,7 +293,7 @@ static int ism_unregister_dmb(struct smcd_dev *smcd, struct smcd_dmb *dmb)
cmd.request.dmb_tok = dmb->dmb_tok; cmd.request.dmb_tok = dmb->dmb_tok;
ret = ism_cmd(ism, &cmd); ret = ism_cmd(ism, &cmd);
if (ret) if (ret && ret != ISM_ERROR)
goto out; goto out;
ism_free_dmb(ism, dmb); ism_free_dmb(ism, dmb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment