mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Jiri Slaby <jslaby@suse.cz>, Bjorn Helgaas <bjorn.helgaas@hp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Thomas Renninger <trenn@suse.de>,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [22/44] PCI: add more checking to ICH region quirks
Date: Mon, 21 Mar 2011 16:10:02 -0700	[thread overview]
Message-ID: <20110321231052.988200630@clark.kroah.org> (raw)
In-Reply-To: <20110321231105.GA1744@kroah.com>

2.6.32-longterm review patch.  If anyone has any objections, please let us know.

------------------

From: Jiri Slaby <jslaby@suse.cz>

commit cdb9755849fbaf2bb9c0a009ba5baa817a0f152d upstream.

Per ICH4 and ICH6 specs, ACPI and GPIO regions are valid iff ACPI_EN
and GPIO_EN bits are set to 1. Add checks for these bits into the
quirks prior to the region creation.

While at it, name the constants by macros.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/quirks.c |   49 +++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 39 insertions(+), 10 deletions(-)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -506,6 +506,17 @@ static void __devinit quirk_piix4_acpi(s
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82371AB_3,	quirk_piix4_acpi);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82443MX_3,	quirk_piix4_acpi);
 
+#define ICH_PMBASE	0x40
+#define ICH_ACPI_CNTL	0x44
+#define  ICH4_ACPI_EN	0x10
+#define  ICH6_ACPI_EN	0x80
+#define ICH4_GPIOBASE	0x58
+#define ICH4_GPIO_CNTL	0x5c
+#define  ICH4_GPIO_EN	0x10
+#define ICH6_GPIOBASE	0x48
+#define ICH6_GPIO_CNTL	0x4c
+#define  ICH6_GPIO_EN	0x10
+
 /*
  * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
  *	0x40 (128 bytes of ACPI, GPIO & TCO registers)
@@ -514,12 +525,21 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
 static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)
 {
 	u32 region;
+	u8 enable;
 
-	pci_read_config_dword(dev, 0x40, &region);
-	quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH4 ACPI/GPIO/TCO");
-
-	pci_read_config_dword(dev, 0x58, &region);
-	quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH4 GPIO");
+	pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
+	if (enable & ICH4_ACPI_EN) {
+		pci_read_config_dword(dev, ICH_PMBASE, &region);
+		quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
+				"ICH4 ACPI/GPIO/TCO");
+	}
+
+	pci_read_config_byte(dev, ICH4_GPIO_CNTL, &enable);
+	if (enable & ICH4_GPIO_EN) {
+		pci_read_config_dword(dev, ICH4_GPIOBASE, &region);
+		quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES + 1,
+				"ICH4 GPIO");
+	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801AA_0,		quirk_ich4_lpc_acpi);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801AB_0,		quirk_ich4_lpc_acpi);
@@ -535,12 +555,21 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
 static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
 {
 	u32 region;
+	u8 enable;
 
-	pci_read_config_dword(dev, 0x40, &region);
-	quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH6 ACPI/GPIO/TCO");
-
-	pci_read_config_dword(dev, 0x48, &region);
-	quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO");
+	pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
+	if (enable & ICH6_ACPI_EN) {
+		pci_read_config_dword(dev, ICH_PMBASE, &region);
+		quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
+				"ICH6 ACPI/GPIO/TCO");
+	}
+
+	pci_read_config_byte(dev, ICH6_GPIO_CNTL, &enable);
+	if (enable & ICH4_GPIO_EN) {
+		pci_read_config_dword(dev, ICH6_GPIOBASE, &region);
+		quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES + 1,
+				"ICH6 GPIO");
+	}
 }
 
 static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)



  parent reply	other threads:[~2011-03-21 23:13 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 23:11 [00/44] 2.6.32.34-longterm review Greg KH
2011-03-21 23:09 ` [01/44] hwmon/f71882fg: Set platform drvdata to NULL later Greg KH
2011-03-21 23:09 ` [02/44] mtd: jedec_probe: Change variable name from cfi_p to cfi Greg KH
2011-03-22  1:58   ` [Stable-review] " Ben Hutchings
2011-03-22 22:25     ` Greg KH
2011-03-21 23:09 ` [03/44] mtd: add "platform:" prefix for platform modalias Greg KH
2011-03-21 23:09 ` [04/44] libata: no special completion processing for EH commands Greg KH
2011-03-21 23:09 ` [05/44] MIPS: MTX-1: Make au1000_eth probe all PHY addresses Greg KH
2011-03-21 23:09 ` [06/44] x86/mm: Handle mm_fault_error() in kernel space Greg KH
2011-03-21 23:09 ` [07/44] ftrace: Fix memory leak with function graph and cpu hotplug Greg KH
2011-03-21 23:09 ` [08/44] x86: Fix panic when handling "mem={invalid}" param Greg KH
2011-03-21 23:09 ` [09/44] x86: Emit "mem=nopentium ignored" warning when not supported Greg KH
2011-03-21 23:09 ` [10/44] ahci: AHCI and RAID mode SATA patch for Intel Patsburg DeviceIDs Greg KH
2011-03-21 23:09 ` [11/44] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Greg KH
2011-03-21 23:09 ` [12/44] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Greg KH
2011-03-21 23:09 ` [13/44] RDMA/cma: Fix crash in request handlers Greg KH
2011-03-21 23:09 ` [14/44] IB/cm: Bump reference count on cm_id before invoking callback Greg KH
2011-03-21 23:09 ` [15/44] x86, quirk: Fix SB600 revision check Greg KH
2011-03-21 23:09 ` [16/44] ath9k_hw: Fix incorrect macversion and macrev checks Greg KH
2011-03-21 23:09 ` [17/44] USB: serial/kobil_sct, fix potential tty NULL dereference Greg KH
2011-03-21 23:09 ` [18/44] USB: serial: ch341: add new id Greg KH
2011-03-21 23:09 ` [19/44] xhci: Fix cycle bit calculation during stall handling Greg KH
2011-03-21 23:10 ` [20/44] ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs Greg KH
2011-03-21 23:10 ` [21/44] PCI: remove quirk for pre-production systems Greg KH
2011-03-21 23:10 ` Greg KH [this message]
2011-03-21 23:10 ` [23/44] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Greg KH
2011-03-21 23:10 ` [24/44] PCI: sysfs: Fix failure path for addition of "vpd" attribute Greg KH
2011-03-21 23:10 ` [25/44] ALSA: ctxfi - Fix incorrect SPDIF status bit mask Greg KH
2011-03-21 23:10 ` [26/44] ALSA: ctxfi - Fix SPDIF status retrieval Greg KH
2011-03-21 23:10 ` [27/44] ALSA: ctxfi - Clear input settings before initialization Greg KH
2011-03-21 23:10 ` [28/44] SUNRPC: Ensure we always run the tk_callback before tk_action Greg KH
2011-03-21 23:10 ` [29/44] perf: Handle stopped state with tracepoints Greg KH
2011-03-21 23:10 ` [30/44] perf, powerpc: Handle events that raise an exception without overflowing Greg KH
2011-03-21 23:10 ` [31/44] ext3: Always set dx_nodes fake_dirent explicitly Greg KH
2011-03-21 23:10 ` [32/44] call_function_many: fix list delete vs add race Greg KH
2011-03-21 23:10 ` [33/44] call_function_many: add missing ordering Greg KH
2011-03-21 23:10 ` [34/44] x86: Flush TLB if PGD entry is changed in i386 PAE mode Greg KH
2011-03-21 23:10 ` [35/44] isdn: avoid calling tty_ldisc_flush() in atomic context Greg KH
2011-03-21 23:10 ` [36/44] smp_call_function_many: handle concurrent clearing of mask Greg KH
2011-03-21 23:10 ` [37/44] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Greg KH
2011-03-21 23:10 ` [38/44] i2c: Fix typo in instantiating-devices document Greg KH
2011-03-21 23:10 ` [39/44] mmc: sdio: remember new card RCA when redetecting card Greg KH
2011-03-21 23:10 ` [40/44] powerpc/kexec: Fix race in kexec shutdown Greg KH
2011-03-21 23:10 ` [41/44] powerpc/kdump: Fix race in kdump shutdown Greg KH
2011-03-21 23:10 ` [42/44] powerpc: rtas_flash needs to use rtas_data_buf Greg KH
2011-03-21 23:10 ` [43/44] x86, binutils, xen: Fix another wrong size directive Greg KH
2011-03-21 23:10 ` [44/44] hwmon: (sht15) Fix integer overflow in humidity calculation Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110321231052.988200630@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bjorn.helgaas@hp.com \
    --cc=davem@davemloft.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=trenn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®