From patchwork Tue Jul 9 23:35:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 2825484 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC2889F756 for ; Tue, 9 Jul 2013 23:35:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2F0E20120 for ; Tue, 9 Jul 2013 23:35:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7AD12011F for ; Tue, 9 Jul 2013 23:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410Ab3GIXfw (ORCPT ); Tue, 9 Jul 2013 19:35:52 -0400 Received: from [65.55.111.155] ([65.55.111.155]:49640 "EHLO blu0-omc4-s16.blu0.hotmail.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752906Ab3GIXfv (ORCPT ); Tue, 9 Jul 2013 19:35:51 -0400 Received: from BLU0-SMTP39 ([65.55.111.137]) by blu0-omc4-s16.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 9 Jul 2013 16:35:20 -0700 X-EIP: [opH9PHqRKzT9GkBUKNC949a/oOyh6GeJ] X-Originating-Email: [dave.anglin@bell.net] Message-ID: Received: from [192.168.2.10] ([174.92.85.79]) by BLU0-SMTP39.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 9 Jul 2013 16:35:19 -0700 CC: Alex Ivanov , linux-parisc@vger.kernel.org From: John David Anglin To: John David Anglin In-Reply-To: <51DC7996.3010405@bell.net> MIME-Version: 1.0 (Apple Message framework v936) Subject: Re: [PATCH] parisc: fix LMMIO mismatch between PAT length and MASK register Date: Tue, 9 Jul 2013 19:35:03 -0400 References: <20130614071142.GB10443@p100.box> <20130614073827.GA18871@p100.box> <51DC29DC.8060106@bell.net> <51DC7996.3010405@bell.net> X-Mailer: Apple Mail (2.936) X-OriginalArrivalTime: 09 Jul 2013 23:35:19.0640 (UTC) FILETIME=[F94B7D80:01CE7CFC] Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 9-Jul-13, at 4:59 PM, John David Anglin wrote: > On 7/9/2013 3:45 PM, Alex Ivanov wrote: >> The panic on SMP kernel changed to another one: >> http://pastebin.com/SfUfd0Un > This is just a guess but I don't think page is valid > if the pfn is not valid. You might try this untested change. > > flush_cache_mm might have same problem (i.e., we may need to > check whether the pfn for the pte is valid). This version compiles and boots on rp3440. Dave --- John David Anglin dave.anglin@bell.net diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 65fb4cb..b07720f 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -74,10 +74,13 @@ EXPORT_SYMBOL(flush_cache_all_local); void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) { - struct page *page = pte_page(*ptep); + struct page *page; - if (pfn_valid(page_to_pfn(page)) && page_mapping(page) && - test_bit(PG_dcache_dirty, &page->flags)) { + if (!pfn_valid(pte_pfn(*ptep))) + return; + + page = pte_page(*ptep); + if (page_mapping(page) && test_bit(PG_dcache_dirty, &page->flags)) { flush_kernel_dcache_page(page); clear_bit(PG_dcache_dirty, &page->flags); @@ -519,8 +522,9 @@ void flush_cache_mm(struct mm_struct *mm) pte_t *ptep = get_ptep(pgd, addr); if (ptep != NULL) { pte_t pte = *ptep; - __flush_cache_page(vma, addr, - page_to_phys(pte_page(pte))); + if (pfn_valid(pte_pfn(pte))) + __flush_cache_page(vma, addr, + page_to_phys(pte_page(pte))); } } }