linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Reuben Farrelly <reuben-lkml@reub.net>, Andrew Morton <akpm@osdl.org>
Cc: stern@rowland.harvard.edu, linux-kernel@vger.kernel.org,
	greg@kroah.com,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	neilb@cse.unsw.edu.au, linux-acpi@vger.kernel.org
Subject: [PATCH] Re: [linux-usb-devel] Re: 2.6.15-mm3 [USB lost interrupt bug]
Date: Sat, 21 Jan 2006 03:32:18 -0500	[thread overview]
Message-ID: <43D1F192.3060406@pobox.com> (raw)
In-Reply-To: <43D1E9A4.8090504@reub.net>

[-- Attachment #1: Type: text/plain, Size: 85 bytes --]


On the libata side of things, does this patch produce any useful results?

	Jeff




[-- Attachment #2: patch.pci-region-check --]
[-- Type: text/plain, Size: 1544 bytes --]

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;

       reply	other threads:[~2006-01-21  8:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44L0.0601152243330.1929-100000@netrider.rowland.org>
     [not found] ` <43D1C4E9.7030901@reub.net>
     [not found]   ` <20060120214723.79111715.akpm@osdl.org>
     [not found]     ` <43D1E9A4.8090504@reub.net>
2006-01-21  8:32       ` Jeff Garzik [this message]
2006-01-21 10:41         ` [PATCH] Re: [linux-usb-devel] Re: 2.6.15-mm3 [USB lost interrupt bug] Reuben Farrelly

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=43D1F192.3060406@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=reuben-lkml@reub.net \
    --cc=stern@rowland.harvard.edu \
    /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).