Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp607203pxv; Thu, 15 Jul 2021 11:22:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD/j+kSHm1A7GnPytGpRPaoi3fk4E/SGIXXtUIPWZloiqkbsfKuWhDNRYszUkmM9Mo7BWi X-Received: by 2002:a05:6e02:2194:: with SMTP id j20mr3675245ila.108.1626373339328; Thu, 15 Jul 2021 11:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626373339; cv=none; d=google.com; s=arc-20160816; b=O8zPmAo0Y6X2xfWN/vOPvrVFqPAgz/ofrUsBr01qQZy8EVvRTwvqedLe1V+6dwMYPo tqEvsqqdFB7Y2R7W996BNr3LcPrdRXIXM0SH0IOL1pOrk9DTD85ufv/APRiLNTbdBFaX uDcgrgFUySESlwLyXBBhHZEU1UEYGiJIrv+6fmBC3y58h0fL06YD1JOYeCvY01yqtlir a/1ToPKNlHoEEjlWoEaCufS04DZj9QDmflvcQ2PR4uv6CUupg/xTmUNMB2SWZ9HnZt6L lt4YImKUQQq7DLT4PXLxSiFKWkViFniSzhfgoBaP59OFV0e/Xcjc0i/ImAj1gFlS/T0v R2Og== 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=9b2AxuIBWP2rX2JFr1XI1eezzTEXnwjOp4q66fJ74+c=; b=OgQMHTilDWnnDAZXwUkmy0DNJ+S5VdVNHXe0Dn7AHAvCoYTUXPkN2BAssaSNHYvXEJ n9+JwcFTfzJNJ2/8iyJDNr9Iclz+aXdiz+1Gz4iAUBORnM1aLSyHTi6gvIYSPcVTyOxD q+VL54r8vGiE4FbAAAHGiYKl/bflOz84qgqbQlONpyUeRBlZ9lBcxuMxaJvbr8T78NQi q0SS/iXvWf8fvFw7AI9QuRMcpovXkR3wYuQ+67o2O/hN31SXnz97pW/As3yOsAHsk0T5 AJ46xMSvr9pMEUrHkhSJnbZCTCSdV4ju52ELmVshBgqsG0VCBfVlRX50OJZ4VdgSJXAF N95A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=VCPgoVUt; 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 u3si7826165ilk.94.2021.07.15.11.22.07; Thu, 15 Jul 2021 11:22:19 -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=VCPgoVUt; 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 S235394AbhGOQt3 (ORCPT + 99 others); Thu, 15 Jul 2021 12:49:29 -0400 Received: from ale.deltatee.com ([204.191.154.188]:50110 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234128AbhGOQtH (ORCPT ); Thu, 15 Jul 2021 12:49:07 -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=9b2AxuIBWP2rX2JFr1XI1eezzTEXnwjOp4q66fJ74+c=; b=VCPgoVUtOm1WHuYxUHm4B1Cez8 mgKPoApw/BVoyttnimQ9wao0paXUXJOoWTAeKzNKD0b0O+PN9rIuu9MsL7D1WqhjVospH7QSfnqgj tTtiY2untOl16Pf7pL3yLEXYv6FxLsiAJ5ZsMsouM+77PPl6NvU9bLajRizBa52UjsZUcwOV8FZ4M 2S6UZiOc8TCY4kwYOpVtUj9vcMBY8wlOdOt0ijVuZXzMwmGJLwtdBOqLxWpKTNem65sdax/XiI4NB 43PpGNCFhqXYOTFcO5eqUIoab7HGZEhnpz9t86SRNmXYO4aEoyDeVnz1VOxnsMe9SZs6AtMd7Nu8A RQrbtdcw==; 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 1m44V0-0001yd-25; Thu, 15 Jul 2021 10:46:10 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m44Uo-0001nT-JD; Thu, 15 Jul 2021 10:45:58 -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, 15 Jul 2021 10:45:36 -0600 Message-Id: <20210715164544.6827-9-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210715164544.6827-1-logang@deltatee.com> References: <20210715164544.6827-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 v1 08/16] 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 -EINVAL. 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..3b99743435db 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 -EINVAL; sg_dma_len(sg) = sg->length; } -- 2.20.1