Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1038410pxv; Thu, 15 Jul 2021 23:36:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjNyKD5zgp+fwCsUGY1pZS2RrtO7oru0t3MGBaX91GWJxLrUs4r8fXW8lbRk5hb6EImIRs X-Received: by 2002:aa7:d1c4:: with SMTP id g4mr12440530edp.382.1626417399499; Thu, 15 Jul 2021 23:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626417399; cv=none; d=google.com; s=arc-20160816; b=qwcRfnsXW9R3xjFg0xSgHPeVBKJssjk4iAXes32Zhbl5zzdH2FTIBLuNPSV0EMdDWA lKNhC8L14M7UVIiD8AuEIDzXwFhv+1hiDXmcOmhNBgNrMlkeJKJX64EC/HybonONhbzH LHK1f7tnCoWxlVHzJg7PXKQNHfvjqvGuTw6KP8ydN+r1TzIbzCuQcZ8gEr6L/aSvNHk+ jG2jhIuEM/fX5qRFdwrrcZHiVh4UhELU2OzuUBwwEYJTRwBOgbJR3QT7W+GgfTVe6GG8 KY964PYJbG/fXtKPCc40wwkYGNE+Z6BWPtfBaSJyuyK0UuuLH3oXo7r5Dm51PQvjm3le NgEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4HDGVLwxEP9v5JS7upIEkHzBCWBy4TpIaYRXaHBrsqI=; b=Ov0ZDRFa7wKBRxgmemmS3/pDYh95b+D3ovSbbrS1skYuBBG6REMtQUmak2IYn5OOB0 bE4bbCeNVZp/6b3NpodUUHEJWGgwNO6wsbGdEgPSWyBI7q0IZBV6BMCyODYHtZB0MBkI U/wRrF97XboIyP3yYHNxEnrFs80Frxuwr7V7HVWdh2XQRlTBkL/dHM3hog/EHTsnKBO3 dc28VzvXDNxsuQvr1AjpJiPkop1nBjarp04X+M0h2V35sAXGlOOmsxzsdyQCWaRnu1Ol TImQdGlfq0Ty+aztGnDKOBIq1L6shTKmR2G3BDX0XtI0Xzt1HYgcOtqoJrk3MrjF8mA7 0OUg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id em21si10134897ejc.10.2021.07.15.23.36.15; Thu, 15 Jul 2021 23:36:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235410AbhGPGfs (ORCPT + 99 others); Fri, 16 Jul 2021 02:35:48 -0400 Received: from verein.lst.de ([213.95.11.211]:41968 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235273AbhGPGfl (ORCPT ); Fri, 16 Jul 2021 02:35:41 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2BDE767373; Fri, 16 Jul 2021 08:32:42 +0200 (CEST) Date: Fri, 16 Jul 2021 08:32:41 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: 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, Christoph Hellwig , Marek Szyprowski , Robin Murphy , Stephen Bates , Martin Oliveira , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Niklas Schnelle , Thomas Bogendoerfer , Michael Ellerman Subject: Re: [PATCH v1 14/16] x86/amd_gart: return error code from gart_map_sg() Message-ID: <20210716063241.GC13345@lst.de> References: <20210715164544.6827-1-logang@deltatee.com> <20210715164544.6827-15-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715164544.6827-15-logang@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 10:45:42AM -0600, Logan Gunthorpe wrote: > @@ -458,7 +460,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, > iommu_full(dev, pages << PAGE_SHIFT, dir); > for_each_sg(sg, s, nents, i) > s->dma_address = DMA_MAPPING_ERROR; > - return 0; > + return ret; While we're at it - setting the ->dma_address to DMA_MAPPING_ERROR is not part of the ->map_sg calling convention. Might be worth to fix up while we're at it.