linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hu Gang <hugang@soulinfo.com>
To: alan@lxorguk.ukuu.org.uk, marcelo@conectiva.com.br,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [Patch]Backport 82801CAM IDE support to 2.4.x
Date: Sun, 22 Sep 2002 13:48:22 +0800	[thread overview]
Message-ID: <20020922134822.6dbf3120.hugang@soulinfo.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1135 bytes --]

Hello all:

At Thu, 12 Sep 2002 09:19:29 +0800, I sended this patch, Now it works fine in my machine. It make faster(~5X) than without it. Please apply.

@@@@@@@@@@@@@@@@ with patch @@@@@@@@@@@@@@
# hdparm -t /dev/hda
/dev/hda:
 Timing buffered disk reads:  64 MB in 15.76 seconds =  4.06 MB/sec
# dmesg 
*** Snip ****
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH3M: IDE controller on PCI bus 00 dev f9
PCI: Device 00:1f.1 not available because of resource collisions
ICH3M: (ide_setup_pci_device:) Could not enable device.
*** Snip ****

@@@@@@@@@@@@@@@@ with patch @@@@@@@@@@@@@@@@@@
# hdparm -t /dev/hda
/dev/hda:
 Timing buffered disk reads:  64 MB in  3.29 seconds = 19.45 MB/sec
# dmesg 
**** Snip ***

ICH3M: IDE controller on PCI bus 00 dev f9
PCI: Enabling device 00:1f.1 (0005 -> 0007)
PCI: Assigned IRQ 5 for device 00:1f.1
ICH3M: chipset revision 2
***** Snip *****
(thanks for Frederic Garzon <garz@free.fr> reported)

I we can add it into 2.4.X kernel. here is it again.
----------------------------------------------

-- 
		- Hu Gang

[-- Attachment #1.2: ich3m.diff --]
[-- Type: text/plain, Size: 2250 bytes --]

--- linux.old/drivers/ide/ide-pci.c	Sun Sep 22 13:45:13 2002
+++ linux/drivers/ide/ide-pci.c	Wed Sep 11 13:44:27 2002
@@ -951,6 +951,42 @@
 	ide_setup_pci_device(dev2, d2);
 }
 
+inline void ide_register_xp_fix(struct pci_dev *dev)
+{
+        int i;
+        unsigned short cmd;
+        unsigned long flags;
+        unsigned long base_address[4] = { 0x1f0, 0x3f4, 0x170, 0x374 };
+
+        local_irq_save(flags);
+        pci_read_config_word(dev, PCI_COMMAND, &cmd);
+        pci_write_config_word(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO);
+        for (i=0; i<4; i++) {
+                dev->resource[i].start = 0;
+                dev->resource[i].end = 0;
+                dev->resource[i].flags = 0;
+        }                                                                        
+        for (i=0; i<4; i++) {                                                    
+                dev->resource[i].start = base_address[i];
+                dev->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
+                pci_write_config_dword(dev,
+                        (PCI_BASE_ADDRESS_0 + (i * 4)),
+                        dev->resource[i].start);
+        }
+        pci_write_config_word(dev, PCI_COMMAND, cmd);
+        local_irq_restore(flags);
+}
+
+void __init fixup_device_piix (struct pci_dev *dev, ide_pci_device_t *d)
+{
+        if (dev->resource[0].start != 0x01F1)
+                ide_register_xp_fix(dev);
+        printk("%s: IDE controller on PCI bus %02x dev %02x\n",
+                d->name, dev->bus->number, dev->devfn);
+        ide_setup_pci_device(dev, d);
+
+}
+
 /*
  * ide_scan_pcibus() gets invoked at boot time from ide.c.
  * It finds all PCI IDE controllers and calls ide_setup_pci_device for them.
@@ -977,6 +1013,8 @@
 		hpt366_device_order_fixup(dev, d);
 	else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20270))
 		pdc20270_device_order_fixup(dev, d);
+        else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_ICH3M))
+                fixup_device_piix(dev, d);
 	else if (!IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL) || (dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
 		if (IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL))
 			printk("%s: unknown IDE controller on PCI bus %02x device %02x, VID=%04x, DID=%04x\n",

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2002-09-22  5:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-22  5:48 Hu Gang [this message]
2002-09-26 17:07 ` [Patch]Backport 82801CAM IDE support to 2.4.x Alan Cox

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=20020922134822.6dbf3120.hugang@soulinfo.com \
    --to=hugang@soulinfo.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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;
as well as URLs for NNTP newsgroup(s).