public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] starfire reads irq before pci_enable_device.
@ 2001-02-07 19:52 davej
  2001-02-07 19:57 ` Jeff Garzik
  0 siblings, 1 reply; 51+ messages in thread
From: davej @ 2001-02-07 19:52 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan Cox, Linux Kernel Mailing List


> rejected -- ioaddr assigned a value before pci_enable_device is called

Better ?

Dave.

-- 
| Dave Jones.        http://www.suse.de/~davej
| SuSE Labs

diff -urN --exclude-from=/home/davej/.exclude linux/drivers/net/starfire.c linux-dj/drivers/net/starfire.c
--- linux/drivers/net/starfire.c	Wed Feb  7 12:42:42 2001
+++ linux-dj/drivers/net/starfire.c	Wed Feb  7 19:47:54 2001
@@ -396,12 +396,6 @@
 		printk(KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s",
 		       version1, version2, version3);

-	ioaddr = pci_resource_start (pdev, 0);
-	if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) {
-		printk (KERN_ERR "starfire %d: no PCI MEM resources, aborting\n", card_idx);
-		return -ENODEV;
-	}
-
 	dev = init_etherdev(NULL, sizeof(*np));
 	if (!dev) {
 		printk (KERN_ERR "starfire %d: cannot alloc etherdev, aborting\n", card_idx);
@@ -409,6 +403,14 @@
 	}
 	SET_MODULE_OWNER(dev);

+	if (pci_enable_device (pdev))
+		goto err_out_free_netdev;
+
+	ioaddr = pci_resource_start (pdev, 0);
+	if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_MEM) == 0)) {
+		printk (KERN_ERR "starfire %d: no PCI MEM resources, aborting\n", card_idx);
+		return -ENODEV;
+	}
 	irq = pdev->irq;

 	if (request_mem_region (ioaddr, io_size, dev->name) == NULL) {
@@ -416,10 +418,7 @@
 			card_idx, io_size, ioaddr);
 		goto err_out_free_netdev;
 	}
-
-	if (pci_enable_device (pdev))
-		goto err_out_free_res;
-
+
 	ioaddr = (long) ioremap (ioaddr, io_size);
 	if (!ioaddr) {
 		printk (KERN_ERR "starfire %d: cannot remap 0x%x @ 0x%lx, aborting\n",


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 51+ messages in thread
* Re: [PATCH] starfire reads irq before pci_enable_device.
@ 2001-02-14 16:54 Petr Vandrovec
  2001-02-15 16:09 ` Jes Sorensen
  0 siblings, 1 reply; 51+ messages in thread
From: Petr Vandrovec @ 2001-02-14 16:54 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: Jeff Garzik, Ion Badulescu, Alan Cox, linux-kernel, becker

On 14 Feb 01 at 16:35, Jes Sorensen wrote:
> >>>>> "Donald" == Donald Becker <becker@scyld.com> writes:
> Donald> On 12 Feb 2001, Jes Sorensen wrote:

> Donald> ???  - It's not just IPX hosts that send 802.3 headers.  -
> Donald> While a good initial value might depend on the architecture,
> Donald> the best setting is processor implementation and environment
> Donald> dependent.  Those details are not known at compile time.  -
> Donald> The code path cost of a module option is only a compare and a
> Donald> conditional branch.
> 
> What else is sending out 802.3 frames these days? I really don't care
> about IPX when it comes to performance.
> 
> I am just advocating that we optimize for the common case which is DIX
> frames and not 802.3.

Pardon me, but IPX in 802.3 and IPX in DIX are exactly same frames
on wire, except that IPX/802.3 contains frame length in bytes
0x0C/0x0D, while IPX/DIX contains 0x8137 here. They have same length,
and same length of media header, so I really do not understand.

If you are talking about encapsulation which is known as `ethernet_802.2' 
in IPX world, then it is true, it has odd bytes in header. But nobody sane 
except Appletalk uses 802.2 now... Our Suns already died due to this couple 
of years ago ;-)

And as Ethernet SNAP has 8byte long header, it should be safe too, unless
architecture requires 16byte alignment - so only odd 802.2 should
be baned.
                                            Best regards,
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    

^ permalink raw reply	[flat|nested] 51+ messages in thread
* [PATCH] starfire reads irq before pci_enable_device.
@ 2001-02-07 18:42 davej
  0 siblings, 0 replies; 51+ messages in thread
From: davej @ 2001-02-07 18:42 UTC (permalink / raw)
  To: Alan Cox; +Cc: becker, Linux Kernel Mailing List


Hi Alan, Donald,

This driver should call pci_enable_device before reading
pdev->irq.

regards,

Dave.

-- 
| Dave Jones.        http://www.suse.de/~davej
| SuSE Labs

diff -urN --exclude-from=/home/davej/.exclude linux/drivers/net/starfire.c linux-dj/drivers/net/starfire.c
--- linux/drivers/net/starfire.c	Wed Feb  7 12:42:42 2001
+++ linux-dj/drivers/net/starfire.c	Wed Feb  7 18:34:22 2001
@@ -409,6 +409,9 @@
 	}
 	SET_MODULE_OWNER(dev);

+	if (pci_enable_device (pdev))
+		goto err_out_free_netdev;
+
 	irq = pdev->irq;

 	if (request_mem_region (ioaddr, io_size, dev->name) == NULL) {
@@ -416,10 +419,7 @@
 			card_idx, io_size, ioaddr);
 		goto err_out_free_netdev;
 	}
-
-	if (pci_enable_device (pdev))
-		goto err_out_free_res;
-
+
 	ioaddr = (long) ioremap (ioaddr, io_size);
 	if (!ioaddr) {
 		printk (KERN_ERR "starfire %d: cannot remap 0x%x @ 0x%lx, aborting\n",

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2001-02-19 11:03 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-07 19:52 [PATCH] starfire reads irq before pci_enable_device davej
2001-02-07 19:57 ` Jeff Garzik
2001-02-07 20:34   ` Manfred Spraul
2001-02-08  4:00     ` Jeff Garzik
2001-02-08  1:52   ` Ion Badulescu
2001-02-08 20:28     ` Jeff Garzik
2001-02-08 21:18       ` Ion Badulescu
2001-02-08 21:38         ` Jeff Garzik
2001-02-08 22:05           ` Ion Badulescu
2001-02-09 19:08             ` Jeff Garzik
2001-02-09 20:07               ` Ion Badulescu
2001-02-09 20:11                 ` Jeff Garzik
2001-02-09 20:21                   ` Ion Badulescu
2001-02-09 20:26                     ` Jeff Garzik
2001-02-08 21:43         ` Manfred Spraul
2001-02-08 21:46           ` Ion Badulescu
2001-02-09 21:43           ` Jes Sorensen
2001-02-09 21:52             ` Ion Badulescu
2001-02-12 18:54               ` Jes Sorensen
2001-02-14  1:35                 ` Ion Badulescu
2001-02-10 14:48             ` Manfred Spraul
2001-02-08 21:26       ` Donald Becker
2001-02-08 22:16         ` Ion Badulescu
2001-02-09  0:09           ` Ion Badulescu
2001-02-09  0:44           ` Donald Becker
2001-02-09  0:47             ` Ion Badulescu
2001-02-09 10:49             ` Alan Cox
2001-02-09 23:32               ` Ion Badulescu
2001-02-09 23:35                 ` Alan Cox
2001-02-10  8:48                   ` Gérard Roudier
2001-02-12 19:01                     ` Jes Sorensen
2001-02-13 13:06                       ` Jeff Garzik
2001-02-13 20:29                         ` Ion Badulescu
2001-02-14  2:05                           ` Ion Badulescu
2001-02-14 20:10                             ` Gérard Roudier
2001-02-14 15:39                         ` Jes Sorensen
2001-02-17 21:34                         ` David S. Miller
2001-02-19 11:00                           ` Jes Sorensen
2001-02-09 21:42       ` Jes Sorensen
2001-02-09 22:56         ` Donald Becker
2001-02-12 18:54           ` Jes Sorensen
2001-02-14  1:20             ` Donald Becker
2001-02-14 12:37               ` Alan Cox
2001-02-14 12:49                 ` Jeff Garzik
2001-02-14 12:54                   ` Ion Badulescu
2001-02-14 13:05                     ` Alan Cox
2001-02-14 13:38                       ` Ion Badulescu
2001-02-14 15:35               ` Jes Sorensen
  -- strict thread matches above, loose matches on Subject: below --
2001-02-14 16:54 Petr Vandrovec
2001-02-15 16:09 ` Jes Sorensen
2001-02-07 18:42 davej

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