public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Zhangshaokun <zhangshaokun@hisilicon•com>
To: Will Deacon <will@kernel•org>, <joro@8bytes•org>
Cc: Stephen Rothwell <sfr@canb•auug.org.au>,
	Linux Next Mailing List <linux-next@vger•kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>
Subject: Re: linux-next: Tree for Jul 2
Date: Tue, 2 Jul 2019 20:22:41 +0800	[thread overview]
Message-ID: <8a3bea20-fe65-35ea-43f1-d8f085a097e2@hisilicon.com> (raw)
In-Reply-To: <20190702120321.v3224ofd4aaxvytk@willie-the-truck>

Hi Will,

On 2019/7/2 20:03, Will Deacon wrote:
> [+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 <d25f6ead162e> ("iommu/arm-smmu-v3: Increase maximum size of queues")
> 
> Thanks for the report. I've provided a fix below.
> 

It works, thanks for the patch,
Tested-by: Shaokun Zhang <zhangshaokun@hisilicon•com>

Thanks,
Shaokun

> 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 <will@kernel•org>
> 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 <zhangshaokun@hisilicon•com>
> Signed-off-by: Will Deacon <will@kernel•org>
> ---
>  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.
> 


  reply	other threads:[~2019-07-02 12:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02  9:51 linux-next: Tree for Jul 2 Stephen Rothwell
2019-07-02 10:40 ` Zhangshaokun
2019-07-02 12:03   ` Will Deacon
2019-07-02 12:22     ` Zhangshaokun [this message]
2019-07-02 15:14     ` Joerg Roedel
2019-07-02 18:47 ` linux-next: Tree for Jul 2 (objtool) Randy Dunlap
2019-07-03 16:44   ` Josh Poimboeuf
2019-07-03 17:23     ` Randy Dunlap
2019-07-03 19:45       ` Josh Poimboeuf
2019-07-03 19:46         ` Josh Poimboeuf
2019-07-03 21:03           ` Josh Poimboeuf
  -- strict thread matches above, loose matches on Subject: below --
2025-07-02 10:13 linux-next: Tree for Jul 2 Stephen Rothwell
2024-07-02  7:54 Stephen Rothwell
2020-07-02  6:15 Stephen Rothwell
2018-07-02  4:51 Stephen Rothwell
2015-07-02  5:30 Stephen Rothwell
2014-07-02  6:50 Stephen Rothwell
2013-07-02  7:07 Stephen Rothwell
2013-07-02 10:37 ` Sedat Dilek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a3bea20-fe65-35ea-43f1-d8f085a097e2@hisilicon.com \
    --to=zhangshaokun@hisilicon$(echo .)com \
    --cc=joro@8bytes$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=will@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox