Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2758650imu; Thu, 29 Nov 2018 09:45:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/W29N/kZq/7ypt3vJgIDpNDLX0W+n45d0f0ULUS/T7rirKpOvBKq02s9U78yQHeEYHQTb0+ X-Received: by 2002:a62:345:: with SMTP id 66mr2272620pfd.189.1543513526713; Thu, 29 Nov 2018 09:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543513526; cv=none; d=google.com; s=arc-20160816; b=1BCLaSrMcpDcCJwQU7TeV7EnMAU9nPOlJlxigxfJWlWd4iAnvUvjJRQPqo1eUpmqTW ikKC8gNflkzzuOvAf/g8WOIiP0ig1jFkxOMurJL9NF6wP43APYx3qqh2OXkxkWBz9VvI rIkb7Ouqwpy//2/WrE4LGSITUdUzwLNOAXpWpamh9SQIpIyV2Dxk4VYZzUns7W/OZtpb LjAx2e5YPuFAepkjGRuZVqXWxPd55upiJ1AFANZhj0HKap02s84ls16yVzAf5/dT5Hme tA/98x4XsEGncf0+8aQB+n8ajuzTjrtzjHc3miJexIU7d9Xdx3cMs3y19oTn0nntj+5v mGyw== 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=CgaKeOauL30+OcqQ/oF88KtKOMNK435LY3ecISt9KGg=; b=OeIfw1p1p/nU1fnHtCfNY+F8pyqS6zrUl+C401A8+QL+rxclEkEvGi74PiFT/syWWI P3lH2CVwc7ZqSBYG/Xbtcc0aJXpXQeh6xlVkbonChT1HRmYD4/dlsg8XRIqtSI7uon+E SGTlM6sxyb/QpMq8//sjP1tqdZbhJaynYaC0iKFjw0wYMWXh+0jbv22m8ss+78i9MvVj X4lCxdfYtF2QIEF+VGaCDEbuXup51A7wB9QQhQnNlePmdue2a5jj/c6vEG5vFXTACpuk K9NiNuzZkIhlbYk+DBQKbMHlrsjqSq1MJTBIOJMSEHSDKM0fTCBOn0Thm4tgpWpZW8ed +2Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KXV66Zrt; 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 c10si2591502pgt.222.2018.11.29.09.45.11; Thu, 29 Nov 2018 09:45:26 -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=KXV66Zrt; 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 S1730666AbeK3Eug (ORCPT + 99 others); Thu, 29 Nov 2018 23:50:36 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37254 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728255AbeK3Eug (ORCPT ); Thu, 29 Nov 2018 23:50:36 -0500 Received: by mail-lj1-f196.google.com with SMTP id e5-v6so2533670lja.4 for ; Thu, 29 Nov 2018 09:44:25 -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=CgaKeOauL30+OcqQ/oF88KtKOMNK435LY3ecISt9KGg=; b=KXV66Zrt+LE9OJW9tR0KA0p3jf1gcsN3O0/mok8/I9QbAd8RlRFcNspzwJljeiqB8o CKPUJ50mZ3YSjUiMoAib/A5VD2vM8qYiU4IiSVFFusoAlB/YUQe6dC9FqiZ9AgH5vfmB C4525bGZNyppxdzgNGN8/NvnQuTOhz26MCSE4= 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=CgaKeOauL30+OcqQ/oF88KtKOMNK435LY3ecISt9KGg=; b=nPuLVg7s3sKnFFuTvIUewVHIZU1uncKg4jYeZyu66n0tpTdPXAQpOFRxCYafWryfhg diuit1HOrv3ZgXSCdh6H9q0PTBWBxtiLh8bJN96c/R4lw3UsN0wXpSQPw0hv/MY/DN9u p22yCXPNYnSZhL9M0aJLdXOgoobDqZTMXh+OwtgR0r25n0YJMJqr8oLqDimlaH1LsvbE 95EJuU0E7lTfm2+t8+ibKfH4Y5m9A0BuGJSFGgx3Tjd/l5z0Hb/BkvIsBTaUqzgdeAoT vjjy2bAbGGvy837RGe5xricENkv4F/a9AE5oCJ19xsRa3FEeo9f+AeCBARbSPZjCC4PM GZBg== X-Gm-Message-State: AA+aEWYp+U4Or+qqKwiCjWFV7M2b0jRx5FeALqd2N4pyhSkE+ucchc7X 6n02qb82Wkn+ycU+oA8T766aLstyns0= X-Received: by 2002:a2e:3603:: with SMTP id d3-v6mr1719063lja.46.1543513464169; Thu, 29 Nov 2018 09:44:24 -0800 (PST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id p67sm409166lfe.14.2018.11.29.09.44.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 09:44:22 -0800 (PST) Received: by mail-lf1-f41.google.com with SMTP id z13so2081752lfe.11 for ; Thu, 29 Nov 2018 09:44:22 -0800 (PST) X-Received: by 2002:a19:982:: with SMTP id 124mr1600110lfj.138.1543513462064; Thu, 29 Nov 2018 09:44:22 -0800 (PST) MIME-Version: 1.0 References: <11829e3c-7302-f821-cf5c-863e5267a17b@arm.com> <20181123065511.GA17856@lst.de> <20181128074117.GA21126@lst.de> <20181128174545.GJ30658@n2100.armlinux.org.uk> <20181128180841.GM30658@n2100.armlinux.org.uk> <20181129162323.GA27068@lst.de> In-Reply-To: <20181129162323.GA27068@lst.de> From: Linus Torvalds Date: Thu, 29 Nov 2018 09:44: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: Russell King - ARM Linux , linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, robin.murphy@arm.com, "the arch/x86 maintainers" , Linux List Kernel Mailing , iommu@lists.linux-foundation.org, linux-alpha@vger.kernel.org, xen-devel@lists.xenproject.org, David Woodhouse , 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 Thu, Nov 29, 2018 at 8:23 AM Christoph Hellwig wrote: > > We can. At least in theory. The problem is that depending on the > crazy mapping from physical and kernel virtual address to dma addresses > these might be pages at pretty random places. Look at fun like > arch/x86/pci/sta2x11-fixup.c for how ugly these mappings could look. > > It also means that we might have setup swiotlb on just about every > 32-bit architecture, even if it has no real addressing limit except for > the one we imposed. No. Really. If there's no iotlb, then you just mark that one page reserved. It simply doesn't get used. It doesn't mean you suddenly need a swiotlb. If there *is* a iotlb, none of this should matter, because you'd just never map anything into that page. But whatever. It's independent from the patch series under discussion. Make dma_mapping_error() at least return a real error (eg -EINVAL, or whatever is the common error), and we can maybe do this later. Or, better yet, plan on removing the single-page dma mappign entirely at a later date, and make the issue moot. Linus