From patchwork Fri Jun 18 03:23:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 106795 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5I3OmPh019722 for ; Fri, 18 Jun 2010 03:24:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757488Ab0FRDYs (ORCPT ); Thu, 17 Jun 2010 23:24:48 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:35430 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757183Ab0FRDYr (ORCPT ); Thu, 17 Jun 2010 23:24:47 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o5I3OjMQ018387 (envelope-from kaneshige.kenji@jp.fujitsu.com); Fri, 18 Jun 2010 12:24:46 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 7B13145DE4F; Fri, 18 Jun 2010 12:24:45 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 5BCCB45DE51; Fri, 18 Jun 2010 12:24:45 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 3D30BE18005; Fri, 18 Jun 2010 12:24:45 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id F0EB91DB8038; Fri, 18 Jun 2010 12:24:41 +0900 (JST) Received: from m105.css.fujitsu.com (m105 [127.0.0.1]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id B93295D8001; Fri, 18 Jun 2010 12:24:41 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id 37B4E5D8002; Fri, 18 Jun 2010 12:24:41 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Fri, 18 Jun 2010 12:24:10 +0900 (JST) Message-ID: <4C1AE6CD.1080704@jp.fujitsu.com> Date: Fri, 18 Jun 2010 12:23:57 +0900 From: Kenji Kaneshige User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, linux-kernel@vger.kernel.org CC: matthew@wil.cx, macro@linux-mips.org, kamezawa.hiroyu@jp.fujitsu.com, eike-kernel@sf-tec.de, jeremy@goop.org, linux-pci@vger.kernel.org Subject: [PATCH 2/2] x86: ioremap: fix normal ram range check References: <4C1AE64C.6040609@jp.fujitsu.com> In-Reply-To: <4C1AE64C.6040609@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 18 Jun 2010 03:24:49 +0000 (UTC) Index: linux-2.6.34/arch/x86/mm/ioremap.c =================================================================== --- linux-2.6.34.orig/arch/x86/mm/ioremap.c +++ linux-2.6.34/arch/x86/mm/ioremap.c @@ -101,7 +101,7 @@ static void __iomem *__ioremap_caller(re * Don't allow anybody to remap normal RAM that we're using.. */ last_pfn = last_addr >> PAGE_SHIFT; - for (pfn = phys_addr >> PAGE_SHIFT; pfn < last_pfn; pfn++) { + for (pfn = phys_addr >> PAGE_SHIFT; pfn <= last_pfn; pfn++) { int is_ram = page_is_ram(pfn); if (is_ram && pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn)))