Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp458894imm; Thu, 6 Sep 2018 05:22:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbWoGh+llrWHPUGisomSLoFTmfECa5qfPC60l9dKlGz45jNtyAn1qvxgxPmMpyr6axPCwKg X-Received: by 2002:a63:e255:: with SMTP id y21-v6mr2466763pgj.160.1536236538619; Thu, 06 Sep 2018 05:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536236538; cv=none; d=google.com; s=arc-20160816; b=yDM1hrixTYdl0Nrkp5QP+AQ3HdPa4OKcFp0wnngeaZ70Tc4ZyFU+BtUuvZU4M9s1sL mW74KvKi16ScHaSbHetpM0FMCdQ23uAdddwb3+QkA775J659XQyerZIJ6YItG99bAcgD KomK8fJeU4y0RklFRuj2vwo2DEMDCp9ts3zQL1IK/ZTydouRIFviCe2DmG+s8X2gjRkp ZPSxdzHs+/Z/jDtMZ0F6ejbjmUiAy+XFudNokqKiJRDZnY7C6YvyuQmdaP3U4LPaSvLJ uMU2drh4gTSB2JdNGs0MQ1VAoxSkTwSih1SYp+I0t8xmBZc6kvDevIhaLlDzemaWrbnd IGfw== 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; bh=IYEsb7VNqxoL9spZJKsuwj8wTSR3itez9nUfhmmx5Yc=; b=ASBWdHhU58qlcERoaN2P4UwTMf0QFqZjzwEu1g5T/6J2nLK59ee198EnY2aCvIZRLM /7F+pewd7HzH+MVE3IxUCEIy5VAihF5kdSwJlN/NCEwnOnM/prQRcQ0PoHefTx8Hwwx/ QjJPHoJ7stAlvFTLl7dM/4+QhGFSlKXv7ygQQB1tBUtrRX3ySjja+mnrMHFfUwpE6k1F EMFJvgLtRl+Y1qqsmOqPURu0QcpwbFoyA7KEVqwjn3rjnbXGGL1V19pLUatUwjidEoD8 HSi87n18PmpLQEmhHupYKgsAF50E/mpE1NyarhacMT6mJe1yyqOn6hDDddAYnX+HBz75 waVw== 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 o137-v6si4790938pfg.362.2018.09.06.05.22.02; Thu, 06 Sep 2018 05:22:18 -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 S1728122AbeIFQza (ORCPT + 99 others); Thu, 6 Sep 2018 12:55:30 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44518 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbeIFQza (ORCPT ); Thu, 6 Sep 2018 12:55:30 -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 12AB97A9; Thu, 6 Sep 2018 05:20:17 -0700 (PDT) Received: from [10.4.12.131] (e110467-lin.emea.arm.com [10.4.12.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 039BD3F575; Thu, 6 Sep 2018 05:20:15 -0700 (PDT) Subject: Re: [PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops To: Christoph Hellwig , iommu@lists.linux-foundation.org Cc: Marek Szyprowski , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180827084711.23407-1-hch@lst.de> <20180827084711.23407-5-hch@lst.de> From: Robin Murphy Message-ID: Date: Thu, 6 Sep 2018 13:20:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180827084711.23407-5-hch@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 27/08/18 09:47, Christoph Hellwig wrote: > There is no reason to leave the per-device dma_ops around when > deconfiguring a device, so move this code from arm64 into the > common code. Reviewed-by: Robin Murphy > Signed-off-by: Christoph Hellwig > --- > arch/arm64/include/asm/dma-mapping.h | 5 ----- > arch/arm64/mm/dma-mapping.c | 5 ----- > include/linux/dma-mapping.h | 5 ++++- > 3 files changed, 4 insertions(+), 11 deletions(-) > > diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h > index b7847eb8a7bb..0a2d13332545 100644 > --- a/arch/arm64/include/asm/dma-mapping.h > +++ b/arch/arm64/include/asm/dma-mapping.h > @@ -39,11 +39,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > const struct iommu_ops *iommu, bool coherent); > #define arch_setup_dma_ops arch_setup_dma_ops > > -#ifdef CONFIG_IOMMU_DMA > -void arch_teardown_dma_ops(struct device *dev); > -#define arch_teardown_dma_ops arch_teardown_dma_ops > -#endif > - > /* do not use this function in a driver */ > static inline bool is_device_dma_coherent(struct device *dev) > { > diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c > index 072c51fb07d7..cdcb73db9ea2 100644 > --- a/arch/arm64/mm/dma-mapping.c > +++ b/arch/arm64/mm/dma-mapping.c > @@ -862,11 +862,6 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > dev_name(dev)); > } > > -void arch_teardown_dma_ops(struct device *dev) > -{ > - dev->dma_ops = NULL; > -} > - > #else > > static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h > index 1423b69f3cc9..eafd6f318e78 100644 > --- a/include/linux/dma-mapping.h > +++ b/include/linux/dma-mapping.h > @@ -664,7 +664,10 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, > #endif > > #ifndef arch_teardown_dma_ops > -static inline void arch_teardown_dma_ops(struct device *dev) { } > +static inline void arch_teardown_dma_ops(struct device *dev) > +{ > + dev->dma_ops = NULL; > +} > #endif > > static inline unsigned int dma_get_max_seg_size(struct device *dev) >