Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6385215pxv; Thu, 29 Jul 2021 13:17:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwApGEIJ+xRGJ0lzot0gIxfhfT5YYD561JK2OINUNP7yAwv2YKKhDR65KLngi8YjA0ubjj4 X-Received: by 2002:a92:d0d2:: with SMTP id y18mr4997073ila.24.1627589828142; Thu, 29 Jul 2021 13:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627589828; cv=none; d=google.com; s=arc-20160816; b=WvbHBecuFxYCHZs3x4c4/7seoN6hC1E2vQaADuOfMUT1p5Wwa9JvQ9rLXmL/IDnpFX yazqTZ/FdZxeTTcnV8WJyMNHxoSpFohPj5KvAr5EwVOEiH/drmQ28Z2P+RqJGSQoiSFM iJwnyGSkr1epuueYO/ToaO7TdxlC54wpTyPkgssU89n4nC6SR+pAcHUu1VxzZ+4TsFTm wcE4qHH6QVzhCzQE7Km7ZJHDfn2bM84P+s4tfbKuVdm2NbtGV9PUEUYCgaSd4C1qQBnV Vf8XPGDw24XC0uqOBpMuSWGex9DbAH9LhDdw4qS5cq8Kjdnulqc3zWXFU5MoLFc8iEch 8+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=BqE/2wCCjH4FvfGKjQ09Cv01+9Px9vk9cMsrkFQoCn0=; b=LogRTZrBLUMYwulqby6cYWBPVqN8ynnXe7J5UvopQc+XT8GCeDZeKsICPaO9DR4kqu BL+grp1czwjxuIPC+r6ECeitwPMVSylqXVPHpsOSR8W2X1xOTvLkX9MrSugmyyQzB5IK akttZ2jBUMetktbzXMW90IDZYDcaeUbd2g5zDY48YtFVN5cs6nW1h0jhY3P3K7Q7uDZK Ep+zHU21mMrszIYeSYfUcM73pm/QfzHruO0LQr1XmYVhmf84lo9H7rQpradsh8Kk++a0 kt4xLoWYLswmvqqxlXt+OsM7TFISMqo8HHdjckVXLZf3tLiooIUFZpZbURXEKZhtAMs/ ZfBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=UKIatoBm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si2968667ilc.143.2021.07.29.13.16.53; Thu, 29 Jul 2021 13:17:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=UKIatoBm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbhG2UQE (ORCPT + 99 others); Thu, 29 Jul 2021 16:16:04 -0400 Received: from ale.deltatee.com ([204.191.154.188]:59090 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbhG2UP5 (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:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=BqE/2wCCjH4FvfGKjQ09Cv01+9Px9vk9cMsrkFQoCn0=; b=UKIatoBmrCpSphyHjiY30+Y1OG CY9raw8PJFoIaw2b6o5szEv3xbVs91s3wNGAYZu8i4P6a660NOAY/g6x8HspQTJyFrjhq0lPulGcF v07xfdnRxyYUor5/nHo8jyHPSdyBF+7HKkOQgh/ObDv6lrzlYMt+Cl5pMBs1tdIjqeBtInWDeMcpS UKmA3BGqOsrwUqFs0m5PnSIDkvdxIcJSuq9ljO6Bp/jBY/y/yUpAZ2IgJluFfQdhe12F5LWJdUNr3 z4nBLGUTT9E7d+rhQBcQmWwdw6NZNHqHJSKtvZtcLRxrCzCo9CF/mQQmviIJVR6T6a10Vsb35ajum EtSXlZWg==; 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-0008VM-N8; Thu, 29 Jul 2021 14:15:47 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m9CRT-0001TV-PR; 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:20 -0600 Message-Id: <20210729201539.5602-3-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210729201539.5602-1-logang@deltatee.com> References: <20210729201539.5602-1-logang@deltatee.com> 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 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH v3 02/21] dma-direct: Return appropriate error code from dma_direct_map_sg() 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-kernel@vger.kernel.org Now that the map_sg() op expects error codes instead of return zero on error, convert dma_direct_map_sg() to return an error code. Per the documentation for dma_map_sgtable(), -EIO is returned due to an DMA_MAPPING_ERROR with unknown cause. Signed-off-by: Logan Gunthorpe --- kernel/dma/direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index f737e3347059..f33ceb68aef2 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -411,7 +411,7 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents, out_unmap: dma_direct_unmap_sg(dev, sgl, i, dir, attrs | DMA_ATTR_SKIP_CPU_SYNC); - return 0; + return -EIO; } dma_addr_t dma_direct_map_resource(struct device *dev, phys_addr_t paddr, -- 2.20.1