Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1425795imu; Wed, 28 Nov 2018 09:21:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ww885ARLrpSfEcTGzVh91NHi1Ji7+ydwIWCc/dce64PhgwwQ+fLqQjlm/mQ9mu357PRRsX X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr4511039plo.316.1543425663815; Wed, 28 Nov 2018 09:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543425663; cv=none; d=google.com; s=arc-20160816; b=ny0v+SElqvWtIuTi0dwhd202ROsaMqW/e0jEMS5fGZO/GUgFyeOKQ31kck4iTTlYtX YxOIq273kMNc+w7H4wwkkR9dHsX0WBiOHfbwnGyG+znciO7AVstZb0hyl0maFfYTkbmK 8DW28X3OtnfTwZ8+vYHqAf4UrUMeKx8iyO3MHc4q0PbRGP+n6k04qPLJaBPC3ql1Tgf/ lmHMLgokXLNT0CZR2BKSGwVzrrh95ogMaeogJ2iFBW0AVFeuUV2y5AXP1oaWxPKjhOk7 INNXCaasy9uwSVu72pPbS0qfeqIW8CKqeyylIB5PfDIcS7Umzl66a09RsTKI4JIiP0q7 ECbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uSzNDlwgei09HfpJCFDGn/O7447JujbkPrzCU+KEiVM=; b=udeXaa2sBAZuNBoSPZsMBjs01Py7dcwzcLoWQskQgKqJuoWZFNNVPOivli8PyC7A3z XqkMmotrGlZJCi03zCZsJ4ccKNari8ge/eWYcO4PpLZKzEqrfPDXsJzpqWnU4634EDui /c1wdaMdDe6E5but/rClI/yn1ppMfvtfC9WQZWotOlh6uqJhiKxDa2jafEg8R+M+uD4f 0/mHmgcGjMoaLmDnluuox+WUxc6jNAupRM+kGxPGB//Plofivh0+6ZNw3fyNW9ganocj LoYG9dCy2GAwgt3lPl3s6xOKJwpexR3yR+s+ZM8gWxPqHrTDb8o1LjSpT04jai4n9DyP 4PaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UyQb4EpW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s191si9532969pfs.53.2018.11.28.09.20.30; Wed, 28 Nov 2018 09:21:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UyQb4EpW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729165AbeK2Dty (ORCPT + 99 others); Wed, 28 Nov 2018 22:49:54 -0500 Received: from mail-lf1-f45.google.com ([209.85.167.45]:34291 "EHLO mail-lf1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729081AbeK2Dtx (ORCPT ); Wed, 28 Nov 2018 22:49:53 -0500 Received: by mail-lf1-f45.google.com with SMTP id p6so19884108lfc.1 for ; Wed, 28 Nov 2018 08:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uSzNDlwgei09HfpJCFDGn/O7447JujbkPrzCU+KEiVM=; b=UyQb4EpWJEMhQTOivOsPMBNN13w/1ra0hJ9h74ryiKp1EQ6lZ3j4wVg+hLCy7r++OX ZMh+qRF5hkB8XZKwct1uSBLtSPIaxHOogoRFEnJGpAMM2zrQhcAuPfy21jIgw4Eodgx+ ofdNJSAQxS3EBGFeL12NesFaW2MPyvXcO4BRQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uSzNDlwgei09HfpJCFDGn/O7447JujbkPrzCU+KEiVM=; b=Htfbree226dr2YWBIoLpPO5V67BPP0KDYwrvHcuw7/VhB/w2JWDMgo9rLqkE8Pw4hD I/b6sopFwsjf194/FZGHom+m05+rS+0yjDHf1SqWAMIO9IKpu6uh5Cvsm3JGV8yAKpO9 TI8JFiqYPkJYzZn3lFOLLlnt1/IIoc+vApJxNXzdBMbp0Uw1GGL7haTQUy46fdo2i/b0 k+aaT++onVXOwIhe7yIRU1mV3qNfHia906vE2aP9Xvi28it9cg/3H0Ra6YagyXkbt8lO 8u36u9knKdF0j49NlDJQ+NNzbtARWP2L6VtQASZ/+1fmdf9nUXzLOOhxVuDE3ahrW5WT FYsg== X-Gm-Message-State: AGRZ1gKt/KanWzsshqrO+kkLmAWNQSU0uevAdF5dak6zliuLkqGScNH2 fRpPhjENilL5R536aSgQqRjWQcRLQQk= X-Received: by 2002:a19:5402:: with SMTP id i2mr21447219lfb.128.1543423655341; Wed, 28 Nov 2018 08:47:35 -0800 (PST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id t9-v6sm1219157ljj.87.2018.11.28.08.47.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 08:47:33 -0800 (PST) Received: by mail-lj1-f171.google.com with SMTP id u6-v6so24052031ljd.1 for ; Wed, 28 Nov 2018 08:47:33 -0800 (PST) X-Received: by 2002:a2e:994:: with SMTP id 142-v6mr21021065ljj.120.1543423641179; Wed, 28 Nov 2018 08:47:21 -0800 (PST) MIME-Version: 1.0 References: <20181122140320.24080-1-hch@lst.de> <20181122170715.GI30658@n2100.armlinux.org.uk> <11829e3c-7302-f821-cf5c-863e5267a17b@arm.com> <20181123065511.GA17856@lst.de> <20181128074117.GA21126@lst.de> In-Reply-To: <20181128074117.GA21126@lst.de> From: Linus Torvalds Date: Wed, 28 Nov 2018 08:47:05 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: remove the ->mapping_error method from dma_map_ops V2 To: Christoph Hellwig Cc: linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, David Woodhouse , "the arch/x86 maintainers" , linux@armlinux.org.uk, Linux List Kernel Mailing , iommu@lists.linux-foundation.org, linux-alpha@vger.kernel.org, xen-devel@lists.xenproject.org, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 11:41 PM Christoph Hellwig wrote: > > On Fri, Nov 23, 2018 at 07:55:11AM +0100, Christoph Hellwig wrote: > > Well, I can tweak the last patch to return -EINVAL from dma_mapping_error > > instead of the old 1 is as bool true. The callers should all be fine, > > although I'd have to audit them. Still wouldn't help with being able to > > return different errors. > > Any opinions? I'd really like to make some forward progress on this > series. So I do think that yes, dma_mapping_error() should return an error code, not 0/1. But I was really hoping that the individual drivers themselves could return error codes. Right now the patch-series has code like this: ret = needs_bounce(dev, dma_addr, size); if (ret < 0) - return ARM_MAPPING_ERROR; + return DMA_MAPPING_ERROR; which while it all makes sense in the context of this patch-series, I *really* think it would have been so much nicer to return the error code 'ret' instead (which in this case is -E2BIG). I don't think this is a huge deal, but ERR_PTR() has been hugely successful elsewhere. And I'm not hugely convinced about all these "any address can be valid" arguments. How the hell do you generate a random dma address in the last page that isn't even page-aligned? Linus