Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1025252yba; Thu, 4 Apr 2019 02:42:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwG0zqDiz3GlJPmKi4s6MrLsqIwvtGJm9eeq8z/ksTlSktfGR+Z3j4spdCnZXMQwQqFab4X X-Received: by 2002:a17:902:3183:: with SMTP id x3mr5415833plb.170.1554370928054; Thu, 04 Apr 2019 02:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370928; cv=none; d=google.com; s=arc-20160816; b=DhCEMDWdc2u8R1My3p3j4pJdH5mh6Lx8Dr+oBCqVN8fmZrYCr1E9ofia+9XTpG2A/1 TaFKKNdTudjVJmrTQLGH4di+zb7Vekjp4WwgJwHsPwBQtC6ACngjYO4a21qbT+rfIzcP ZvmTw0XgSl3oneJKZNTeR6xb70d2nF5SsYL9LZ88bEEQ3gs9SmtKdTM7FQyAiv0nmz90 0rGhA5gMVODofLdSVH1BLfClbrjCvT6OsGSAuHBPH71DA9nwFhdksMaeen6QIqvrZomm 0W5CrhZkGtNzqLGWqamU90nt8B7Oov4C+DgLsyKVzTPvvxm89W+kpSB2hkWwvF7dnlkz 9w/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zSxOuzf/ZYCsiRum5HbK0zgJ3fXJgM4RRyaJk/mwbjc=; b=eZ5lSCo/jGQ5tBMJRawjEjVBhgBvTVHEWe8XZrp6aIt/OdAhNLoFJ69RKiZKl3Uage 5uQU2exf71SLZgqXnCDGsYSYgqe0yEAH3qUngGAHKj+aDxcqFgEbomB8q+r+AAb5higY wcxZaRBu6ylwvqsqsyNiL41KCs+i5n6kk2W5IYjH9bt9Jqj3LMBP6AVrp17XqbgR2mjJ LMErVSwI9573ooN8BziM5kezzhOD0UYKLIuPaNa5a2dq7mPrW3ZCFu40VUuloscTJz7V 0cAI0Bgrqi3LD1MeeI6rqc0bL504J55URioSFZkwMYA+TILuf1jO1nnKQmOzCczAxI+E ddTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c5HFAyC1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si16194051pfa.268.2019.04.04.02.41.52; Thu, 04 Apr 2019 02:42:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c5HFAyC1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731724AbfDDJkG (ORCPT + 99 others); Thu, 4 Apr 2019 05:40:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:40638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731716AbfDDJDC (ORCPT ); Thu, 4 Apr 2019 05:03:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F28F21741; Thu, 4 Apr 2019 09:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368581; bh=bkwBtvMY+iicoZeAoJf7go1v85M5qBMtic2+dRwT2X8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5HFAyC1y5XUJPLxWGJnp14VXECtF1eHStDo3kDElg5NPbfsUCnNcEejaTp392B0K 9evrV4rOfHx0v1gbVEmnhR7PCqUbJ4gCBvCzMomFpVnSLyIjJASQSdkIrBizWnyFgV gmrbG7ljyeGeN8vdsOgl9u8fZRuNFxSCOWCD5XCk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Karsten Graul , Hans Wippel , Sebastian Ott , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.19 076/187] s390/ism: ignore some errors during deregistration Date: Thu, 4 Apr 2019 10:46:53 +0200 Message-Id: <20190404084606.621372211@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 0ff06c44efeede4acd068847d3bf8cf894b6c664 ] 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: Karsten Graul Reported-by: Hans Wippel Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- drivers/s390/net/ism_drv.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index 8684bcec8ff4..00cc96341411 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -141,10 +141,13 @@ static int register_ieq(struct ism_dev *ism) static int unregister_sba(struct ism_dev *ism) { + int ret; + if (!ism->sba) 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; dma_free_coherent(&ism->pdev->dev, PAGE_SIZE, @@ -158,10 +161,13 @@ static int unregister_sba(struct ism_dev *ism) static int unregister_ieq(struct ism_dev *ism) { + int ret; + if (!ism->ieq) 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; dma_free_coherent(&ism->pdev->dev, PAGE_SIZE, @@ -288,7 +294,7 @@ static int ism_unregister_dmb(struct smcd_dev *smcd, struct smcd_dmb *dmb) cmd.request.dmb_tok = dmb->dmb_tok; ret = ism_cmd(ism, &cmd); - if (ret) + if (ret && ret != ISM_ERROR) goto out; ism_free_dmb(ism, dmb); -- 2.19.1