All of lore.kernel.org
 help / color / mirror / Atom feed
From: jarkap@poczta.onet.pl
To: jgarzik@pobox.com
Cc: linux-ide@vger.kernel.org
Subject: libata-core error handling
Date: Wed, 10 May 2006 14:45:03 -0400	[thread overview]
Message-ID: <20060510184503.GA4852@jarkap.dom.local> (raw)

Hello!

I'd like to suggest some minor changes to improve error reporting
in libata_core.c function ata_device_add().

I had terrible time to find the reason of kernel oops after
enabling in config ACPI without X86_LOCAL_APIC (by the way -
I don't understand why acpi irq routing is used then).

As it turned out messages from libata are very misleading,
because it tries to unregister too much and they cover on the
screen real reasons (bad irq request). No need to tell this
messages aren't added to logs.

I enclose this small diff, which was prepared with kernel
version 2.6.15.4, but it applied to 2.6.16-6 and 2.6.17-rc3
as well. 

Best regards from Poland,

Jarek P.


--- libata-core.c-	2006-02-10 02:22:48.000000000 -0500
+++ libata-core.c	2006-04-23 22:30:14.000000000 -0400
@@ -4357,8 +4357,11 @@
 
 	/* obtain irq, that is shared between channels */
 	if (request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags,
-			DRV_NAME, host_set))
+			DRV_NAME, host_set)) {
+		printk(KERN_ERR "ata: unable to allocate irq %lu\n",
+			ent->irq);
 		goto err_out;
+	}
 
 	/* perform each probe synchronously */
 	DPRINTK("probe begin\n");
@@ -4406,9 +4409,14 @@
 	VPRINTK("EXIT, returning %u\n", ent->n_ports);
 	return ent->n_ports; /* success */
 
+/* FIXME: goto after scsi_add_host
+ * err_out_remove:
+ *	for (i = 0; i < count; i++) {
+ *		ata_host_remove(host_set->ports[i], 1);
+ *	}
+ */
 err_out:
 	for (i = 0; i < count; i++) {
-		ata_host_remove(host_set->ports[i], 1);
 		scsi_host_put(host_set->ports[i]->host);
 	}
 err_free_ret:

                 reply	other threads:[~2006-05-10 12:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060510184503.GA4852@jarkap.dom.local \
    --to=jarkap@poczta.onet.pl \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.