Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbcLFIMj (ORCPT ); Tue, 6 Dec 2016 03:12:39 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:55030 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbcLFIK6 (ORCPT ); Tue, 6 Dec 2016 03:10:58 -0500 Subject: Re: [PATCH] ACPI/IORT: Make dma masks set-up IORT specific To: Lorenzo Pieralisi , Joerg Roedel , "Rafael J. Wysocki" , References: <20161205122619.25045-1-lorenzo.pieralisi@arm.com> CC: Will Deacon , Hanjun Guo , Bjorn Helgaas , Robin Murphy , Tomasz Nowicki , Sricharan R , Sinan Kaya , Nate Watterson , Prem Mallappa , Dennis Chen , , , , From: Hanjun Guo Message-ID: <58466EFC.3070109@huawei.com> Date: Tue, 6 Dec 2016 15:55:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20161205122619.25045-1-lorenzo.pieralisi@arm.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1529 Lines: 33 On 2016/12/5 20:26, Lorenzo Pieralisi wrote: > The introduction of acpi_dma_configure() allows to configure DMA > and related IOMMU for any device that is DMA capable. To achieve > that goal it ensures DMA masks are set-up to sane default values > before proceeding with IOMMU and DMA ops configuration. > > On x86/ia64 systems, through acpi_bind_one(), acpi_dma_configure() is > called for every device that has an ACPI companion, in that every device > is considered DMA capable on x86/ia64 systems (ie acpi_get_dma_attr() API), > which has the side effect of initializing dma masks also for > pseudo-devices (eg CPUs and memory nodes) and potentially for devices > whose dma masks were not set-up before the acpi_dma_configure() API was > introduced, which may have noxious side effects. > > Therefore, in preparation for IORT firmware specific DMA masks set-up, > wrap the default DMA masks set-up in acpi_dma_configure() inside an IORT > specific wrapper that reverts to a NOP on x86/ia64 systems, restoring the > default expected behaviour on x86/ia64 systems and keeping DMA default > masks set-up on IORT based (ie ARM) arch configurations. > > Signed-off-by: Lorenzo Pieralisi > Cc: Will Deacon > Cc: Hanjun Guo Add this patch on top of your v9 acpi smmu patchset, tested on Hisilicon D03 (ARM64), devices with SMMU enabled work fine, Tested-by: Hanjun Guo Reviewed-by: Hanjun Guo Thanks Hanjun