From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E43FCC43216 for ; Thu, 29 Jul 2021 20:16:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBB4660231 for ; Thu, 29 Jul 2021 20:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233151AbhG2UQI (ORCPT ); Thu, 29 Jul 2021 16:16:08 -0400 Received: from ale.deltatee.com ([204.191.154.188]:59102 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbhG2UP5 (ORCPT ); Thu, 29 Jul 2021 16:15:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:Message-Id:Date:Cc:To:From :references:content-disposition:in-reply-to; bh=7rAmHnoYgxgYjh3HpXE3zIryStVPnDAXEkL4Vf4StFI=; b=L5MNdXu2RkyJTJf1U2kRvC9rdG Fi2zQ1Jo3u1ckG/sUDTfnnmRyNWyUMZVsCZU5ucjiSE8C7rbOZzmh1mIa+nIyi3p3yQ8QIqp8/8xs cM2jhkuv4pfRuvlROkJ6z1cv/rfzQGi+rw77mVN27FJvbTmHpYWyID7OpgY0TpEjoXxQB12zUEd2r qyL1Zv3YKYpHBX2i1FpWwa4P7p3I9m48iblFE7zjLA4rM23n63DmfJ4gAgeBygMx7BL4dr76mc0ma v5/O9IEdo/7kZsErHJx4AGKvqOqjGEMEdx65oFZOavjAfDwmsYJuN/6fgpzQ96CduuqfEm7ibrvmU gsRgMH7A==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9CRW-0008VK-N8; Thu, 29 Jul 2021 14:15:48 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m9CRT-0001TQ-GA; Thu, 29 Jul 2021 14:15:43 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Stephen Bates , Martin Oliveira , Logan Gunthorpe Date: Thu, 29 Jul 2021 14:15:18 -0600 Message-Id: <20210729201539.5602-1-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, sbates@raithlin.com, martin.oliveira@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v3 00/21] .map_sg() error cleanup X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Hi, This v3 of the series is spun out and expanded from my work to add P2PDMA support to DMA map operations[1]. v2 is at [2]. The main changes in v1 are to more carefully define the meaning of the error codes for dma_map_sgtable(). The P2PDMA work requires distinguishing different error conditions in a map_sg operation. dma_map_sgtable() already allows for returning an error code (where as dma_map_sg() is only allowed to return zero) however, it currently only returns -EINVAL when a .map_sg() call returns zero. This series cleans up all .map_sg() implementations to return appropriate error codes. After the cleanup, dma_map_sg() will still return zero, however dma_map_sgtable() will pass the error code from the .map_sg() call. Thanks go to Martn Oliveira for doing a lot of the cleanup of the obscure implementations. The patch set is based off of v5.14-rc2 and a git repo can be found here: https://github.com/sbates130272/linux-p2pmem map_sg_err_cleanup_v2 Thanks, Logan [1] https://lore.kernel.org/linux-block/20210513223203.5542-1-logang@deltatee.com/ [2] https://lore.kernel.org/linux-mips/20210723175008.22410-1-logang@deltatee.com/ -- Changes in v3: - Move the validation of errnos into __dma_map_sg_attrs() (Per Christoph) - Fix the out of date commit message in patch 21 (Per Eike) Changes in v2: - Attempt to define the meanings of the errors returned by dma_map_sgtable() and restrict the valid return codes of .map_sg implementations. (Per Christoph) - Change dma_map_sgtable() to EXPORT_SYMBOL_GPL() (Per Christoph) - Add patches to remove the erroneous setting of sg->dma_address to DMA_MAP_ERROR in a few .map_sg(0 implementations. (Per Christoph). -- Logan Gunthorpe (10): dma-mapping: Allow map_sg() ops to return negative error codes dma-direct: Return appropriate error code from dma_direct_map_sg() iommu: Return full error code from iommu_map_sg[_atomic]() dma-iommu: Return error code from iommu_dma_map_sg() ARM/dma-mapping: don't set failed sg dma_address to DMA_MAPPING_ERROR powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR dma-mapping: Disallow .map_sg operations from returning zero on error Martin Oliveira (11): alpha: return error code from alpha_pci_map_sg() ARM/dma-mapping: return error code from .map_sg() ops ia64/sba_iommu: return error code from sba_map_sg_attrs() MIPS/jazzdma: return error code from jazz_dma_map_sg() powerpc/iommu: return error code from .map_sg() ops s390/pci: return error code from s390_dma_map_sg() sparc/iommu: return error codes from .map_sg() ops parisc: return error code from .map_sg() ops xen: swiotlb: return error code from xen_swiotlb_map_sg() x86/amd_gart: return error code from gart_map_sg() dma-mapping: return error code from dma_dummy_map_sg() arch/alpha/kernel/pci_iommu.c | 10 ++- arch/arm/mm/dma-mapping.c | 26 +++++--- arch/ia64/hp/common/sba_iommu.c | 6 +- arch/mips/jazz/jazzdma.c | 2 +- arch/powerpc/kernel/iommu.c | 6 +- arch/powerpc/platforms/ps3/system-bus.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 5 +- arch/s390/pci/pci_dma.c | 13 ++-- arch/sparc/kernel/iommu.c | 6 +- arch/sparc/kernel/pci_sun4v.c | 6 +- arch/sparc/mm/iommu.c | 2 +- arch/x86/kernel/amd_gart_64.c | 18 +++--- drivers/iommu/dma-iommu.c | 23 ++++--- drivers/iommu/iommu.c | 15 +++-- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- include/linux/dma-map-ops.h | 5 +- include/linux/dma-mapping.h | 35 +++-------- include/linux/iommu.h | 22 +++---- kernel/dma/direct.c | 2 +- kernel/dma/dummy.c | 2 +- kernel/dma/mapping.c | 82 ++++++++++++++++++++++--- 23 files changed, 177 insertions(+), 117 deletions(-) base-commit: ff1176468d368232b684f75e82563369208bc371 -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 350B0C4338F for ; Thu, 29 Jul 2021 20:19:12 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8B6A60F48 for ; Thu, 29 Jul 2021 20:19:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B8B6A60F48 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=deltatee.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GbMLk3Q8mz3cYW for ; Fri, 30 Jul 2021 06:19:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=deltatee.com header.i=@deltatee.com header.a=rsa-sha256 header.s=20200525 header.b=L5MNdXu2; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=deltatee.com (client-ip=204.191.154.188; helo=ale.deltatee.com; envelope-from=gunthorp@deltatee.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=deltatee.com header.i=@deltatee.com header.a=rsa-sha256 header.s=20200525 header.b=L5MNdXu2; dkim-atps=neutral Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GbMGy75pPz3cHQ for ; Fri, 30 Jul 2021 06:15:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:Message-Id:Date:Cc:To:From :references:content-disposition:in-reply-to; bh=7rAmHnoYgxgYjh3HpXE3zIryStVPnDAXEkL4Vf4StFI=; b=L5MNdXu2RkyJTJf1U2kRvC9rdG Fi2zQ1Jo3u1ckG/sUDTfnnmRyNWyUMZVsCZU5ucjiSE8C7rbOZzmh1mIa+nIyi3p3yQ8QIqp8/8xs cM2jhkuv4pfRuvlROkJ6z1cv/rfzQGi+rw77mVN27FJvbTmHpYWyID7OpgY0TpEjoXxQB12zUEd2r qyL1Zv3YKYpHBX2i1FpWwa4P7p3I9m48iblFE7zjLA4rM23n63DmfJ4gAgeBygMx7BL4dr76mc0ma v5/O9IEdo/7kZsErHJx4AGKvqOqjGEMEdx65oFZOavjAfDwmsYJuN/6fgpzQ96CduuqfEm7ibrvmU gsRgMH7A==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9CRW-0008VK-N8; Thu, 29 Jul 2021 14:15:48 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m9CRT-0001TQ-GA; Thu, 29 Jul 2021 14:15:43 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org Date: Thu, 29 Jul 2021 14:15:18 -0600 Message-Id: <20210729201539.5602-1-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, sbates@raithlin.com, martin.oliveira@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v3 00/21] .map_sg() error cleanup X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robin Murphy , Martin Oliveira , Stephen Bates , Logan Gunthorpe , Christoph Hellwig , Marek Szyprowski Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi, This v3 of the series is spun out and expanded from my work to add P2PDMA support to DMA map operations[1]. v2 is at [2]. The main changes in v1 are to more carefully define the meaning of the error codes for dma_map_sgtable(). The P2PDMA work requires distinguishing different error conditions in a map_sg operation. dma_map_sgtable() already allows for returning an error code (where as dma_map_sg() is only allowed to return zero) however, it currently only returns -EINVAL when a .map_sg() call returns zero. This series cleans up all .map_sg() implementations to return appropriate error codes. After the cleanup, dma_map_sg() will still return zero, however dma_map_sgtable() will pass the error code from the .map_sg() call. Thanks go to Martn Oliveira for doing a lot of the cleanup of the obscure implementations. The patch set is based off of v5.14-rc2 and a git repo can be found here: https://github.com/sbates130272/linux-p2pmem map_sg_err_cleanup_v2 Thanks, Logan [1] https://lore.kernel.org/linux-block/20210513223203.5542-1-logang@deltatee.com/ [2] https://lore.kernel.org/linux-mips/20210723175008.22410-1-logang@deltatee.com/ -- Changes in v3: - Move the validation of errnos into __dma_map_sg_attrs() (Per Christoph) - Fix the out of date commit message in patch 21 (Per Eike) Changes in v2: - Attempt to define the meanings of the errors returned by dma_map_sgtable() and restrict the valid return codes of .map_sg implementations. (Per Christoph) - Change dma_map_sgtable() to EXPORT_SYMBOL_GPL() (Per Christoph) - Add patches to remove the erroneous setting of sg->dma_address to DMA_MAP_ERROR in a few .map_sg(0 implementations. (Per Christoph). -- Logan Gunthorpe (10): dma-mapping: Allow map_sg() ops to return negative error codes dma-direct: Return appropriate error code from dma_direct_map_sg() iommu: Return full error code from iommu_map_sg[_atomic]() dma-iommu: Return error code from iommu_dma_map_sg() ARM/dma-mapping: don't set failed sg dma_address to DMA_MAPPING_ERROR powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR dma-mapping: Disallow .map_sg operations from returning zero on error Martin Oliveira (11): alpha: return error code from alpha_pci_map_sg() ARM/dma-mapping: return error code from .map_sg() ops ia64/sba_iommu: return error code from sba_map_sg_attrs() MIPS/jazzdma: return error code from jazz_dma_map_sg() powerpc/iommu: return error code from .map_sg() ops s390/pci: return error code from s390_dma_map_sg() sparc/iommu: return error codes from .map_sg() ops parisc: return error code from .map_sg() ops xen: swiotlb: return error code from xen_swiotlb_map_sg() x86/amd_gart: return error code from gart_map_sg() dma-mapping: return error code from dma_dummy_map_sg() arch/alpha/kernel/pci_iommu.c | 10 ++- arch/arm/mm/dma-mapping.c | 26 +++++--- arch/ia64/hp/common/sba_iommu.c | 6 +- arch/mips/jazz/jazzdma.c | 2 +- arch/powerpc/kernel/iommu.c | 6 +- arch/powerpc/platforms/ps3/system-bus.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 5 +- arch/s390/pci/pci_dma.c | 13 ++-- arch/sparc/kernel/iommu.c | 6 +- arch/sparc/kernel/pci_sun4v.c | 6 +- arch/sparc/mm/iommu.c | 2 +- arch/x86/kernel/amd_gart_64.c | 18 +++--- drivers/iommu/dma-iommu.c | 23 ++++--- drivers/iommu/iommu.c | 15 +++-- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- include/linux/dma-map-ops.h | 5 +- include/linux/dma-mapping.h | 35 +++-------- include/linux/iommu.h | 22 +++---- kernel/dma/direct.c | 2 +- kernel/dma/dummy.c | 2 +- kernel/dma/mapping.c | 82 ++++++++++++++++++++++--- 23 files changed, 177 insertions(+), 117 deletions(-) base-commit: ff1176468d368232b684f75e82563369208bc371 -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD28AC4320A for ; Thu, 29 Jul 2021 20:16:01 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F83F60F48 for ; Thu, 29 Jul 2021 20:16:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F83F60F48 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=deltatee.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 801F84068E; Thu, 29 Jul 2021 20:16:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dEoAItNLnL_m; Thu, 29 Jul 2021 20:16:00 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2E1E540681; Thu, 29 Jul 2021 20:16:00 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0B461C001A; Thu, 29 Jul 2021 20:16:00 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 53168C0024 for ; Thu, 29 Jul 2021 20:15:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B8B9940490 for ; Thu, 29 Jul 2021 20:15:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=deltatee.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y4a1Nus0ruOV for ; Thu, 29 Jul 2021 20:15:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by smtp2.osuosl.org (Postfix) with ESMTPS id B49B44015B for ; Thu, 29 Jul 2021 20:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:Message-Id:Date:Cc:To:From :references:content-disposition:in-reply-to; bh=7rAmHnoYgxgYjh3HpXE3zIryStVPnDAXEkL4Vf4StFI=; b=L5MNdXu2RkyJTJf1U2kRvC9rdG Fi2zQ1Jo3u1ckG/sUDTfnnmRyNWyUMZVsCZU5ucjiSE8C7rbOZzmh1mIa+nIyi3p3yQ8QIqp8/8xs cM2jhkuv4pfRuvlROkJ6z1cv/rfzQGi+rw77mVN27FJvbTmHpYWyID7OpgY0TpEjoXxQB12zUEd2r qyL1Zv3YKYpHBX2i1FpWwa4P7p3I9m48iblFE7zjLA4rM23n63DmfJ4gAgeBygMx7BL4dr76mc0ma v5/O9IEdo/7kZsErHJx4AGKvqOqjGEMEdx65oFZOavjAfDwmsYJuN/6fgpzQ96CduuqfEm7ibrvmU gsRgMH7A==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9CRW-0008VK-N8; Thu, 29 Jul 2021 14:15:48 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m9CRT-0001TQ-GA; Thu, 29 Jul 2021 14:15:43 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org Date: Thu, 29 Jul 2021 14:15:18 -0600 Message-Id: <20210729201539.5602-1-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, sbates@raithlin.com, martin.oliveira@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v3 00/21] .map_sg() error cleanup X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Cc: Robin Murphy , Martin Oliveira , Stephen Bates , Logan Gunthorpe , Christoph Hellwig X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi, This v3 of the series is spun out and expanded from my work to add P2PDMA support to DMA map operations[1]. v2 is at [2]. The main changes in v1 are to more carefully define the meaning of the error codes for dma_map_sgtable(). The P2PDMA work requires distinguishing different error conditions in a map_sg operation. dma_map_sgtable() already allows for returning an error code (where as dma_map_sg() is only allowed to return zero) however, it currently only returns -EINVAL when a .map_sg() call returns zero. This series cleans up all .map_sg() implementations to return appropriate error codes. After the cleanup, dma_map_sg() will still return zero, however dma_map_sgtable() will pass the error code from the .map_sg() call. Thanks go to Martn Oliveira for doing a lot of the cleanup of the obscure implementations. The patch set is based off of v5.14-rc2 and a git repo can be found here: https://github.com/sbates130272/linux-p2pmem map_sg_err_cleanup_v2 Thanks, Logan [1] https://lore.kernel.org/linux-block/20210513223203.5542-1-logang@deltatee.com/ [2] https://lore.kernel.org/linux-mips/20210723175008.22410-1-logang@deltatee.com/ -- Changes in v3: - Move the validation of errnos into __dma_map_sg_attrs() (Per Christoph) - Fix the out of date commit message in patch 21 (Per Eike) Changes in v2: - Attempt to define the meanings of the errors returned by dma_map_sgtable() and restrict the valid return codes of .map_sg implementations. (Per Christoph) - Change dma_map_sgtable() to EXPORT_SYMBOL_GPL() (Per Christoph) - Add patches to remove the erroneous setting of sg->dma_address to DMA_MAP_ERROR in a few .map_sg(0 implementations. (Per Christoph). -- Logan Gunthorpe (10): dma-mapping: Allow map_sg() ops to return negative error codes dma-direct: Return appropriate error code from dma_direct_map_sg() iommu: Return full error code from iommu_map_sg[_atomic]() dma-iommu: Return error code from iommu_dma_map_sg() ARM/dma-mapping: don't set failed sg dma_address to DMA_MAPPING_ERROR powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR dma-mapping: Disallow .map_sg operations from returning zero on error Martin Oliveira (11): alpha: return error code from alpha_pci_map_sg() ARM/dma-mapping: return error code from .map_sg() ops ia64/sba_iommu: return error code from sba_map_sg_attrs() MIPS/jazzdma: return error code from jazz_dma_map_sg() powerpc/iommu: return error code from .map_sg() ops s390/pci: return error code from s390_dma_map_sg() sparc/iommu: return error codes from .map_sg() ops parisc: return error code from .map_sg() ops xen: swiotlb: return error code from xen_swiotlb_map_sg() x86/amd_gart: return error code from gart_map_sg() dma-mapping: return error code from dma_dummy_map_sg() arch/alpha/kernel/pci_iommu.c | 10 ++- arch/arm/mm/dma-mapping.c | 26 +++++--- arch/ia64/hp/common/sba_iommu.c | 6 +- arch/mips/jazz/jazzdma.c | 2 +- arch/powerpc/kernel/iommu.c | 6 +- arch/powerpc/platforms/ps3/system-bus.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 5 +- arch/s390/pci/pci_dma.c | 13 ++-- arch/sparc/kernel/iommu.c | 6 +- arch/sparc/kernel/pci_sun4v.c | 6 +- arch/sparc/mm/iommu.c | 2 +- arch/x86/kernel/amd_gart_64.c | 18 +++--- drivers/iommu/dma-iommu.c | 23 ++++--- drivers/iommu/iommu.c | 15 +++-- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- include/linux/dma-map-ops.h | 5 +- include/linux/dma-mapping.h | 35 +++-------- include/linux/iommu.h | 22 +++---- kernel/dma/direct.c | 2 +- kernel/dma/dummy.c | 2 +- kernel/dma/mapping.c | 82 ++++++++++++++++++++++--- 23 files changed, 177 insertions(+), 117 deletions(-) base-commit: ff1176468d368232b684f75e82563369208bc371 -- 2.20.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97660C4338F for ; Thu, 29 Jul 2021 20:19:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6298B60F48 for ; Thu, 29 Jul 2021 20:19:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6298B60F48 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=deltatee.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=g9JwnsdEQyUriCD6YoH8ty9k3GMf3vCJEzIvdW+ZiT0=; b=zgaZmTd9cw0RuN +FESlwVQO1YMdq6Obwh6LosXd+nqMp43b9ZrQoak3IaLrbmmSUnKFOPzjQJpszrjfU5LzYwdwLeZC SM3H8v7YkPLtbn7HekeAu1qwtgRfjwuJyguqRneMtW+8HSCUWccRCssFKlSKqt/e5/a/4FegI3W9U D1gDLhrnJBHXVWdYJkgF/o2fDHTMot+DsWrcTBC3GV9XyHAcdxnegygYT7LysG02xNBO5glV9YHL4 Ql2zbi8vNorSHqXzcU6Qduyi25pWD9M1f/gxakkNCZKZ0JPyRzE+KVkJ6LGhO5tP++GnQEGcS2W2d qSkUBkOjW/dJQGc+UL3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9CTg-005qAP-Od; Thu, 29 Jul 2021 20:18:01 +0000 Received: from ale.deltatee.com ([204.191.154.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9CRZ-005pAb-Dm for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 20:15:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:Message-Id:Date:Cc:To:From :references:content-disposition:in-reply-to; bh=7rAmHnoYgxgYjh3HpXE3zIryStVPnDAXEkL4Vf4StFI=; b=L5MNdXu2RkyJTJf1U2kRvC9rdG Fi2zQ1Jo3u1ckG/sUDTfnnmRyNWyUMZVsCZU5ucjiSE8C7rbOZzmh1mIa+nIyi3p3yQ8QIqp8/8xs cM2jhkuv4pfRuvlROkJ6z1cv/rfzQGi+rw77mVN27FJvbTmHpYWyID7OpgY0TpEjoXxQB12zUEd2r qyL1Zv3YKYpHBX2i1FpWwa4P7p3I9m48iblFE7zjLA4rM23n63DmfJ4gAgeBygMx7BL4dr76mc0ma v5/O9IEdo/7kZsErHJx4AGKvqOqjGEMEdx65oFZOavjAfDwmsYJuN/6fgpzQ96CduuqfEm7ibrvmU gsRgMH7A==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9CRW-0008VK-N8; Thu, 29 Jul 2021 14:15:48 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m9CRT-0001TQ-GA; Thu, 29 Jul 2021 14:15:43 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Stephen Bates , Martin Oliveira , Logan Gunthorpe Date: Thu, 29 Jul 2021 14:15:18 -0600 Message-Id: <20210729201539.5602-1-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, sbates@raithlin.com, martin.oliveira@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v3 00/21] .map_sg() error cleanup X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_131549_609051_FFA2681A X-CRM114-Status: GOOD ( 15.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This v3 of the series is spun out and expanded from my work to add P2PDMA support to DMA map operations[1]. v2 is at [2]. The main changes in v1 are to more carefully define the meaning of the error codes for dma_map_sgtable(). The P2PDMA work requires distinguishing different error conditions in a map_sg operation. dma_map_sgtable() already allows for returning an error code (where as dma_map_sg() is only allowed to return zero) however, it currently only returns -EINVAL when a .map_sg() call returns zero. This series cleans up all .map_sg() implementations to return appropriate error codes. After the cleanup, dma_map_sg() will still return zero, however dma_map_sgtable() will pass the error code from the .map_sg() call. Thanks go to Martn Oliveira for doing a lot of the cleanup of the obscure implementations. The patch set is based off of v5.14-rc2 and a git repo can be found here: https://github.com/sbates130272/linux-p2pmem map_sg_err_cleanup_v2 Thanks, Logan [1] https://lore.kernel.org/linux-block/20210513223203.5542-1-logang@deltatee.com/ [2] https://lore.kernel.org/linux-mips/20210723175008.22410-1-logang@deltatee.com/ -- Changes in v3: - Move the validation of errnos into __dma_map_sg_attrs() (Per Christoph) - Fix the out of date commit message in patch 21 (Per Eike) Changes in v2: - Attempt to define the meanings of the errors returned by dma_map_sgtable() and restrict the valid return codes of .map_sg implementations. (Per Christoph) - Change dma_map_sgtable() to EXPORT_SYMBOL_GPL() (Per Christoph) - Add patches to remove the erroneous setting of sg->dma_address to DMA_MAP_ERROR in a few .map_sg(0 implementations. (Per Christoph). -- Logan Gunthorpe (10): dma-mapping: Allow map_sg() ops to return negative error codes dma-direct: Return appropriate error code from dma_direct_map_sg() iommu: Return full error code from iommu_map_sg[_atomic]() dma-iommu: Return error code from iommu_dma_map_sg() ARM/dma-mapping: don't set failed sg dma_address to DMA_MAPPING_ERROR powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR dma-mapping: Disallow .map_sg operations from returning zero on error Martin Oliveira (11): alpha: return error code from alpha_pci_map_sg() ARM/dma-mapping: return error code from .map_sg() ops ia64/sba_iommu: return error code from sba_map_sg_attrs() MIPS/jazzdma: return error code from jazz_dma_map_sg() powerpc/iommu: return error code from .map_sg() ops s390/pci: return error code from s390_dma_map_sg() sparc/iommu: return error codes from .map_sg() ops parisc: return error code from .map_sg() ops xen: swiotlb: return error code from xen_swiotlb_map_sg() x86/amd_gart: return error code from gart_map_sg() dma-mapping: return error code from dma_dummy_map_sg() arch/alpha/kernel/pci_iommu.c | 10 ++- arch/arm/mm/dma-mapping.c | 26 +++++--- arch/ia64/hp/common/sba_iommu.c | 6 +- arch/mips/jazz/jazzdma.c | 2 +- arch/powerpc/kernel/iommu.c | 6 +- arch/powerpc/platforms/ps3/system-bus.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 5 +- arch/s390/pci/pci_dma.c | 13 ++-- arch/sparc/kernel/iommu.c | 6 +- arch/sparc/kernel/pci_sun4v.c | 6 +- arch/sparc/mm/iommu.c | 2 +- arch/x86/kernel/amd_gart_64.c | 18 +++--- drivers/iommu/dma-iommu.c | 23 ++++--- drivers/iommu/iommu.c | 15 +++-- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- include/linux/dma-map-ops.h | 5 +- include/linux/dma-mapping.h | 35 +++-------- include/linux/iommu.h | 22 +++---- kernel/dma/direct.c | 2 +- kernel/dma/dummy.c | 2 +- kernel/dma/mapping.c | 82 ++++++++++++++++++++++--- 23 files changed, 177 insertions(+), 117 deletions(-) base-commit: ff1176468d368232b684f75e82563369208bc371 -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Logan Gunthorpe Date: Thu, 29 Jul 2021 20:15:18 +0000 Subject: [PATCH v3 00/21] .map_sg() error cleanup Message-Id: <20210729201539.5602-1-logang@deltatee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Stephen Bates , Martin Oliveira , Logan Gunthorpe Hi, This v3 of the series is spun out and expanded from my work to add P2PDMA support to DMA map operations[1]. v2 is at [2]. The main changes in v1 are to more carefully define the meaning of the error codes for dma_map_sgtable(). The P2PDMA work requires distinguishing different error conditions in a map_sg operation. dma_map_sgtable() already allows for returning an error code (where as dma_map_sg() is only allowed to return zero) however, it currently only returns -EINVAL when a .map_sg() call returns zero. This series cleans up all .map_sg() implementations to return appropriate error codes. After the cleanup, dma_map_sg() will still return zero, however dma_map_sgtable() will pass the error code from the .map_sg() call. Thanks go to Martn Oliveira for doing a lot of the cleanup of the obscure implementations. The patch set is based off of v5.14-rc2 and a git repo can be found here: https://github.com/sbates130272/linux-p2pmem map_sg_err_cleanup_v2 Thanks, Logan [1] https://lore.kernel.org/linux-block/20210513223203.5542-1-logang@deltatee.com/ [2] https://lore.kernel.org/linux-mips/20210723175008.22410-1-logang@deltatee.com/ -- Changes in v3: - Move the validation of errnos into __dma_map_sg_attrs() (Per Christoph) - Fix the out of date commit message in patch 21 (Per Eike) Changes in v2: - Attempt to define the meanings of the errors returned by dma_map_sgtable() and restrict the valid return codes of .map_sg implementations. (Per Christoph) - Change dma_map_sgtable() to EXPORT_SYMBOL_GPL() (Per Christoph) - Add patches to remove the erroneous setting of sg->dma_address to DMA_MAP_ERROR in a few .map_sg(0 implementations. (Per Christoph). -- Logan Gunthorpe (10): dma-mapping: Allow map_sg() ops to return negative error codes dma-direct: Return appropriate error code from dma_direct_map_sg() iommu: Return full error code from iommu_map_sg[_atomic]() dma-iommu: Return error code from iommu_dma_map_sg() ARM/dma-mapping: don't set failed sg dma_address to DMA_MAPPING_ERROR powerpc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR s390/pci: don't set failed sg dma_address to DMA_MAPPING_ERROR sparc/iommu: don't set failed sg dma_address to DMA_MAPPING_ERROR x86/amd_gart: don't set failed sg dma_address to DMA_MAPPING_ERROR dma-mapping: Disallow .map_sg operations from returning zero on error Martin Oliveira (11): alpha: return error code from alpha_pci_map_sg() ARM/dma-mapping: return error code from .map_sg() ops ia64/sba_iommu: return error code from sba_map_sg_attrs() MIPS/jazzdma: return error code from jazz_dma_map_sg() powerpc/iommu: return error code from .map_sg() ops s390/pci: return error code from s390_dma_map_sg() sparc/iommu: return error codes from .map_sg() ops parisc: return error code from .map_sg() ops xen: swiotlb: return error code from xen_swiotlb_map_sg() x86/amd_gart: return error code from gart_map_sg() dma-mapping: return error code from dma_dummy_map_sg() arch/alpha/kernel/pci_iommu.c | 10 ++- arch/arm/mm/dma-mapping.c | 26 +++++--- arch/ia64/hp/common/sba_iommu.c | 6 +- arch/mips/jazz/jazzdma.c | 2 +- arch/powerpc/kernel/iommu.c | 6 +- arch/powerpc/platforms/ps3/system-bus.c | 2 +- arch/powerpc/platforms/pseries/vio.c | 5 +- arch/s390/pci/pci_dma.c | 13 ++-- arch/sparc/kernel/iommu.c | 6 +- arch/sparc/kernel/pci_sun4v.c | 6 +- arch/sparc/mm/iommu.c | 2 +- arch/x86/kernel/amd_gart_64.c | 18 +++--- drivers/iommu/dma-iommu.c | 23 ++++--- drivers/iommu/iommu.c | 15 +++-- drivers/parisc/ccio-dma.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- include/linux/dma-map-ops.h | 5 +- include/linux/dma-mapping.h | 35 +++-------- include/linux/iommu.h | 22 +++---- kernel/dma/direct.c | 2 +- kernel/dma/dummy.c | 2 +- kernel/dma/mapping.c | 82 ++++++++++++++++++++++--- 23 files changed, 177 insertions(+), 117 deletions(-) base-commit: ff1176468d368232b684f75e82563369208bc371 -- 2.20.1