From patchwork Tue Oct 29 21:05:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 3111681 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 EF0DB9F3E2 for ; Tue, 29 Oct 2013 21:05:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF23120203 for ; Tue, 29 Oct 2013 21:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 406A62020E for ; Tue, 29 Oct 2013 21:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751469Ab3J2VFt (ORCPT ); Tue, 29 Oct 2013 17:05:49 -0400 Received: from mout.gmx.net ([212.227.17.21]:63155 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345Ab3J2VFs (ORCPT ); Tue, 29 Oct 2013 17:05:48 -0400 Received: from p100.box ([84.173.41.184]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MX1dc-1V7cg222xo-00VzqV for ; Tue, 29 Oct 2013 22:05:46 +0100 Date: Tue, 29 Oct 2013 22:05:44 +0100 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley Subject: [PATCH] parisc: check hardcoded value of SHMLBA against value reported by firmware Message-ID: <20131029210544.GA18167@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:fEqPmpTn/RiJZancHitIZ3W7kvZbFSR58EAuKwjs292FTeLtmL8 qxA/Hb0rG4G7p44MwJWh/4CaKHgZxAg+Ch5wa/f2RvGXxdbs6BuADLD+7C/mEoTmozTVXaU 5q39u3c2ZPK2TH9oYfm7OhrZVy3IKKV0pIWMacSV73amY6tClxmzXqP1Z+OKnmRQbcfaLcC EsRDIGq/j/0QbT1VRU4UA== 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.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions of the platform. The firmware function PDC_CACHE does return the machine dependend value of this aliasing requirement. So, if there is a difference between those two - which we don't expect - let's report it at least. Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index c035673..3523e20 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -142,6 +142,15 @@ parisc_cache_init(void) if (pdc_cache_info(&cache_info) < 0) panic("parisc_cache_init: pdc_cache_info failed"); + /* + * The alias field returned by PDC_CACHE specifies the aliasing + * boundaries for virtual addresses. So, let's verify if our hardcoded + * value of SHMLBA (4 MB) is correct for this machine. + */ + if ((4096UL << (cache_info.dc_conf.cc_alias-1)) != SHMLBA) + pr_warn("WARNING: PDC_CACHE returns aliasing of %lu kB.\n", + (4UL << (cache_info.dc_conf.cc_alias-1))); + #if 0 printk("ic_size %lx dc_size %lx it_size %lx\n", cache_info.ic_size,