From patchwork Sun Oct 11 21:00:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 53027 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9BL8Fkf010642 for ; Sun, 11 Oct 2009 21:08:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbZJKVBf (ORCPT ); Sun, 11 Oct 2009 17:01:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752071AbZJKVBf (ORCPT ); Sun, 11 Oct 2009 17:01:35 -0400 Received: from hera.kernel.org ([140.211.167.34]:56118 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbZJKVBe (ORCPT ); Sun, 11 Oct 2009 17:01:34 -0400 Received: from [192.168.101.9] (adsl-76-193-117-243.dsl.pltn13.sbcglobal.net [76.193.117.243]) (authenticated bits=0) by hera.kernel.org (8.14.2/8.13.8) with ESMTP id n9BL0XI3013102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Oct 2009 21:00:38 GMT Message-ID: <4AD24766.7050205@kernel.org> Date: Sun, 11 Oct 2009 14:00:22 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Jesse Barnes CC: Brad Spengler , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , Ingo Molnar , "H. Peter Anvin" , Matthew Wilcox Subject: [PATCH] pci: fix crash about old IA64 about pci_cfg_space_size References: <20091011074531.GA12357@grsecurity.net> <4AD1AE0D.1030007@kernel.org> In-Reply-To: <4AD1AE0D.1030007@kernel.org> X-Virus-Scanned: ClamAV 0.93.3/9881/Sat Oct 10 09:21:35 2009 on hera.kernel.org X-Virus-Status: Clean Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 8105e32..0c80a07 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -901,11 +901,24 @@ int pci_cfg_space_size(struct pci_dev *dev) { int pos; u32 status; + +#ifndef CONFIG_IA64 +/* + * not use it with IA64 at this point + * ia64 SAL 3.2 before doesn't support ext space, so + * pci_read_config_dword(dev, 0x100, &status) would cause GP + * the problem is not triggered, because system with SAL 3.2 before + * doesn't include PCI-X 2.0 or PCI Express, so pci_cfg_spce_size_ext() + * is not called with them. + * need to extend ia64 to detect sal version, and pci_root_ops + * to use raw_pci_ops and raw_pci_ext_ops like x86 + */ u16 class; class = dev->class >> 8; if (class == PCI_CLASS_BRIDGE_HOST) return pci_cfg_space_size_ext(dev); +#endif pos = pci_find_capability(dev, PCI_CAP_ID_EXP); if (!pos) {