Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4630188pxj; Wed, 12 May 2021 09:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZtonxuUa+HYSUpm+MJr6zylM31U5L6E4XhigKfhx5QyK0Sm5DL2+JsG1w/gDKCUTCkW3b X-Received: by 2002:aa7:d30b:: with SMTP id p11mr44121550edq.325.1620837389263; Wed, 12 May 2021 09:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837389; cv=none; d=google.com; s=arc-20160816; b=TB66ZwPpyF93MFfOwgJ5Fl94FeJNTE9jK8v+6Mvw2T2mVSa5uOOKsqyi4W12z9+Xoa 2lJ2uTjFLdrL3uYfE9KAVhmWtKdijtAPwwDlagc00vRVLxo0DEwj2I0y2Hqfn7SBQOHw XZTJoFoUxTG/lCaexyaDH6SMu1VgCk/kqIB3JID9xcCHgBvPx28hZW7L8PrPWeuhD7DN gnPg/ze5yv6lux8y+CISimWtG83z8OokDMWYKa6GVWuryNQPR0XoboNCYoSNo3vWWr6L KdynOBFM9Jf1mNOUdeDjBazfncBGIrnzgrRbkitAowXqUQgIpwR9c88k+EYbp+IkxLsV Wodw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9Regu6w6+iGKfyb/YC7PR2oJZDwstY7h9cmd4CBAHiw=; b=Hf0VLHb9QcNP65CRFhCgdpK30z1kf+ukApeo7I5b1TCI5i9LgMbm/577ii6DJtkd3n 30dncRe3+fMNs1J+QyHXzkIYVDKs99dcSvDpOknFk8uWYYduodvNY23M4I350OKFHB0t Zo6a9tQZFYfYXVwTyzCQ+1T6/mN1+pdYw/OWy7FPvDtQd2kzWw6MSlcK4e2jDD1y2rpf 8HdKbEuI6j1ICyA4UENz0qZHMlj1feq70aItxOrku/jWn2PDhpDyQQIRLe/LCk2Wjv7n 6wjaavnh1oijIn01le6l8yueJTgfRRpEsa8dCuJEgUOgIcbcIa/R6lv1GjLCCQ0JrwXV 3sVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bwbM5daz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m22si354748ejc.433.2021.05.12.09.36.05; Wed, 12 May 2021 09:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bwbM5daz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239852AbhELQZE (ORCPT + 99 others); Wed, 12 May 2021 12:25:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:51290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236297AbhELPhd (ORCPT ); Wed, 12 May 2021 11:37:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 630A26198C; Wed, 12 May 2021 15:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832741; bh=7pNLtXWQuWwWutRmVwRtZGsdheg3y9Tl18qFs7fq26s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bwbM5dazV2Bg7Yjh5SP/qOpWbdLPri7AW6LUVMPPXyWhGzLB59W25YWj/qW1aPJCL pi3tGMVCmwh2fKy6rXJOLBXKCzci17OjrRgTwJxIHnz0+5LqKixzOPNOGg//qAMOJC 2puSenm33J5FX4VbafS38ULGZOnhGalsrwK/OfaI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huang Pei , Jiaxun Yang , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.10 370/530] MIPS: loongson64: fix bug when PAGE_SIZE > 16KB Date: Wed, 12 May 2021 16:48:00 +0200 Message-Id: <20210512144831.943073939@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huang Pei [ Upstream commit 509d36a941a3466b78d4377913623d210b162458 ] 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 Acked-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- 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.30.2