From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [RFC PATCH 1/4] dma-mapping: Generalise dma_32bit_limit flag Date: Tue, 10 Jul 2018 20:04:33 +0200 Message-ID: <20180710180433.GB26285@lst.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Robin Murphy Cc: devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, gregkh@linuxfoundation.org, joro@8bytes.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, robh+dt@kernel.org, hanjun.guo@linaro.org, sudeep.holla@arm.com, frowand.list@gmail.com, hch@lst.de, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com List-Id: linux-acpi@vger.kernel.org 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). 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: hch@lst.de (Christoph Hellwig) Date: Tue, 10 Jul 2018 20:04:33 +0200 Subject: [RFC PATCH 1/4] dma-mapping: Generalise dma_32bit_limit flag In-Reply-To: References: Message-ID: <20180710180433.GB26285@lst.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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). 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8791C5CFE7 for ; Tue, 10 Jul 2018 18:18:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3E0720877 for ; Tue, 10 Jul 2018 18:18:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3E0720877 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732461AbeGJSSt (ORCPT ); Tue, 10 Jul 2018 14:18:49 -0400 Received: from verein.lst.de ([213.95.11.211]:49076 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732298AbeGJSSs (ORCPT ); Tue, 10 Jul 2018 14:18:48 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 3DFDD68B97; Tue, 10 Jul 2018 20:04:33 +0200 (CEST) Date: Tue, 10 Jul 2018 20:04:33 +0200 From: Christoph Hellwig To: Robin Murphy Cc: hch@lst.de, 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 Subject: Re: [RFC PATCH 1/4] dma-mapping: Generalise dma_32bit_limit flag Message-ID: <20180710180433.GB26285@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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.