Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3166950imu; Fri, 23 Nov 2018 23:09:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/XF3fswvT9dQVJ1GT6sECcxUAjd2ZejRPgcu5G5rMCdeIgOSwupgG31Gp+hbTndRzMVqSEL X-Received: by 2002:a63:d047:: with SMTP id s7mr16831324pgi.311.1543043359357; Fri, 23 Nov 2018 23:09:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543043359; cv=none; d=google.com; s=arc-20160816; b=MaH42rx+RRhbvR28qfDCUE8M+dmL4C7OWcgV2kDB41m6Ne8EmPb030GHrEqazlx0Av WCX8NUeCVZMHEFAa0W5T4ykOH+11GHajAvwGnOV1a+6/k7dHlsQOk0pVqYvDE/Zis7nX VAOWUAtP21HkHyDH91gx7fSIXOd7Z48/ZBCVGINY6okmE8zH+EWLJoT4pqoedQ0R6WiM BomuQ1cI7COIkBpoXDP0Bl1gRl+7ev6apW1tL3oAbJtfbsS4GAo6AjD0ejRVU2GjsqDc QW+d7NkVNXl8oOyhYMDRh/kOMu/9NTaIu3MVw0X4tAXX+EfWa4pkQBm46/65SY3POtnD Q53w== 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=5llXmL071LkoV9+aZVNLiRsd4DJMg8wkITczzEgG/F0=; b=iGxL2Q+4HAh3UK6C9N+ucOgo2/7fby/HVd8Sy3e/7uuZntzBRIqDoCRB+ZxAflqyS6 aNO9MR3HnKUGtTHLJ8YkL2BkqO8tuEmm+WqVw/oiAJS/rHaM5OdIsE3jzBDRgACwiyj4 5zPD5sc6CMQYePLz4OejbYzwKy4b8iWDb1ytCsShEu8U3iwPVO8OxMlrHsCXtqfT+F36 mFWOlgFbp9ShB/HdfNZGCRkI43Dy5mcHubcUa4sXzD1Q5H+afkSwkM9gs+28Z3gD6yMA rRaipYzezbEDlqxmDb7GHYd7v4tKDZLmXOZ0at4hJbGgMNTeFJFhP+VLMu82L8kNb6bw xAsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=g+uuLfDx; 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 c136si14212701pfc.141.2018.11.23.23.09.05; Fri, 23 Nov 2018 23:09:19 -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=g+uuLfDx; 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 S2406541AbeKWEmw (ORCPT + 99 others); Thu, 22 Nov 2018 23:42:52 -0500 Received: from mail-lj1-f178.google.com ([209.85.208.178]:45881 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732278AbeKWEmw (ORCPT ); Thu, 22 Nov 2018 23:42:52 -0500 Received: by mail-lj1-f178.google.com with SMTP id s5-v6so8640610ljd.12 for ; Thu, 22 Nov 2018 10:02:23 -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=5llXmL071LkoV9+aZVNLiRsd4DJMg8wkITczzEgG/F0=; b=g+uuLfDx2wldsmmD9aQBaFnNOrTxJ8CGiOBWl2x/49BhgGlDHh+7yoIP/SswWyEjJx zXr7BvAuf7azuVPMWkGbxXvo+WzqyjAIGq3FgDBNmck3iEaRyOWuorZ10H6kr/k+T2CV 7mUJ7deyjFqM5w+985my6PEzgY+WBc2lxqorE= 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=5llXmL071LkoV9+aZVNLiRsd4DJMg8wkITczzEgG/F0=; b=cFD6Y9uMysNpLCYhW4vqA9Aj1ZcR0CVyVX3jCSnmSlL33ngQZ3iUWkPuxJ/egaNCzv FY0o/USsro6bJQ3mVlfjXaPxquPUu0jzSFwfUGQk0JY9EEgdSl2+IJFqfCFao7gboHWe q41r0bOmEDQIaoOg62QVTWo58V9aO+p+kJWY5JhCfmPurfsM/KpEpkXxDXlcpAqsS3Ab uSVX6xrJyVrIwL8XVopetRUkfFheV3seqvqmwFnd31zwUtb1rlp2BA5IKyeSreIOgvHB jr9qIcSL1jBM2tnksVIpV6nxslo6ojt+ukZgxB4uzXYx2ZZkMZ42fUzdTKbS7vixxPeE TS1w== X-Gm-Message-State: AA+aEWaZvilPhqnDEJt/IuHQBADcbJBawoL8SDe/RhgCxSdM2wsEQkKw ozPjE4tmCtsn9v2a/okK/+PddJgAmYoJFA== X-Received: by 2002:a2e:99d7:: with SMTP id l23-v6mr7330887ljj.165.1542909742552; Thu, 22 Nov 2018 10:02:22 -0800 (PST) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id u21-v6sm7502960lju.46.2018.11.22.10.02.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 10:02:22 -0800 (PST) Received: by mail-lf1-f53.google.com with SMTP id p86so7092941lfg.5 for ; Thu, 22 Nov 2018 10:02:22 -0800 (PST) X-Received: by 2002:a19:4287:: with SMTP id p129mr7439565lfa.135.1542909341735; Thu, 22 Nov 2018 09:55:41 -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> In-Reply-To: <11829e3c-7302-f821-cf5c-863e5267a17b@arm.com> From: Linus Torvalds Date: Thu, 22 Nov 2018 09:55:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: remove the ->mapping_error method from dma_map_ops V2 To: robin.murphy@arm.com Cc: linux@armlinux.org.uk, Christoph Hellwig , linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, David Woodhouse , joro@8bytes.org, "the arch/x86 maintainers" , Linux List Kernel Mailing , iommu@lists.linux-foundation.org, jdmason@kudzu.us, xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com 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 Thu, Nov 22, 2018 at 9:52 AM Robin Murphy wrote: > > Unfortunately, with things like the top-down IOVA allocator, and 32-bit > systems in general, "the top 4095" values may well still be valid > addresses - Ugh. > The only immediate benefit I can see is that we could distinguish cases > like the first which can never possibly succeed, and thus callers could > actually give up instead of doing what various subsystems currently do > and retry the exact same mapping indefinitely on the apparent assumption > that errors must be transient. No, the big immediate benefit of allowing "return -EINVAL" etc is simply legibility and error avoidance. It's basically how pretty much all the rest of the kernel returns errors, so not only is it very obvious, it's also what people do without even thinking.. So it would be good to work. Linus