mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan <alan@lxorguk.ukuu.org.uk>
To: Alan <alan@lxorguk.ukuu.org.uk>
Cc: Ricardo Lugo <ricardolugo@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: hang booting onboard HPT 366 with libata (PATA)
Date: Sat, 2 Dec 2006 13:03:17 +0000	[thread overview]
Message-ID: <20061202130317.273abf75@localhost.localdomain> (raw)
In-Reply-To: <20061202111928.428e83d2@localhost.localdomain>

On Sat, 2 Dec 2006 11:19:28 +0000
Alan <alan@lxorguk.ukuu.org.uk> wrote:

> > ACPI: PCI Interrup 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
> > ata5: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
> > ata6: PATA max UDMA/66 cmd 0x0 ctl 0x2 bmdma 0xEC08 irq 16
> 
> Ok so the underlying problem seems to be that the second channel of the
> card had no I/O resource assigned to it, presumably because it wasn't in
> use. We check various other "not in use" things but not that one.
> 
> I'll fix that up. I think it just needs another check in libata-sff.

Try the following

--- drivers/ata/libata-sff.c~	2006-12-02 12:39:32.985707472 +0000
+++ drivers/ata/libata-sff.c	2006-12-02 12:39:32.985707472 +0000
@@ -826,6 +826,21 @@
 }
 
 #ifdef CONFIG_PCI
+
+static int ata_resources_present(struct pci_dev *pdev, int port)
+{
+	int i;
+	
+	/* Check the PCI resources for this channel are enabled */
+	port = port * 2;
+	for (i = 0; i < 2; i ++) {
+		if (pci_resource_start(pdev, port + i) == 0 ||
+			pci_resource_len(pdev, port + i) == 0)
+		return 0;
+	}
+	return 1;
+}
+		
 /**
  *	ata_pci_init_native_mode - Initialize native-mode driver
  *	@pdev:  pci device to be initialized
@@ -857,6 +872,13 @@
 
 	probe_ent->irq = pdev->irq;
 	probe_ent->irq_flags = IRQF_SHARED;
+	
+	/* Discard disabled ports. Some controllers show their
+	   unused channels this way */
+	if (ata_resources_present(pdev, 0) == 0)
+		ports &= ~ATA_PORT_PRIMARY;
+	if (ata_resources_present(pdev, 1) == 0)
+		ports &= ~ATA_PORT_SECONDARY;
 
 	if (ports & ATA_PORT_PRIMARY) {
 		probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0);

  reply	other threads:[~2006-12-02 12:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-02  2:13 Ricardo Lugo
2006-12-02 11:19 ` Alan
2006-12-02 13:03   ` Alan [this message]
2006-12-02 18:54     ` Ricardo Lugo
2006-12-02 20:39       ` Alan

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=20061202130317.273abf75@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricardolugo@gmail.com \
    /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

all inboxes | Powered by JetHome®