linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Huang Pei" <huangpei@loongson.cn>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	ambrosehua@gmail.com
Cc: "Bibo Mao" <maobibo@loongson.cn>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	linux-arch@vger.kernel.org,
	"paulburton@kernel.org" <paulburton@kernel.org>,
	"Xuefeng Li" <lixuefeng@loongson.cn>,
	"Tiezhu Yang" <yangtiezhu@loongson.cn>,
	"Gao Juxin" <gaojuxin@loongson.cn>,
	"Huacai Chen" <chenhuacai@loongson.cn>,
	"Jinyang He" <hejinyang@loongson.cn>
Subject: Re: [PATCH] MIPS: loongson64: fix bug when PAGE_SIZE > 16KB
Date: Thu, 25 Mar 2021 08:50:36 +0800	[thread overview]
Message-ID: <6e8521f8-80e3-49c8-b85c-ccb2c7f349b5@www.fastmail.com> (raw)
In-Reply-To: <20210324032451.27569-1-huangpei@loongson.cn>



On Wed, Mar 24, 2021, at 11:24 AM, Huang Pei wrote:
> When page size larger than 16KB, arguments "vaddr + size(16KB)" in
> "ioremap_page_range(vaddr, vaddr + size,...)" called by
> "add_legacy_isa_io" is not page-aligned.
> 
> As loongson64 needs at least page size 16KB to get rid of cache alias,
> and "vaddr" is 64KB-aligned, and 64KB is largest page size supported,
> rounding "size" up to PAGE_SIZE is enough for all page size supported.
> 
> Fixes: 6d0068ad15e4 ("MIPS: Loongson64: Process ISA Node in DeviceTree")
> Signed-off-by: Huang Pei <huangpei@loongson.cn>

Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

> ---
>  arch/mips/loongson64/init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c
> index ed75f7971261..052cce6a8a99 100644
> --- a/arch/mips/loongson64/init.c
> +++ b/arch/mips/loongson64/init.c
> @@ -82,7 +82,7 @@ static int __init add_legacy_isa_io(struct 
> fwnode_handle *fwnode, resource_size_
>  		return -ENOMEM;
>  
>  	range->fwnode = fwnode;
> -	range->size = size;
> +	range->size = size = round_up(size, PAGE_SIZE);
>  	range->hw_start = hw_start;
>  	range->flags = LOGIC_PIO_CPU_MMIO;
>  
> -- 
> 2.17.1
> 
>

-- 
- Jiaxun

  reply	other threads:[~2021-03-25  0:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  3:24 [PATCH] MIPS: loongson64: fix bug when PAGE_SIZE > 16KB Huang Pei
2021-03-25  0:50 ` Jiaxun Yang [this message]
2021-03-25 10:00 ` Thomas Bogendoerfer

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=6e8521f8-80e3-49c8-b85c-ccb2c7f349b5@www.fastmail.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=ambrosehua@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=gaojuxin@loongson.cn \
    --cc=hejinyang@loongson.cn \
    --cc=huangpei@loongson.cn \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=maobibo@loongson.cn \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).