Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6385442pxv; Thu, 29 Jul 2021 13:17:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuIXA3+K/nU66EF99SC90vBEWVB6SJHW18v6IR06OFSh3yTFOmmUoNY4Nieku7If/rhRgt X-Received: by 2002:a05:6e02:b4b:: with SMTP id f11mr4935498ilu.130.1627589852934; Thu, 29 Jul 2021 13:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627589852; cv=none; d=google.com; s=arc-20160816; b=fkq7Kih3DdjTANU+W7CFij949eA35KDX1F7n27i5bkVrZ36bjvngkcfiGW3q17SDzx fcw0Mf2uJvp5yamY5Rp/HRzUKRHvdkxKhWRaIqVeRpnN3qbn/0GWVlUXKi3gBt8dgY2Y YkhpsERKdhp8yFK/NX4+MguycrV4x26c+Em4s1YCS91DPPkdD/86rvEEpfRhR96ArLac IyigG1Gzmqog/jrwnmu264aaekbt4EkEQQNPSxj/z97j+p6MILvgsB5J6TdY9bYoqMLC g5foxks517pkLY8/1N5XWeCoYxiUAadtXOgxswl/zOTNJE6QstwD927626kT8Ai9PcVI eFgg== 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=pjSijkDDmu3vPdSgTQKQdclfdyX/CqsmmRRmSWCrGaw=; b=jyQesSGSGDynldxmBjdEsWBnVQFvawmfZ4OmiP664ok/W6GY5jw6F5HbAES+l0B6YF 87HKGYl+gSAdK1khUuQK0iCvJNyFXaJ1ECoa/sY3ubp1fFeVYdeNdTt+t8jWAzJwzC5S fP0MnI1bCce9X77zJQN5ZKbcqb+WkLDTWfK8s+CBZdi1P8IA1UMouVeLxK7ERwznF7Uf eYBaooCsp6UeqvMU2JWPKToPci+HDT6L6eFmk1dRQPpJbuqSgD6IAgB6sxIIPS7qIBzi 0wXVxkKD0OFLWCNlSkdHL0VsTIYXIiaOkT0AAZuEqoGlH7gf+100j2fMKhRlJOdGqJtn 4Ftw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b="cjgxYy/V"; 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 k2si4260976jao.12.2021.07.29.13.17.21; Thu, 29 Jul 2021 13:17:32 -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="cjgxYy/V"; 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 S234510AbhG2UQm (ORCPT + 99 others); Thu, 29 Jul 2021 16:16:42 -0400 Received: from ale.deltatee.com ([204.191.154.188]:59320 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232996AbhG2UQE (ORCPT ); Thu, 29 Jul 2021 16:16:04 -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=pjSijkDDmu3vPdSgTQKQdclfdyX/CqsmmRRmSWCrGaw=; b=cjgxYy/V4mokMS26RvA0y5hAiA e5AuokLjTiEWPZ1wtZmzEF2/AjYWGVTq7UuSoyz33iWz4wFh6JWY3+gaqjxN/uaYzWgDN90NJbk6S jGNNEV37c2AtpkXo8os38qhGWUEL9DmdLjrM+jhEyJZuL/hWdHyWmAa1nyx5jjPZPvvnfteOU8nvT SFzkV/q/iTjtcmPXkWw9wI3RF0d51GVXBwR5owV0qIhLmjvIGYZoMsAZsfBuH66LL1M6DbJv8aMpa aVNco/kwUkGc2RR9/C8e2SVixYS9FCaqVsXHs+VNiAfyClEYBPIi4fLYwbWEh0Hg9lvB1O4V/L1R9 tDqSO1xg==; 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 1m9CRh-0008VN-EY; Thu, 29 Jul 2021 14:15:58 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m9CRU-0001Tq-Lp; Thu, 29 Jul 2021 14:15:44 -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 , Thomas Bogendoerfer Date: Thu, 29 Jul 2021 14:15:27 -0600 Message-Id: <20210729201539.5602-10-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, tsbogend@alpha.franken.de 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 09/21] MIPS/jazzdma: return error code from jazz_dma_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 From: Martin Oliveira The .map_sg() op now expects an error code instead of zero on failure. vdma_alloc() may fail for different reasons, but since it only supports indicating an error via a return of DMA_MAPPING_ERROR, we coalesce the different reasons into -EIO as is documented on dma_map_sgtable(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Thomas Bogendoerfer --- arch/mips/jazz/jazzdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c index 461457b28982..eabddb89d221 100644 --- a/arch/mips/jazz/jazzdma.c +++ b/arch/mips/jazz/jazzdma.c @@ -552,7 +552,7 @@ static int jazz_dma_map_sg(struct device *dev, struct scatterlist *sglist, dir); sg->dma_address = vdma_alloc(sg_phys(sg), sg->length); if (sg->dma_address == DMA_MAPPING_ERROR) - return 0; + return -EIO; sg_dma_len(sg) = sg->length; } -- 2.20.1