Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3269139ybi; Tue, 2 Jul 2019 05:04:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkhjKV1PmUOp6vF4u4AE9OAlYm+4YiYBvKl+6ZsBTzv/tHaTgGSqDwvmJkwgC3XOlTE/xA X-Received: by 2002:a17:902:9a49:: with SMTP id x9mr23584912plv.282.1562069049858; Tue, 02 Jul 2019 05:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562069049; cv=none; d=google.com; s=arc-20160816; b=RN14MwtPEUKnghduDIJh9uEmVzsMGb5srUbMPRwjPiQ/eBcFewi6xBIXkQRPO/ecPC wV3iD1gvbcqVshF1hCsxQTbxACGCxFmj/z+FdMc078NteYPf14tEz/eBuZpy4zEz6xEs 0rfwCkD0Tje5OJPSYEPC0aBe45IJKPgjVUDFaClmq0qiL1RAt6GiHYBW1Xf58CkC3vjl soPA1KTiqHwx2UVyIGMOpZAQOjwIEZ+kEDRDPjw9R3o1n6Ky08h4O34Pbs2vM22tTk/C PstFstWJedhjh5rT7Ohd8eBF8I6B8MYn+eULV4mLzE7httQiH66161upg57nmSic6OXB qlcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OeBoZKEdwivbgLy+aky+XobVgUmSZDZVzss7WSftvAw=; b=cscKt/AwCyb1QmVG1tLKoJweNLJ8oIaKLIvti2ix8GOb7QNq1hhsQdbRLnH7/Z2jAw cFUKcTxJalGMfy+p67mEzIt7iitZYk7P0kkl6w8VL2KEe4D9NQCZb20W/93AipgCsJ2e 4F9nzat9IWGEvnMEbrtn/i6cC5mWW7fhpJe/BSvsL+jZfBRCW/ZCFgnScIo6S7I0YRlz 4emtsUls2XqjMieRBVHlpQj0N0bhPQQVyh0EB3yaHU+trf1E9s8kNPFdo/oKrjANbDyQ BHUSiq5onzF1jJjruinGR7KVvh/gz/YdzQaoHIDkK6zYV6ZtkR3zHXlRFhPjA0EMPRC3 7EdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lMEpgyG6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g145si13178108pfb.173.2019.07.02.05.03.48; Tue, 02 Jul 2019 05:04:09 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lMEpgyG6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbfGBMD2 (ORCPT + 99 others); Tue, 2 Jul 2019 08:03:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:32922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbfGBMD1 (ORCPT ); Tue, 2 Jul 2019 08:03:27 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47E4E2064B; Tue, 2 Jul 2019 12:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562069006; bh=lYy0biRRuIMTFPxZzKn1vOvJk9GO14ibys/DKnoKX4c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lMEpgyG6/0TGoxHxLutiQ3X8vIzEj/RQA7zp7oGwIadFBGwATD0vzjnJ3rOfaz4qe K3hqrN6iJ3azFUrZcbWV5XvbhqgqaUDmD7jdcNEwPJ7YpSWSPaKO9it2+AV5Z2W2f3 nSOiywtaGGPfdtqIxoJ6w4EyOSI+GBho71qBPDks= Date: Tue, 2 Jul 2019 13:03:22 +0100 From: Will Deacon To: Zhangshaokun , joro@8bytes.org Cc: Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List Subject: Re: linux-next: Tree for Jul 2 Message-ID: <20190702120321.v3224ofd4aaxvytk@willie-the-truck> References: <20190702195158.79aa5517@canb.auug.org.au> <000f56ac-2abc-bc6a-e2db-5ae38779d276@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <000f56ac-2abc-bc6a-e2db-5ae38779d276@hisilicon.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+Joerg] On Tue, Jul 02, 2019 at 06:40:45PM +0800, Zhangshaokun wrote: > +Cc: Will Deacon > > There is a compiler failure on arm64 platform, as follow: > In file included from ./include/linux/list.h:9:0, > from ./include/linux/kobject.h:19, > from ./include/linux/of.h:17, > from ./include/linux/irqdomain.h:35, > from ./include/linux/acpi.h:13, > from drivers/iommu/arm-smmu-v3.c:12: > drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_device_hw_probe’: > drivers/iommu/arm-smmu-v3.c:194:40: error: ‘CONFIG_CMA_ALIGNMENT’ undeclared (first use in this function) > #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + CONFIG_CMA_ALIGNMENT) > ^ > It's the commit ("iommu/arm-smmu-v3: Increase maximum size of queues") Thanks for the report. I've provided a fix below. Joerg -- please can you take this on top of the SMMUv3 patches queued for 5.3? Cheers, Will --->8 From e8f9d8229e3aaa4817bfb72752e804eec97a3d8d Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Tue, 2 Jul 2019 12:53:18 +0100 Subject: [PATCH] iommu/arm-smmu-v3: Fix compilation when CONFIG_CMA=n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling a kernel without support for CMA, CONFIG_CMA_ALIGNMENT is not defined which results in the following build failure: In file included from ./include/linux/list.h:9:0 from ./include/linux/kobject.h:19, from ./include/linux/of.h:17 from ./include/linux/irqdomain.h:35, from ./include/linux/acpi.h:13, from drivers/iommu/arm-smmu-v3.c:12: drivers/iommu/arm-smmu-v3.c: In function ‘arm_smmu_device_hw_probe’: drivers/iommu/arm-smmu-v3.c:194:40: error: ‘CONFIG_CMA_ALIGNMENT’ undeclared (first use in this function) #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + CONFIG_CMA_ALIGNMENT) Fix the breakage by capping the maximum queue size based on MAX_ORDER when CMA is not enabled. Reported-by: Zhangshaokun Signed-off-by: Will Deacon --- drivers/iommu/arm-smmu-v3.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 57fb4e080d6b..8e73a7615bf5 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -191,7 +191,13 @@ #define Q_BASE_RWA (1UL << 62) #define Q_BASE_ADDR_MASK GENMASK_ULL(51, 5) #define Q_BASE_LOG2SIZE GENMASK(4, 0) + +/* Ensure DMA allocations are naturally aligned */ +#ifdef CONFIG_CMA_ALIGNMENT #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + CONFIG_CMA_ALIGNMENT) +#else +#define Q_MAX_SZ_SHIFT (PAGE_SHIFT + MAX_ORDER - 1) +#endif /* * Stream table. -- 2.11.0