public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  PCI probing status cleanup
@ 2001-07-10  6:56 Tim Hockin
  2001-07-10 12:37 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Hockin @ 2001-07-10  6:56 UTC (permalink / raw)
  To: mj; +Cc: alan, Linux Kernel Mailing List

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

Martin et al,

Attached is a tiny patch that clears the master abort bit on bridges when
probing PCI devices.

Please let me know if there is any reason this would not be included in the
mainline kernel.

Thanks
Tim

-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

[-- Attachment #2: pci_bridge.diff --]
[-- Type: text/plain, Size: 867 bytes --]

diff -ruN dist-2.4.6/drivers/pci/pci.c cobalt-2.4.6/drivers/pci/pci.c
--- dist-2.4.6/drivers/pci/pci.c	Mon Jul  2 14:42:53 2001
+++ cobalt-2.4.6/drivers/pci/pci.c	Mon Jul  9 11:04:01 2001
@@ -1229,8 +1233,19 @@
 		return NULL;
 
 	/* some broken boards return 0 or ~0 if a slot is empty: */
-	if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000)
+	if (l == 0xffffffff || l == 0x00000000 
+	 || l == 0x0000ffff || l == 0xffff0000) {
+		/*
+		 * host/pci and pci/pci bridges will set Received Master Abort
+		 * (bit 13) on failed configuration access (happens when
+		 * searching for devices).  To be safe, clear the status
+		 * register.
+		 */
+		unsigned short st;
+		pci_read_config_word(temp, PCI_STATUS, &st);
+		pci_write_config_word(temp, PCI_STATUS, st);
 		return NULL;
+	}
 
 	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH]  PCI probing status cleanup
  2001-07-10  6:56 [PATCH] PCI probing status cleanup Tim Hockin
@ 2001-07-10 12:37 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2001-07-10 12:37 UTC (permalink / raw)
  To: Tim Hockin; +Cc: mj, alan, Linux Kernel Mailing List

Tim Hockin wrote:
>         /* some broken boards return 0 or ~0 if a slot is empty: */
> -       if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000)
> +       if (l == 0xffffffff || l == 0x00000000
> +        || l == 0x0000ffff || l == 0xffff0000) {
> +               /*
> +                * host/pci and pci/pci bridges will set Received Master Abort
> +                * (bit 13) on failed configuration access (happens when
> +                * searching for devices).  To be safe, clear the status
> +                * register.
> +                */
> +               unsigned short st;
> +               pci_read_config_word(temp, PCI_STATUS, &st);
> +               pci_write_config_word(temp, PCI_STATUS, st);
>                 return NULL;
> +       }

ok, though I wonder if we shouldn't just clear status for all PCI
devices on boot for paranoia's sake.

-- 
Jeff Garzik      | A recent study has shown that too much soup
Building 1024    | can cause malaise in laboratory mice.
MandrakeSoft     |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-10 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-10  6:56 [PATCH] PCI probing status cleanup Tim Hockin
2001-07-10 12:37 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox