lkml.org 
[lkml]   [2006]   [Jan]   [21]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSat, 21 Jan 2006 03:32:18 -0500
FromJeff Garzik <>
Subject[PATCH] Re: [linux-usb-devel] Re: 2.6.15-mm3 [USB lost interrupt bug]
On the libata side of things, does this patch produce any useful results?

	Jeff



diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 46c4cdb..4691f8d 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4794,7 +4794,14 @@ ata_pci_init_native_mode(struct pci_dev 
 			pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS;
 		probe_ent->port[p].bmdma_addr = pci_resource_start(pdev, 4);
 		ata_std_ports(&probe_ent->port[p]);
-		p++;
+
+		if (pci_resource_start(pdev, 0) &&
+		    pci_resource_len(pdev, 0) &&
+		    pci_resource_start(pdev, 1) &&
+		    pci_resource_len(pdev, 1) &&
+		    pci_resource_start(pdev, 4) &&
+		    pci_resource_len(pdev, 4))
+			p++;
 	}
 
 	if (ports & ATA_PORT_SECONDARY) {
@@ -4804,10 +4811,23 @@ ata_pci_init_native_mode(struct pci_dev 
 			pci_resource_start(pdev, 3) | ATA_PCI_CTL_OFS;
 		probe_ent->port[p].bmdma_addr = pci_resource_start(pdev, 4) + 8;
 		ata_std_ports(&probe_ent->port[p]);
-		p++;
+
+		if (pci_resource_start(pdev, 2) &&
+		    pci_resource_len(pdev, 2) &&
+		    pci_resource_start(pdev, 3) &&
+		    pci_resource_len(pdev, 3) &&
+		    pci_resource_start(pdev, 4) &&
+		    pci_resource_len(pdev, 4) > 8)
+			p++;
 	}
 
 	probe_ent->n_ports = p;
+
+	if (p == 0) {
+		kfree(probe_ent);
+		probe_ent = NULL;
+	}
+
 	return probe_ent;
 }
 
@@ -4815,6 +4835,10 @@ static struct ata_probe_ent *ata_pci_ini
 {
 	struct ata_probe_ent *probe_ent;
 
+	if (!pci_resource_start(pdev, 4) ||
+	    !pci_resource_len(pdev, 4))
+		return NULL;
+
 	probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port);
 	if (!probe_ent)
 		return NULL;
\
 
 \ /
  Last update: 2006-01-21 08:35    [from the cache]
©2003-2008