From patchwork Fri Oct 4 23:30:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deng-Cheng Zhu X-Patchwork-Id: 2990511 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 E286B9F2B6 for ; Fri, 4 Oct 2013 23:31:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22CFA202BE for ; Fri, 4 Oct 2013 23:31:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F350A20251 for ; Fri, 4 Oct 2013 23:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751314Ab3JDXb3 (ORCPT ); Fri, 4 Oct 2013 19:31:29 -0400 Received: from multi.imgtec.com ([194.200.65.239]:11391 "EHLO multi.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181Ab3JDXb2 (ORCPT ); Fri, 4 Oct 2013 19:31:28 -0400 From: Deng-Cheng Zhu To: , CC: , , Deng-Cheng Zhu Subject: [PATCH v2 1/4] PCI/quirks: Fix PIIX4 memory base and size mask Date: Fri, 4 Oct 2013 16:30:50 -0700 Message-ID: <1380929453-15428-2-git-send-email-dengcheng.zhu@imgtec.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1380929453-15428-1-git-send-email-dengcheng.zhu@imgtec.com> References: <1380929453-15428-1-git-send-email-dengcheng.zhu@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.136.61] X-SEF-Processed: 7_3_0_01192__2013_10_05_00_31_25 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, 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: Deng-Cheng Zhu According to Intel PIIX4 datasheet: The memory address consists of a 17-bit base address (AD[31:15]) and a 7-bit mask (AD[21:15]). This provides memory ranges from 32 Kbytes to 4 Mbytes in size. This is true for both devices 12 and 13. This patch fixes it. Ref 1: www.intel.com/assets/pdf/datasheet/290562.pdf April 1997 version 001 (p131 bottom, p226 top) Ref 2: www.intel.com/assets/pdf/specupdate/297738.pdf January 2002 version 017 (Nothing against the fix in the specification update was found.) Signed-off-by: Deng-Cheng Zhu Reviewed-by: James Hogan --- drivers/pci/quirks.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index f6c31fa..3e7e489 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -414,9 +414,9 @@ static void piix4_mem_quirk(struct pci_dev *dev, const char *name, unsigned int pci_read_config_dword(dev, port, &devres); if ((devres & enable) != enable) return; - base = devres & 0xffff0000; - mask = (devres & 0x3f) << 16; - size = 128 << 16; + base = devres & 0xffff8000; + mask = (devres & 0x7f) << 15; + size = 128 << 15; for (;;) { unsigned bit = size >> 1; if ((bit & mask) == bit)