From patchwork Fri Jun 14 07:11:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 2720251 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 009199F967 for ; Fri, 14 Jun 2013 07:11:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B33AE2019E for ; Fri, 14 Jun 2013 07:11:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A6A02019D for ; Fri, 14 Jun 2013 07:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868Ab3FNHLt (ORCPT ); Fri, 14 Jun 2013 03:11:49 -0400 Received: from mout.gmx.net ([212.227.15.19]:61152 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751858Ab3FNHLs (ORCPT ); Fri, 14 Jun 2013 03:11:48 -0400 Received: from mailout-de.gmx.net ([10.1.76.33]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LpRRz-1UB3HK0aGb-00fAur for ; Fri, 14 Jun 2013 09:11:47 +0200 Received: (qmail invoked by alias); 14 Jun 2013 07:11:47 -0000 Received: from p54AD154E.dip0.t-ipconnect.de (EHLO p100.box) [84.173.21.78] by mail.gmx.net (mp033) with SMTP; 14 Jun 2013 09:11:47 +0200 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX1+TOSIi7umT6TlAyTeGqGdTxv1+siJQew43mJgNbf hBheiN9Zzk6PMM Date: Fri, 14 Jun 2013 09:11:42 +0200 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , Thomas Bogendoerfer Subject: [PATCH] parisc: fix LMMIO mismatch between PAT length and MASK register Message-ID: <20130614071142.GB10443@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 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,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 From: Thomas Bogendoerfer The LMMIO length reported by PAT and the length given by the LBA MASK register are not consistent. This leads e.g. to a non-working ATI FireGL card with the radeon DRM driver since the memory can't be mapped. Fix this by correctly adjusting the resource sizes. 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/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 1f05913..7dc0e40 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -994,6 +994,15 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) case PAT_LMMIO: /* used to fix up pre-initialized MEM BARs */ if (!lba_dev->hba.lmmio_space.flags) { + unsigned long lba_len; + lba_len = ~READ_REG32(lba_dev->hba.base_addr + + LBA_LMMIO_MASK); + if ((p->end - p->start) != lba_len) { + pr_warn("PCI%02x LMMIO mismatch between PAT length (0x%lx) and MASK register (0x%lx), fixing.\n", + (int)lba_dev->hba.bus_num.start, + p->end - p->start, lba_len); + p->end = p->start + lba_len; + } sprintf(lba_dev->hba.lmmio_name, "PCI%02x LMMIO", (int)lba_dev->hba.bus_num.start);