Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2021579imm; Tue, 10 Jul 2018 11:45:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdhQ/FxpSjuSPmInYrsyl9vhJmY5aTm0U63RAuSaGbexm7v4Bydlk2OmhIV4ZLoneApaleK X-Received: by 2002:a17:902:780e:: with SMTP id p14-v6mr21039534pll.239.1531248343349; Tue, 10 Jul 2018 11:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531248343; cv=none; d=google.com; s=arc-20160816; b=KYKXd8Koq8cciImW+ll5m/usStJMuNq0JGq6QHGtCzUJvjgN9ljhy16oF9QFC8RnOB HYqm58imuKUQNQfFLFwR8zjyRlP1Z4XQV7KjuQuRtoHDOvuFukwoaopAJ5jIAIcjaW5n 7b5EG9gEoh8FBvVWi4d+G/l5bhKuPhqYjTxWi4JSeXos2gVZ+ox5tgyZrdnvmsqdFL7+ CtQNc4JG3tzgS7CQngY7bReB9+E16tPISpoGEy55dcq7jCyhVbrDxpz9k91MFk0tjJ9I mh60WvFbzS+DBTAlSUPKU4K+q6CJz4P2HYjMrOilDoxrfElPiYDeUewaeoswH1YNdLXQ aEfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=lFFNWZdCFxEVqRYoGlY1ZX3m+nv+0VFTXtIB81k89M0=; b=oB4GD+INprMQTSAUcMaVLB10Wha4WBe6pnIrNaqLBYlpFeDGqMPxvllTk9Ps9A/p95 rTWJnT6rmzUsTusttJXmN+SE79UB6fXNoVJXG3wFyekCy0Xz9FaHOIqaC/VUsqI7zhNo yEd7X1MtoZwrpgpitC2bezn2148leRF/aCsNep/xsH3lwiZxjzBd6WdUEtJxjcByHXlh VhMsN6jWes736PloNIUX8NGd/ex0/DdhaaUqgO24FmyJMaNtrx51ddzlNqhK7mRoNNtt K2EltXAFzL79ivir8ipSHT79042i1GZijqFucfOJywIjXAMBIY3S2+5urs0R/DJjjpg3 K5eg== 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 o123-v6si16600865pgo.190.2018.07.10.11.45.28; Tue, 10 Jul 2018 11:45:43 -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 S2389364AbeGJSnk (ORCPT + 99 others); Tue, 10 Jul 2018 14:43:40 -0400 Received: from foss.arm.com ([217.140.101.70]:51808 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389003AbeGJSdm (ORCPT ); Tue, 10 Jul 2018 14:33:42 -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 3549F16A3; Tue, 10 Jul 2018 10:17:36 -0700 (PDT) Received: from e110467-lin.cambridge.arm.com (e110467-lin.cambridge.arm.com [10.1.210.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A66E93F589; Tue, 10 Jul 2018 10:17:33 -0700 (PDT) From: Robin Murphy To: hch@lst.de, m.szyprowski@samsung.com, iommu@lists.linux-foundation.org Cc: 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: [RFC PATCH 3/4] of/device: Set bus DMA mask as appropriate Date: Tue, 10 Jul 2018 18:17:18 +0100 Message-Id: <346c004b599fb77a2006a4eeb992b30feb06fce5.1531239284.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.17.1.dirty In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When an explicit DMA limit is described by firmware, we need to remember it regardless of how drivers might subsequently update their devices' masks. The new bus_dma_mask field does that. Signed-off-by: Robin Murphy --- drivers/of/device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/device.c b/drivers/of/device.c index 33d85511d790..0d39633e8545 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -149,6 +149,7 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma) * set by the driver. */ mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1); + dev->bus_dma_mask = mask; dev->coherent_dma_mask &= mask; *dev->dma_mask &= mask; -- 2.17.1.dirty