How to apply kernel patch?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

How to apply kernel patch?

#1 Post by jrb »

Hi, Recently I have acquired an Everex Stepnote sa2053t laptop. This machine has memory conflicts with MMIO for 8139too and sdhci modules.

I have been able to compile an 8139too PIO module and remove the two sdhci modules and get it to boot Puppy431 which gives me Lan access but no card reader.

There is a kernel patch for this problem, H12Y mmio patch, available at http://bugzilla.kernel.org/show_bug.cgi?id=10231. I have applied the patch and it indicates success but it has not cured either problem.

I'm hoping someone can explain to me where this correction should be applied in kernel 2.6.30.5 in order to be successful.

Code: Select all

--- linux/drivers/pci/quirks.c	2008-09-08 20:33:16.000000000 +0200
+++ linux/drivers/pci/quirks.c	2008-10-06 16:37:35.000000000 +0200
@@ -1381,6 +1381,82 @@
 			 PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE,
 			 quirk_tc86c001_ide);
 
+/*
+ * The Twinhad H12Y assign mmio (0xffbfe800-0xffbfecff)
+ * resources that seems to be used by an unknown device.
+ * This quirk reserve more than really used mmio space to
+ * force change the mmio area of the cardreader and the network chip.
+ * See http://bugzilla.kernel.org/show_bug.cgi?id=10231
+ * and http://bugzilla.kernel.org/show_bug.cgi?id=9905
+ * for more details
+ */
+static void __init quirk_h12y_1_mmio(struct pci_dev *dev)
+{
+/*
+ * Network Device: Realtek 8139C of Twinhead H12Y
+ * PCI VENDOR: 0x10EC PCI ID:0x8139
+ * SUB VENDOR: 0x14FF SUB ID:0xA003
+ */
+	struct resource *r = &dev->resource[1];
+	if ((dev->subsystem_vendor) == 0x14FF &&
+	    (dev->subsystem_device) == 0xA003) {
+		r->start = 0;
+		r->end = 0x03ff;
+	}	
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK,
+			PCI_DEVICE_ID_REALTEK_8139,
+			quirk_h12y_1_mmio);
+
+static void __init quirk_h12y_2_mmio(struct pci_dev *dev)
+{
+/*
+ * SD-Cardreader Device: O2 7120 of Twinhead H12Y
+ * PCI VENDOR: 0x1217 PCI ID:0x7120
+ * SUB VENDOR: 0x14FF SUB ID:0xA003
+ */
+	struct resource *r = &dev->resource[0];
+	if ((dev->subsystem_vendor) == 0x14FF &&
+	    (dev->subsystem_device) == 0xA003) {
+		r->start = 0;
+		r->end = 0x03ff;
+	}	
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_O2,0x7120,quirk_h12y_2_mmio);
+
+static void __init quirk_h12y_3_mmio(struct pci_dev *dev)
+{
+/*
+ * Firewire Device: O2 00F7 of Twinhead H12Y
+ * PCI VENDOR: 0x1217 PCI ID:0x00F7
+ * SUB VENDOR: 0x14FF SUB ID:0xA003
+ */
+	struct resource *r = &dev->resource[1];
+	if ((dev->subsystem_vendor) == 0x14FF &&
+	    (dev->subsystem_device) == 0xA003) {
+		r->start = 0;
+		r->end = 0x0fff;
+	}	
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_O2,0x00F7,quirk_h12y_3_mmio);
+
+static void __init quirk_h12y_4_mmio(struct pci_dev *dev)
+{
+/*
+ * MS-Cardreader Device: O2 7130 of Twinhead H12Y
+ * PCI VENDOR: 0x1217 PCI ID:0x7130
+ * SUB VENDOR: 0x14FF SUB ID:0xA003
+ */
+	struct resource *r = &dev->resource[0];
+	if ((dev->subsystem_vendor) == 0x14FF &&
+	    (dev->subsystem_device) == 0xA003) {
+		r->start = 0;
+		r->end = 0x1fff;
+	}	
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_O2,0x7130,quirk_h12y_4_mmio);
+
+
 static void __devinit quirk_netmos(struct pci_dev *dev)
 {
 	unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;
Any help will be much appreciated. Thanks, J

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

copy the patch into the toplevel of the sources, then cd into the toplevel of the sources and run:
patch -p1 < *.diff

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

No more need!

#3 Post by jrb »

Please see 8139too problem on Everex sa2053t laptop [TOTAL SOLUTION!] for a simple TOTAL SOLUTION! :shock: :D

Post Reply