mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Chris Li" <lkml@chrisli.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: irq 19: nobody cared
Date: Sat, 20 Sep 2008 14:35:48 -0700	[thread overview]
Message-ID: <86802c440809201435l6fdb7c90u59b6b816efb7f2f6@mail.gmail.com> (raw)
In-Reply-To: <70318cbf0809191532n6ebaa122v7d98815c8a65850b@mail.gmail.com>

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

On Fri, Sep 19, 2008 at 3:32 PM, Chris Li <lkml@chrisli.org> wrote:
> On Fri, Sep 19, 2008 at 2:57 PM, Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>>
>> 0x1a.2
>> 0x1d.1
>> 0x1f.2
>> 0x1f.5
>>
>> are sharing pin 0x19...
>>
>> but early dump can not find 0x1a.2, 0x1f.2, 0x1f.5
>
> But later kernel does able to find those devices. Do you mean
> there is a bug in the early PCI scanning?
>

please apply attached patch and boot with pci=dump

YH

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0006-pci-dump-pci-config-space-before-loading-driver.patch --]
[-- Type: text/x-patch; name=0006-pci-dump-pci-config-space-before-loading-driver.patch, Size: 2591 bytes --]

From 14f8de9b3985f1b58f99dee3e32b4969af8c6693 Mon Sep 17 00:00:00 2001
From: Yinghai Lu <yhlu.kernel@gmail.com>
Date: Sat, 20 Sep 2008 13:51:01 -0700
Subject: [PATCH 06/25] pci: dump pci config space before loading driver

try to figure out why get extra irq that confusing the drivers.

and sometime pci=earlydump doesn't dump some device, because late quirks
unhide some pci devices...

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
 drivers/pci/pci.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index a9301a2..9ed0187 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -27,6 +27,8 @@ unsigned int pci_pm_d3_delay = 10;
 int pci_domains_supported = 1;
 #endif
 
+static int pci_dump_regs = 0;
+
 #define DEFAULT_CARDBUS_IO_SIZE		(256)
 #define DEFAULT_CARDBUS_MEM_SIZE	(64*1024*1024)
 /* pci=cbmemsize=nnM,cbiosize=nn can override this */
@@ -1871,6 +1873,43 @@ static void __devinit pci_no_domains(void)
 #endif
 }
 
+static void __devinit pci_dump(void)
+{
+	pci_dump_regs = 1;
+}
+
+static void dump_pci_device_range(struct pci_dev *dev, unsigned start_reg, unsigned size)
+{
+        int i;
+        int j;
+	u32 val;
+        int end = start_reg + size;
+
+	printk("PCI: %s", pci_name(dev));
+
+        for (i = start_reg; i < end; i += 4) {
+                if (!(i & 0x0f))
+                        printk("\n%04x:",i);
+
+                pci_read_config_dword(dev, i, &val);
+                for (j = 0; j < 4; j++) {
+                        printk(" %02x", val & 0xff);
+                        val >>= 8;
+                }
+        }
+        printk("\n");
+}
+
+static int dump_pci_devices(void)
+{
+	struct pci_dev *dev = NULL;
+
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+		dump_pci_device_range(dev, 0, dev->cfg_size);
+	}
+	return 0;
+}
+
 static int __devinit pci_init(void)
 {
 	struct pci_dev *dev = NULL;
@@ -1878,6 +1917,9 @@ static int __devinit pci_init(void)
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pci_fixup_device(pci_fixup_final, dev);
 	}
+
+	if (pci_dump_regs)
+		dump_pci_devices();
 	return 0;
 }
 
@@ -1894,6 +1936,8 @@ static int __devinit pci_setup(char *str)
 				pci_no_aer();
 			} else if (!strcmp(str, "nodomains")) {
 				pci_no_domains();
+			} else if (!strcmp(str, "dump")) {
+				pci_dump();
 			} else if (!strncmp(str, "cbiosize=", 9)) {
 				pci_cardbus_io_size = memparse(str + 9, &str);
 			} else if (!strncmp(str, "cbmemsize=", 10)) {
-- 
1.5.6


  reply	other threads:[~2008-09-20 21:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-19 20:40 Chris Li
2008-09-19 20:50 ` Yinghai Lu
2008-09-19 21:13   ` Chris Li
2008-09-19 21:57     ` Yinghai Lu
2008-09-19 22:32       ` Chris Li
2008-09-20 21:35         ` Yinghai Lu [this message]
2008-09-20 22:04           ` Chris Li
2008-09-20 22:22             ` Yinghai Lu
2008-09-20 23:21               ` Chris Li
2008-09-22 23:30                 ` Chris Li
2008-09-23  1:32                   ` Yinghai Lu
2008-09-23  2:22                     ` Chris Li
2008-09-23  2:34                       ` Yinghai Lu
2008-09-23  5:08                         ` Chris Li
2008-09-19 22:38 ` Alan Cox
2008-09-19 23:13   ` Chris Li
2008-09-28 22:23     ` Alan Cox
2008-09-21  0:23 ` Dave Airlie
2008-09-21  1:00   ` Chris Li
2008-10-19  4:05 ` Steven Rostedt
2008-10-19  6:34   ` Chris Li
2008-10-19  8:02     ` Justin P. Mattock
2008-10-19  8:17       ` Chris Li
2008-10-19 15:53         ` Justin P. Mattock

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=86802c440809201435l6fdb7c90u59b6b816efb7f2f6@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@chrisli.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 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®