Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1064911imm; Wed, 11 Jul 2018 16:32:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdr8DfW61LNVErLz8f6M3fcC0wihdG8y/6+nmozELioaMGIJ42iiU8VxG7y5PzYINEFRaZu X-Received: by 2002:a17:902:422:: with SMTP id 31-v6mr565245ple.320.1531351936975; Wed, 11 Jul 2018 16:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531351936; cv=none; d=google.com; s=arc-20160816; b=ZFX32fg0TDWfoc5mS8XAyBkyXB/+a6cPpmL7If0j5gTo80pTa8vwucVU7AUZguR+tF nV/9wGqAFec872oMQBjNucpdhotFdDX/FmpYYAm3asEW85t/OAX2/gieqSkuR2RT9ha1 K9zfCzkKlJyL4UmEIhrvNakVvg4bXa+rl4E6QzZSh+6PEPVApnxHuxdoY9fV92efJDN6 KpwXFeJxf24/t+gplVsIjFyePK9t84kL62y8VC2ioOICMSEh+OWvGy0XggM6s+paxoyp Zbey3jdDx8wo2JemLWXbTwYOHUJEbqRrl2zha+4mrKlOuBmt2OXUZj6xkHU/jDNrVelt 4RZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=eFSnGlutP2DvK/uwcbDzXUeNr+lGcJOjgLDE+GOJ9X0=; b=aVMXY5UsFH4MPqULqhUsU1dtAFBIUUJW8bkOSi5wHadFEEXSSGF+apRbC2XQqTGdEI vUm0wYjrrj7je6nhYTMBlZnzoVOxzjAmnbFYkw+wvBR6iJ1VNQDSinvK+0sSSqlrXXsv 8rZZZTurAoak+pHFp00/mSClYpIhL7bb6PeFQuj7lGXoH5HqQjY0+RiTi0gwxeZy2IUM tUWncLCx0YKEqvqgoZUqcZjxZQCTBFMHixAQaRIKDU9OxDp0yj88HBSF3zkuxXKit4A6 eHRbjrx3LYnsXS/kZENSYSJDn4561U36xqnc7uU0QQRj/On243q18hm8tqMmCBWLoKGD g59w== ARC-Authentication-Results: i=1; mx.google.com; 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 l190-v6si19224032pgl.198.2018.07.11.16.31.48; Wed, 11 Jul 2018 16:32:16 -0700 (PDT) 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; 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 S2388223AbeGKRB5 (ORCPT + 99 others); Wed, 11 Jul 2018 13:01:57 -0400 Received: from foss.arm.com ([217.140.101.70]:40588 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388056AbeGKRB5 (ORCPT ); Wed, 11 Jul 2018 13:01:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B9CD80D; Wed, 11 Jul 2018 09:56:44 -0700 (PDT) Received: from [10.1.210.23] (e110467-lin.cambridge.arm.com [10.1.210.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0C6F3F589; Wed, 11 Jul 2018 09:56:41 -0700 (PDT) Subject: Re: [RFC PATCH 1/4] dma-mapping: Generalise dma_32bit_limit flag To: Christoph Hellwig Cc: m.szyprowski@samsung.com, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org, sudeep.holla@arm.com, robh+dt@kernel.org, frowand.list@gmail.com, gregkh@linuxfoundation.org, joro@8bytes.org, x86@kernel.org References: <20180710180433.GB26285@lst.de> From: Robin Murphy Message-ID: <868cead9-88a7-e58d-3452-a78e19be5f47@arm.com> Date: Wed, 11 Jul 2018 17:56:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180710180433.GB26285@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/18 19:04, Christoph Hellwig wrote: > On Tue, Jul 10, 2018 at 06:17:16PM +0100, Robin Murphy wrote: >> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c >> index 8be8106270c2..95e185347e34 100644 >> --- a/kernel/dma/direct.c >> +++ b/kernel/dma/direct.c >> @@ -183,7 +183,7 @@ int dma_direct_supported(struct device *dev, u64 mask) >> * Various PCI/PCIe bridges have broken support for > 32bit DMA even >> * if the device itself might support it. >> */ >> - if (dev->dma_32bit_limit && mask > DMA_BIT_MASK(32)) >> + if (dev->bus_dma_mask && mask > dev->bus_dma_mask) >> return 0; > > The comment above this check needs an updated (or just be removed). Right, I'll give it a tweak. I could also do with actually getting the field name correct in via_no_dac_cb()... > Also we still have a few architectures not using dma-direct. I guess > most were doing fine without such limits anyway, but at least arm > will probably need an equivalent check. Indeed, once we've found an approach that everyone's happy with we can have a more thorough audit of exactly where else it needs to be applied. FWIW I'm not aware of any 32-bit Arm systems affected by this*, but if they do exist then at least there's no risk of regression since they've always been busted. Robin. * Not counting the somewhat-similar StrongArm DMA controller bug where one bit in the *middle* of the mask is unusable. Let's keep that confined to the Arm dmabounce code and never speak of it...