diff options
author | Greg KH <greg@press.(none)> | 2005-10-26 11:07:19 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-26 11:07:19 -0700 |
commit | a665c1221d3a0b406c1ac61f8141e9f6e1a68224 (patch) | |
tree | f4a3ca04428974dd9b338ab2507dea75ed84489a /pci | |
parent | 4858a9f03aa022fc6f70022c6a8f99a3fec7afc6 (diff) | |
download | patches-a665c1221d3a0b406c1ac61f8141e9f6e1a68224.tar.gz |
pci patches
Diffstat (limited to 'pci')
-rw-r--r-- | pci/pci-fixup-for-toshiba-laptops-and-ohci1394.patch | 103 | ||||
-rw-r--r-- | pci/pci_ids-cleanup-comments.patch | 53 |
2 files changed, 156 insertions, 0 deletions
diff --git a/pci/pci-fixup-for-toshiba-laptops-and-ohci1394.patch b/pci/pci-fixup-for-toshiba-laptops-and-ohci1394.patch new file mode 100644 index 0000000000000..18dbfa1338018 --- /dev/null +++ b/pci/pci-fixup-for-toshiba-laptops-and-ohci1394.patch @@ -0,0 +1,103 @@ +From owner-linux-pci@atrey.karlin.mff.cuni.cz Tue Oct 25 10:30:29 2005 +From: Jesse Barnes <jbarnes@virtuousgeek.org> +To: Greg KH <greg@kroah.com> +Subject: PCI fixup for Toshiba laptops and ohci1394 +Date: Tue, 25 Oct 2005 10:28:42 -0700 +Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>, gregkh@suse.de, rob@janerob.com, akpm@osdl.org +Message-Id: <200510251028.43158.jbarnes@virtuousgeek.org> + + +This is a fix for a bug I see on my Toshiba laptop, where the ohci1394 +controller gets initialized improperly. The patch adds two PCI fixups +to arch/i386/pci/fixup.c, one that happens early on to cache the value +of the PCI_CACHE_LINE_SIZE config register, and another that later +restores the value, along with a valid IRQ number and some BAR values. +I've tested it on my laptop, and it prevents me from running into what I +consider to be a major bug: IRQ 11 is disabled by the IRQ debug code, +causing my wireless to break. + +Thanks to Rob for the original patch to ohci1394.c and Stefan for lots +of proofreading (and a last minute bug caught in review!) and additional +information collection. I think the DMI system list is correct, but we +may need to add some more PCI IDs to the PCI_FIXUP macros over time. + + +Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/i386/pci/fixup.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 59 insertions(+) + +--- gregkh-2.6.orig/arch/i386/pci/fixup.c ++++ gregkh-2.6/arch/i386/pci/fixup.c +@@ -2,6 +2,8 @@ + * Exceptions for specific devices. Usually work-arounds for fatal design flaws. + */ + ++#include <linux/delay.h> ++#include <linux/dmi.h> + #include <linux/pci.h> + #include <linux/init.h> + #include "pci.h" +@@ -384,3 +386,60 @@ static void __devinit pci_fixup_video(st + } + } + DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); ++ ++/* ++ * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A. ++ * ++ * We pretend to bring them out of full D3 state, and restore the proper ++ * IRQ, PCI cache line size, and BARs, otherwise the device won't function ++ * properly. In some cases, the device will generate an interrupt on ++ * the wrong IRQ line, causing any devices sharing the the line it's ++ * *supposed* to use to be disabled by the kernel's IRQ debug code. ++ */ ++static u16 toshiba_line_size; ++ ++static struct dmi_system_id __devinit toshiba_ohci1394_dmi_table[] = { ++ { ++ .ident = "Toshiba PS5 based laptop", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "PS5"), ++ }, ++ }, ++ { ++ .ident = "Toshiba PSM4 based laptop", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"), ++ }, ++ }, ++ { } ++}; ++ ++static void __devinit pci_pre_fixup_toshiba_ohci1394(struct pci_dev *dev) ++{ ++ if (!dmi_check_system(toshiba_ohci1394_dmi_table)) ++ return; /* only applies to certain Toshibas (so far) */ ++ ++ dev->current_state = PCI_D3cold; ++ pci_read_config_word(dev, PCI_CACHE_LINE_SIZE, &toshiba_line_size); ++} ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0x8032, ++ pci_pre_fixup_toshiba_ohci1394); ++ ++static void __devinit pci_post_fixup_toshiba_ohci1394(struct pci_dev *dev) ++{ ++ if (!dmi_check_system(toshiba_ohci1394_dmi_table)) ++ return; /* only applies to certain Toshibas (so far) */ ++ ++ /* Restore config space on Toshiba laptops */ ++ mdelay(10); ++ pci_write_config_word(dev, PCI_CACHE_LINE_SIZE, toshiba_line_size); ++ pci_write_config_word(dev, PCI_INTERRUPT_LINE, dev->irq); ++ pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, ++ pci_resource_start(dev, 0)); ++ pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, ++ pci_resource_start(dev, 1)); ++} ++DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_TI, 0x8032, ++ pci_post_fixup_toshiba_ohci1394); diff --git a/pci/pci_ids-cleanup-comments.patch b/pci/pci_ids-cleanup-comments.patch new file mode 100644 index 0000000000000..24f44ba6f6a20 --- /dev/null +++ b/pci/pci_ids-cleanup-comments.patch @@ -0,0 +1,53 @@ +From grant_lkml@dodo.com.au Wed Oct 19 17:35:07 2005 +From: Grant Coady <grant_lkml@dodo.com.au> +To: Greg KH <greg@kroah.com> +Cc: Grant Coady <gcoady@gmail.com>, Roland Dreier <rolandd@cisco.com> +Subject: pci_ids: cleanup comments +Date: Thu, 20 Oct 2005 09:55:32 +1000 +Message-ID: <64ndl1lf0q1o4hqh23u38i2pd4v9oam8d8@4ax.com> + +From: Grant Coady <gcoady@gmail.com> + +pci_ids.h cleanup: convert // comment to /* comment */ + +Signed-off-by: Grant Coady <gcoady@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + include/linux/pci_ids.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- gregkh-2.6.orig/include/linux/pci_ids.h ++++ gregkh-2.6/include/linux/pci_ids.h +@@ -447,7 +447,7 @@ + #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251 + #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 + +-#define PCI_VENDOR_ID_COMPEX2 0x101a // pci.ids says "AT&T GIS (NCR)" ++#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ + #define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 + + #define PCI_VENDOR_ID_WD 0x101c +@@ -1160,10 +1160,10 @@ + + #define PCI_VENDOR_ID_INIT 0x1101 + +-#define PCI_VENDOR_ID_CREATIVE 0x1102 // duplicate: ECTIVA ++#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ + #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 + +-#define PCI_VENDOR_ID_ECTIVA 0x1102 // duplicate: CREATIVE ++#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ + #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 + + #define PCI_VENDOR_ID_TTI 0x1103 +@@ -1173,7 +1173,7 @@ + #define PCI_DEVICE_ID_TTI_HPT302 0x0006 + #define PCI_DEVICE_ID_TTI_HPT371 0x0007 + #define PCI_DEVICE_ID_TTI_HPT374 0x0008 +-#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 // apparently a 372N variant? ++#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 /* apparently a 372N variant? */ + + #define PCI_VENDOR_ID_VIA 0x1106 + #define PCI_DEVICE_ID_VIA_8763_0 0x0198 |