* Re: [Bugme-new] [Bug 6468] New: sky2 driver doesnt work in 2.6.16-r3, -r4 but was working in 2.6.15-r8
From: Andrew Morton @ 2006-05-01 1:15 UTC (permalink / raw)
To: a.kulakov; +Cc: netdev, bugme-daemon@kernel-bugs.osdl.org
In-Reply-To: <200605010011.k410BCd1023886@fire-2.osdl.org>
(Please resond via reply-to-all, not via the bugzilla UI)
bugme-daemon@bugzilla.kernel.org wrote:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=6468
>
> Summary: sky2 driver doesnt work in 2.6.16-r3,-r4 but was working
> in 2.6.15-r8
> Kernel Version: 2.6.16-r4
> Status: NEW
> Severity: high
> Owner: jgarzik@pobox.com
> Submitter: a.kulakov@mail.ru
>
>
> Most recent kernel where this bug did not occur:
> 2.6.15-r8
>
> Distribution:
> gentoo
>
> Hardware Environment:
> Asus A38, Pentium-M 2.0GHz, 1024M RAM, Marvell Technology Group Ltd. 88E8053
> PCI-E Gigabit Ethernet Controller (rev 19)
>
> Problem Description:
> No packets are received by programs while ifconfig counts them. No iptables
> rules in effect and all chans policies set to ACCEPT.
> dhcpcd fails to get response from server. tcpdump doesnt show any incoming
> packets while shows outgoing. ifconfig indicates that both rx and tx get increased!
>
> That driver was working for me till 2.6.15-r8. It doesn't work with 2.6.16-r3
> nor -r4. I didn't try earlier 2.6.16 kernels but will do that if needed.
>
> I tried to load module with disable_msi=1 but it didn't make any difference.
>
> Steps to reproduce:
> modprobe sky2 debug=16
> dhcpcd eth0
> tcpdump -n -i eth0
>
I assume that when you say "2.6.16-r4" you actually mean "2.6.16-rc4"? Or
do you mean 2.6.16.4? It matters rather a lot.
So, please confirm the earliest known-to-be-broken kernel version and the
latest known-to-be-working version, using the correct release
identification, thanks.
^ permalink raw reply
* Re: [Bugme-new] [Bug 6468] New: sky2 driver doesnt work in 2.6.16-r3, -r4 but was working in 2.6.15-r8
From: Alexander Kulakov @ 2006-05-01 4:32 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, bugme-daemon@kernel-bugs.osdl.org
In-Reply-To: <20060430181543.6e38a842.akpm@osdl.org>
Andrew Morton wrote:
> (Please resond via reply-to-all, not via the bugzilla UI)
>
> bugme-daemon@bugzilla.kernel.org wrote:
>
>> http://bugzilla.kernel.org/show_bug.cgi?id=6468
>>
>> Summary: sky2 driver doesnt work in 2.6.16-r3,-r4 but was working
>> in 2.6.15-r8
>> Kernel Version: 2.6.16-r4
>> Status: NEW
>> Severity: high
>> Owner: jgarzik@pobox.com
>> Submitter: a.kulakov@mail.ru
>>
>>
>> Most recent kernel where this bug did not occur:
>> 2.6.15-r8
>>
>> Distribution:
>> gentoo
>>
>> Hardware Environment:
>> Asus A38, Pentium-M 2.0GHz, 1024M RAM, Marvell Technology Group Ltd. 88E8053
>> PCI-E Gigabit Ethernet Controller (rev 19)
>>
>> Problem Description:
>> No packets are received by programs while ifconfig counts them. No iptables
>> rules in effect and all chans policies set to ACCEPT.
>> dhcpcd fails to get response from server. tcpdump doesnt show any incoming
>> packets while shows outgoing. ifconfig indicates that both rx and tx get increased!
>>
>> That driver was working for me till 2.6.15-r8. It doesn't work with 2.6.16-r3
>> nor -r4. I didn't try earlier 2.6.16 kernels but will do that if needed.
>>
>> I tried to load module with disable_msi=1 but it didn't make any difference.
>>
>> Steps to reproduce:
>> modprobe sky2 debug=16
>> dhcpcd eth0
>> tcpdump -n -i eth0
>>
>>
>
> I assume that when you say "2.6.16-r4" you actually mean "2.6.16-rc4"? Or
> do you mean 2.6.16.4? It matters rather a lot.
>
> So, please confirm the earliest known-to-be-broken kernel version and the
> latest known-to-be-working version, using the correct release
> identification, thanks.
>
>
>
My apologies. That was false alert. It seems to be Gentoo kernel patches
problem.
I just finished checking kernels from kernel.org and found 2.6.16,
2.6.16.6 and 2.6.16.11 to be working well.
Sorry for wasting your time
^ permalink raw reply
* Re: [PATCH 2/6] tg3: Add phy workaround
From: Michael Chan @ 2006-05-01 4:45 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
David S. Miller wrote:
> From: "Michael Chan" <mchan@broadcom.com>
> Date: Fri, 28 Apr 2006 16:35:19 -0700
>
> > Add some PHY workaround code to reduce jitter on some PHYs.
> >
> > Signed-off-by: Michael Chan <mchan@broadcom.com>
>
> Applied, thanks.
>
> It really bugs me that all of this indirect addressing into
> the DSP is done with magic addresses and register values. It
> would be great to get some defined in tg3.h that documented
> the DSP register set properly.
>
Ok, will add some constants next time.
^ permalink raw reply
* Re: tw32_f() in tg3_write_mem()
From: Michael Chan @ 2006-05-01 5:05 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
David S. Miller wrote:
> At least for the TG3PCI_MEM_WIN_DATA register, I don't know how safe
> it is to use tw32_f() there. Reads from a location can have side
> effects, so doing a forced readback after a write could be dangerous.
>
> And it isn't needed, as the tw32_f() done as we set the
> TG3PCI_MEM_WIN_BASE_ADDR back to zero will flush all posted
> writes.
>
> Agreed?
>
>
The TG3PCI_MEM_WIN_BASE_ADDR and DATA registers are very tricky. If you
do not read back the address register before you read or write the data
register, you may not read or write to the proper address.
Reading back the data register is a safe thing to do. This guarantees
that
the data is written before we change the address register to the zero
value. Without the read, there is a danger of the value being written to
SRAM address 0 instead of the desired address.
No additional reads are required if we use config. cycles on these
registers.
^ permalink raw reply
* Re: tw32_f() in tg3_write_mem()
From: David S. Miller @ 2006-05-01 6:07 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1551EAE59135BE47B544934E30FC4FC041BBEE@NT-IRVA-0751.brcm.ad.broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Sun, 30 Apr 2006 22:05:40 -0700
> Reading back the data register is a safe thing to do. This
> guarantees that the data is written before we change the address
> register to the zero value. Without the read, there is a danger of
> the value being written to SRAM address 0 instead of the desired
> address.
Writes can be posted, but they cannot be reordered can they?
^ permalink raw reply
* More Orinoco patches
From: Pavel Roskin @ 2006-05-01 6:13 UTC (permalink / raw)
To: Netdev List, John W. Linville
Hello!
I'm about to send some more patches for Orinoco drivers. Unlike the
previous set, the new patches are mostly cosmetic changes based on the
feedback I received from the already submitted patches. Please apply to
the trees that have the previous patches.
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH 1/5] orinoco: unregister network device before releasing PCMCIA resources
From: Pavel Roskin @ 2006-05-01 6:13 UTC (permalink / raw)
To: netdev, linville
From: Pavel Roskin <proski@gnu.org>
Hardware resources should not be made available to other devices while
the network device is still registered. Also remove the related debug
statements.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
drivers/net/wireless/orinoco_cs.c | 9 +++------
drivers/net/wireless/spectrum_cs.c | 9 +++------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index d2c48ac..ee05ec6 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -147,14 +147,11 @@ static void orinoco_cs_detach(struct pcm
{
struct net_device *dev = link->priv;
+ if (link->dev_node)
+ unregister_netdev(dev);
+
orinoco_cs_release(link);
- DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
- if (link->dev_node) {
- DEBUG(0, PFX "About to unregister net device %p\n",
- dev);
- unregister_netdev(dev);
- }
free_orinocodev(dev);
} /* orinoco_cs_detach */
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index aeb38d9..0921162 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -625,14 +625,11 @@ static void spectrum_cs_detach(struct pc
{
struct net_device *dev = link->priv;
+ if (link->dev_node)
+ unregister_netdev(dev);
+
spectrum_cs_release(link);
- DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
- if (link->dev_node) {
- DEBUG(0, PFX "About to unregister net device %p\n",
- dev);
- unregister_netdev(dev);
- }
free_orinocodev(dev);
} /* spectrum_cs_detach */
^ permalink raw reply related
* [PATCH 2/5] orinoco: report more relevant data on startup
From: Pavel Roskin @ 2006-05-01 6:13 UTC (permalink / raw)
To: netdev, linville
In-Reply-To: <20060501061324.13342.58195.stgit@dv.roinet.com>
From: Pavel Roskin <proski@gnu.org>
Report only the first I/O window and IRQ, and also add the driver name.
The second I/O window, Vpp and configuration index are not interesting
to most users. They can be found by PCMCIA debug tools if needed.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
drivers/net/wireless/orinoco_cs.c | 17 ++++-------------
drivers/net/wireless/spectrum_cs.c | 17 ++++-------------
2 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index ee05ec6..1c19c76 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -343,19 +343,10 @@ orinoco_cs_config(struct pcmcia_device *
net_device has been registered */
/* Finally, report what we've done */
- printk(KERN_DEBUG "%s: index 0x%02x: ",
- dev->name, link->conf.ConfigIndex);
- if (link->conf.Vpp)
- printk(", Vpp %d.%d", link->conf.Vpp / 10,
- link->conf.Vpp % 10);
- printk(", irq %d", link->irq.AssignedIRQ);
- if (link->io.NumPorts1)
- printk(", io 0x%04x-0x%04x", link->io.BasePort1,
- link->io.BasePort1 + link->io.NumPorts1 - 1);
- if (link->io.NumPorts2)
- printk(" & 0x%04x-0x%04x", link->io.BasePort2,
- link->io.BasePort2 + link->io.NumPorts2 - 1);
- printk("\n");
+ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
+ "0x%04x-0x%04x\n", dev->name, dev->class_dev.dev->bus_id,
+ link->irq.AssignedIRQ, link->io.BasePort1,
+ link->io.BasePort1 + link->io.NumPorts1 - 1);
return 0;
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index 0921162..e9172ee 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -822,19 +822,10 @@ spectrum_cs_config(struct pcmcia_device
net_device has been registered */
/* Finally, report what we've done */
- printk(KERN_DEBUG "%s: index 0x%02x: ",
- dev->name, link->conf.ConfigIndex);
- if (link->conf.Vpp)
- printk(", Vpp %d.%d", link->conf.Vpp / 10,
- link->conf.Vpp % 10);
- printk(", irq %d", link->irq.AssignedIRQ);
- if (link->io.NumPorts1)
- printk(", io 0x%04x-0x%04x", link->io.BasePort1,
- link->io.BasePort1 + link->io.NumPorts1 - 1);
- if (link->io.NumPorts2)
- printk(" & 0x%04x-0x%04x", link->io.BasePort2,
- link->io.BasePort2 + link->io.NumPorts2 - 1);
- printk("\n");
+ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
+ "0x%04x-0x%04x\n", dev->name, dev->class_dev.dev->bus_id,
+ link->irq.AssignedIRQ, link->io.BasePort1,
+ link->io.BasePort1 + link->io.NumPorts1 - 1);
return 0;
^ permalink raw reply related
* [PATCH 3/5] orinoco: simplify locking, fix error handling in PCMCIA resume
From: Pavel Roskin @ 2006-05-01 6:13 UTC (permalink / raw)
To: netdev, linville
In-Reply-To: <20060501061324.13342.58195.stgit@dv.roinet.com>
From: Pavel Roskin <proski@gnu.org>
Don't use flags in the spinlocks - the PCMCIA resume functions may not
be called under lock. Don't ignore any errors.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
drivers/net/wireless/orinoco_cs.c | 7 +++----
drivers/net/wireless/spectrum_cs.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 1c19c76..b2aec4d 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -415,7 +415,6 @@ static int orinoco_cs_resume(struct pcmc
struct orinoco_private *priv = netdev_priv(dev);
struct orinoco_pccard *card = priv->card;
int err = 0;
- unsigned long flags;
if (! test_bit(0, &card->hard_reset_in_progress)) {
err = orinoco_reinit_firmware(dev);
@@ -425,7 +424,7 @@ static int orinoco_cs_resume(struct pcmc
return -EIO;
}
- spin_lock_irqsave(&priv->lock, flags);
+ spin_lock(&priv->lock);
netif_device_attach(dev);
priv->hw_unavailable--;
@@ -437,10 +436,10 @@ static int orinoco_cs_resume(struct pcmc
dev->name, err);
}
- spin_unlock_irqrestore(&priv->lock, flags);
+ spin_unlock(&priv->lock);
}
- return 0;
+ return err;
}
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index e9172ee..7f9aa13 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -866,11 +866,10 @@ spectrum_cs_suspend(struct pcmcia_device
{
struct net_device *dev = link->priv;
struct orinoco_private *priv = netdev_priv(dev);
- unsigned long flags;
int err = 0;
/* Mark the device as stopped, to block IO until later */
- spin_lock_irqsave(&priv->lock, flags);
+ spin_lock(&priv->lock);
err = __orinoco_down(dev);
if (err)
@@ -880,9 +879,9 @@ spectrum_cs_suspend(struct pcmcia_device
netif_device_detach(dev);
priv->hw_unavailable++;
- spin_unlock_irqrestore(&priv->lock, flags);
+ spin_unlock(&priv->lock);
- return 0;
+ return err;
}
static int
^ permalink raw reply related
* [PATCH 4/5] orinoco: eliminate the suspend/resume functions if CONFIG_PM is unset
From: Pavel Roskin @ 2006-05-01 6:13 UTC (permalink / raw)
To: netdev, linville
In-Reply-To: <20060501061324.13342.58195.stgit@dv.roinet.com>
From: Pavel Roskin <proski@gnu.org>
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
drivers/net/wireless/orinoco_pci.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/orinoco_pci.h b/drivers/net/wireless/orinoco_pci.h
index b05a9a5..4e8da4e 100644
--- a/drivers/net/wireless/orinoco_pci.h
+++ b/drivers/net/wireless/orinoco_pci.h
@@ -44,6 +44,7 @@ static inline void orinoco_pci_setup_net
pci_name(pdev), pdev->irq, range_type, start, end);
}
+#ifdef CONFIG_PM
static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
@@ -121,5 +122,9 @@ static int orinoco_pci_resume(struct pci
return 0;
}
+#else
+#define orinoco_pci_suspend NULL
+#define orinoco_pci_resume NULL
+#endif
#endif /* _ORINOCO_PCI_H */
^ permalink raw reply related
* [PATCH 5/5] orinoco: don't put PCI resource data to the network device
From: Pavel Roskin @ 2006-05-01 6:13 UTC (permalink / raw)
To: netdev, linville
In-Reply-To: <20060501061324.13342.58195.stgit@dv.roinet.com>
From: Pavel Roskin <proski@gnu.org>
The resource data in the network device is intended for ISA and other
older busses, but not for PCI. Don't put PCI data there. Don't (ab)use
the network device for keeping the IRQ number.
Retire orinoco_pci_setup_netdev(), and print some minimal information to
the kernel log instead, identifying the network device and the driver
mostly to identify problems at startup. Scripts should rely on sysfs.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
drivers/net/wireless/orinoco_nortel.c | 5 +++--
drivers/net/wireless/orinoco_pci.c | 5 +++--
drivers/net/wireless/orinoco_pci.h | 26 --------------------------
drivers/net/wireless/orinoco_plx.c | 5 +++--
drivers/net/wireless/orinoco_tmd.c | 5 +++--
5 files changed, 12 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/orinoco_nortel.c b/drivers/net/wireless/orinoco_nortel.c
index 1596182..74b9d5b 100644
--- a/drivers/net/wireless/orinoco_nortel.c
+++ b/drivers/net/wireless/orinoco_nortel.c
@@ -206,7 +206,6 @@ static int orinoco_nortel_init_one(struc
err = -EBUSY;
goto fail_irq;
}
- orinoco_pci_setup_netdev(dev, pdev, 2);
err = orinoco_nortel_hw_init(card);
if (err) {
@@ -227,6 +226,8 @@ static int orinoco_nortel_init_one(struc
}
pci_set_drvdata(pdev, dev);
+ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+ pci_name(pdev));
return 0;
@@ -265,7 +266,7 @@ static void __devexit orinoco_nortel_rem
iowrite16(0, card->bridge_io + 10);
unregister_netdev(dev);
- free_irq(dev->irq, dev);
+ free_irq(pdev->irq, dev);
pci_set_drvdata(pdev, NULL);
free_orinocodev(dev);
pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
index df37b95..1c105f4 100644
--- a/drivers/net/wireless/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco_pci.c
@@ -161,7 +161,6 @@ static int orinoco_pci_init_one(struct p
err = -EBUSY;
goto fail_irq;
}
- orinoco_pci_setup_netdev(dev, pdev, 0);
err = orinoco_pci_cor_reset(priv);
if (err) {
@@ -176,6 +175,8 @@ static int orinoco_pci_init_one(struct p
}
pci_set_drvdata(pdev, dev);
+ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+ pci_name(pdev));
return 0;
@@ -204,7 +205,7 @@ static void __devexit orinoco_pci_remove
struct orinoco_private *priv = netdev_priv(dev);
unregister_netdev(dev);
- free_irq(dev->irq, dev);
+ free_irq(pdev->irq, dev);
pci_set_drvdata(pdev, NULL);
free_orinocodev(dev);
pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/orinoco_pci.h b/drivers/net/wireless/orinoco_pci.h
index 4e8da4e..7eb1e08 100644
--- a/drivers/net/wireless/orinoco_pci.h
+++ b/drivers/net/wireless/orinoco_pci.h
@@ -18,32 +18,6 @@ struct orinoco_pci_card {
void __iomem *attr_io;
};
-/* Set base address or memory range of the network device based on
- * the PCI device it's using. Specify BAR of the "main" resource.
- * To be used after request_irq(). */
-static inline void orinoco_pci_setup_netdev(struct net_device *dev,
- struct pci_dev *pdev, int bar)
-{
- char *range_type;
- unsigned long start = pci_resource_start(pdev, bar);
- unsigned long len = pci_resource_len(pdev, bar);
- unsigned long flags = pci_resource_flags(pdev, bar);
- unsigned long end = start + len - 1;
-
- dev->irq = pdev->irq;
- if (flags & IORESOURCE_IO) {
- dev->base_addr = start;
- range_type = "ports";
- } else {
- dev->mem_start = start;
- dev->mem_end = end;
- range_type = "memory";
- }
-
- printk(KERN_DEBUG PFX "%s: irq %d, %s 0x%lx-0x%lx\n",
- pci_name(pdev), pdev->irq, range_type, start, end);
-}
-
#ifdef CONFIG_PM
static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c
index 7b94050..84f696c 100644
--- a/drivers/net/wireless/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco_plx.c
@@ -245,7 +245,6 @@ static int orinoco_plx_init_one(struct p
err = -EBUSY;
goto fail_irq;
}
- orinoco_pci_setup_netdev(dev, pdev, 2);
err = orinoco_plx_hw_init(card);
if (err) {
@@ -266,6 +265,8 @@ static int orinoco_plx_init_one(struct p
}
pci_set_drvdata(pdev, dev);
+ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+ pci_name(pdev));
return 0;
@@ -301,7 +302,7 @@ static void __devexit orinoco_plx_remove
struct orinoco_pci_card *card = priv->card;
unregister_netdev(dev);
- free_irq(dev->irq, dev);
+ free_irq(pdev->irq, dev);
pci_set_drvdata(pdev, NULL);
free_orinocodev(dev);
pci_iounmap(pdev, priv->hw.iobase);
diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c
index 0496663..d2b4dec 100644
--- a/drivers/net/wireless/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco_tmd.c
@@ -147,7 +147,6 @@ static int orinoco_tmd_init_one(struct p
err = -EBUSY;
goto fail_irq;
}
- orinoco_pci_setup_netdev(dev, pdev, 2);
err = orinoco_tmd_cor_reset(priv);
if (err) {
@@ -162,6 +161,8 @@ static int orinoco_tmd_init_one(struct p
}
pci_set_drvdata(pdev, dev);
+ printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name,
+ pci_name(pdev));
return 0;
@@ -194,7 +195,7 @@ static void __devexit orinoco_tmd_remove
struct orinoco_pci_card *card = priv->card;
unregister_netdev(dev);
- free_irq(dev->irq, dev);
+ free_irq(pdev->irq, dev);
pci_set_drvdata(pdev, NULL);
free_orinocodev(dev);
pci_iounmap(pdev, priv->hw.iobase);
^ permalink raw reply related
* Re: [PATCH 0/3] Eleminate HZ from AX.25, NETROM and ROSE kernel interfaces
From: David S. Miller @ 2006-05-01 8:00 UTC (permalink / raw)
To: ralf; +Cc: netdev, linux-hams
In-Reply-To: <20060429140327.GA2173@linux-mips.org>
Ralf, I have all of your patches queued up, I'll review them
and merge them in soon.
Thanks a lot.
^ permalink raw reply
* Re: IP1000 gigabit nic driver
From: Pekka Enberg @ 2006-05-01 9:31 UTC (permalink / raw)
To: David Vrabel; +Cc: romieu, linux-kernel, netdev, david
In-Reply-To: <44554ADE.8030200@cantab.net>
On Mon, 2006-05-01 at 00:40 +0100, David Vrabel wrote:
> Thanks for doing this Pekka. I've fixed up some stuff and given it some
> brief testing on a 100BaseT network and it seems to work now.
Thanks! I merged your stuff and pushed out an updated patch.
Pekka
[PATCH] IP1000 Gigabit Ethernet device driver
This is a cleaned up fork of the IP1000A device driver:
http://www.icplus.com.tw/driver-pp-IP1000A.html
Open issues:
- ipg_probe() looks really fishy and doesn't handle all errors
(e.g. ioremap failing).
- ipg_nic_do_ioctl() is playing games with user-space pointer.
We should use ethtool ioctl instead as suggested by Arjan.
- something (PHY reset/auto negotiation?) takes 2-3 seconds and
appears to be done with interrupts disabled.
Changelog:
- Kill 2.2 and 2.4 compatability macros
- Use proper module API
- Use proper PCI API
- Use netdev_priv
- Consolidate headers to one file
- Use __iomem annotations
- Use iomap instead of read/out for I/O
- Remove obfuscating register access macros
- Remove changelogs
- Remove ether_crc_le() -- use crc32_le() instead.
- No more nonsense with root_dev -- ipg_remove() now works.
- Move PHY and MAC address initialization into the ipg_probe(). It was
previously filling in the MAC address on open which breaks some user
space.
- Folded ipg_nic_init into ipg_probe since it was broke otherwise.
I don't have the hardware, so I don't know if I broke anything.
The patch is 128 KB in size, so I am not including it in this
mail. You can find the patch here:
http://www.cs.helsinki.fi/u/penberg/linux/ip1000-driver.patch
Signed-off-by: David Vrabel <dvrabel@cantab.net>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
^ permalink raw reply
* Re: IP1000 gigabit nic driver
From: Pekka Enberg @ 2006-05-01 9:43 UTC (permalink / raw)
To: David Vrabel; +Cc: romieu, linux-kernel, netdev, david
In-Reply-To: <44554ADE.8030200@cantab.net>
On Mon, 2006-05-01 at 00:40 +0100, David Vrabel wrote:
> Still pending. Also:
>
> - something (PHY reset/auto negotiation?) takes 2-3 seconds and
> appears to be done with interrupts disabled.
Are you seeing this at module initialization? Does Sysrq-t show anything
useful?
Pekka
^ permalink raw reply
* [PATCH 001/100] TCP congestion module: add TCP-LP supporting for 2.6.16
From: Wong Edison @ 2006-05-01 10:05 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
TCP Low Priority is a distributed algorithm whose goal is to utilize only
the excess network bandwidth as compared to the ``fair share`` of
bandwidth as targeted by TCP. Available from:
http://www.ece.rice.edu/~akuzma/Doc/akuzma/TCP-LP.pdf
See http://www-ece.rice.edu/networks/TCP-LP/ for their implementation.
Our group take the following changes from
the original TCP-LP implementation:
o We use newReno in most core CA handling. Only add some checking
within cong_avoid.
o Error correcting in remote HZ, therefore remote HZ will be keeped
on checking and updating.
o Handling calculation of One-Way-Delay (OWD) within rtt_sample, sicne
OWD have a similar meaning as RTT. Also correct the buggy formular.
o Handle reaction for Early Congestion Indication (ECI) within
pkts_acked, as mentioned within pseudo code.
o OWD is handled in relative format, where local time stamp will in
tcp_time_stamp format.
Port from 2.4.19 to 2.6.16 as module by:
Wong Hoi Sing Edison <hswong3i@gmail.com>
Hung Hing Lun <hlhung3i@gmail.com>
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
diff -urN linux-2.6.16.1/net/ipv4/Kconfig linux/net/ipv4/Kconfig
--- linux-2.6.16.1/net/ipv4/Kconfig 2006-03-28 14:49:02.000000000 +0800
+++ linux/net/ipv4/Kconfig 2006-04-19 02:40:27.000000000 +0800
@@ -531,6 +531,27 @@
properties, though is known to have fairness issues.
See http://www-lce.eng.cam.ac.uk/~ctk21/scalable/
+config TCP_CONG_LP
+ tristate "TCP Low Priority"
+ depends on EXPERIMENTAL
+ default n
+ ---help---
+ TCP Low Priority (TCP-LP), a distributed algorithm whose goal is
+ to utiliza only the excess network bandwidth as compared to the
+ ``fair share`` of bandwidth as targeted by TCP.
+ See http://www-ece.rice.edu/networks/TCP-LP/
+
+config TCP_CONG_LP_DEBUG
+ bool "TCP-LP Debug"
+ depends on TCP_CONG_LP
+ default n
+ ---help---
+ Turn on/off the debug message for TCP-LP. The debug message will
+ print to default kernel debug log file, e.g. /var/log/debug as
+ default. You can use dmesg to obtain the log too.
+
+ If unsure, say N.
+
endmenu
config TCP_CONG_BIC
diff -urN linux-2.6.16.1/net/ipv4/Makefile linux/net/ipv4/Makefile
--- linux-2.6.16.1/net/ipv4/Makefile 2006-03-28 14:49:02.000000000 +0800
+++ linux/net/ipv4/Makefile 2006-04-19 02:40:27.000000000 +0800
@@ -41,6 +41,7 @@
obj-$(CONFIG_TCP_CONG_HTCP) += tcp_htcp.o
obj-$(CONFIG_TCP_CONG_VEGAS) += tcp_vegas.o
obj-$(CONFIG_TCP_CONG_SCALABLE) += tcp_scalable.o
+obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o
obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
xfrm4_output.o
diff -urN linux-2.6.16.1/net/ipv4/tcp_lp.c linux/net/ipv4/tcp_lp.c
--- linux-2.6.16.1/net/ipv4/tcp_lp.c 1970-01-01 08:00:00.000000000 +0800
+++ linux/net/ipv4/tcp_lp.c 2006-04-25 15:54:54.000000000 +0800
@@ -0,0 +1,343 @@
+/*
+ * TCP Low Priority (TCP-LP)
+ *
+ * TCP Low Priority is a distributed algorithm whose goal is to utilize only
+ * the excess network bandwidth as compared to the ``fair share`` of
+ * bandwidth as targeted by TCP. Available from:
+ * http://www.ece.rice.edu/~akuzma/Doc/akuzma/TCP-LP.pdf
+ *
+ * Original Author:
+ * Aleksandar Kuzmanovic <akuzma@northwestern.edu>
+ *
+ * See http://www-ece.rice.edu/networks/TCP-LP/ for their implementation.
+ * As of 2.6.13, Linux supports pluggable congestion control algorithms.
+ * Due to the limitation of the API, we take the following changes from
+ * the original TCP-LP implementation:
+ * o We use newReno in most core CA handling. Only add some checking
+ * within cong_avoid.
+ * o Error correcting in remote HZ, therefore remote HZ will be keeped
+ * on checking and updating.
+ * o Handling calculation of One-Way-Delay (OWD) within rtt_sample, sicne
+ * OWD have a similar meaning as RTT. Also correct the buggy formular.
+ * o Handle reaction for Early Congestion Indication (ECI) within
+ * pkts_acked, as mentioned within pseudo code.
+ * o OWD is handled in relative format, where local time stamp will in
+ * tcp_time_stamp format.
+ *
+ * Port from 2.4.19 to 2.6.16 as module by:
+ * Wong Hoi Sing Edison <hswong3i@gmail.com>
+ * Hung Hing Lun <hlhung3i@gmail.com>
+ *
+ * Version: $Id: tcp_lp.c,v 1.20 2006-04-22 06:34:20 hswong3i Exp $
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <net/tcp.h>
+
+#ifndef CONFIG_TCP_CONG_LP_DEBUG
+#define CONFIG_TCP_CONG_LP_DEBUG 0
+#endif
+
+/* resolution of owd */
+#define LP_RESOL 1000
+
+/**
+ * enum tcp_lp_state
+ * @LP_VALID_RHZ: is remote HZ valid?
+ * @LP_VALID_OWD: is OWD valid?
+ * @LP_WITHIN_THR: are we within threshold?
+ * @LP_WITHIN_INF: are we within inference?
+ *
+ * TCP-LP's state flags.
+ * We create this set of state flag mainly for debugging.
+ */
+enum tcp_lp_state {
+ LP_VALID_RHZ = (1 << 0),
+ LP_VALID_OWD = (1 << 1),
+ LP_WITHIN_THR = (1 << 3),
+ LP_WITHIN_INF = (1 << 4),
+};
+
+/**
+ * struct lp
+ * @flag: TCP-LP state flag
+ * @sowd: smoothed OWD << 3
+ * @owd_min: min OWD
+ * @owd_max: max OWD
+ * @owd_max_rsv: resrved max owd
+ * @RHZ: estimated remote HZ
+ * @remote_ref_time: remote reference time
+ * @local_ref_time: local reference time
+ * @last_drop: time for last active drop
+ * @inference: current inference
+ *
+ * TCP-LP's private struct.
+ * We get the idea from original TCP-LP implementation where only left those we
+ * found are really useful.
+ */
+struct lp {
+ u32 flag;
+ u32 sowd;
+ u32 owd_min;
+ u32 owd_max;
+ u32 owd_max_rsv;
+ u32 RHZ;
+ u32 remote_ref_time;
+ u32 local_ref_time;
+ u32 last_drop;
+ u32 inference;
+};
+
+/**
+ * tcp_lp_init
+ *
+ * Init all required variables.
+ * Clone the handling from Vegas module implementation.
+ */
+static void tcp_lp_init(struct sock *sk)
+{
+ struct lp *lp = inet_csk_ca(sk);
+
+ lp->flag = 0;
+ lp->sowd = 0;
+ lp->owd_min = 0xffffffff;
+ lp->owd_max = 0;
+ lp->owd_max_rsv = 0;
+ lp->RHZ = 0;
+ lp->remote_ref_time = 0;
+ lp->local_ref_time = 0;
+ lp->last_drop = 0;
+ lp->inference = 0;
+}
+
+/**
+ * tcp_lp_cong_avoid
+ *
+ * Implementation of cong_avoid.
+ * Will only call newReno CA when away from inference.
+ * From TCP-LP's paper, this will be handled in additive increasement.
+ */
+static void tcp_lp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight,
+ int flag)
+{
+ struct lp *lp = inet_csk_ca(sk);
+
+ if (!(lp->flag & LP_WITHIN_INF))
+ tcp_reno_cong_avoid(sk, ack, rtt, in_flight, flag);
+}
+
+/**
+ * tcp_lp_remote_hz_estimator
+ *
+ * Estimate remote HZ.
+ * We keep on updating the estimated value, where original TCP-LP
+ * implementation only guest it for once and use forever.
+ */
+static inline u32 tcp_lp_remote_hz_estimator(struct sock *sk)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
+ struct lp *lp = inet_csk_ca(sk);
+ s64 rhz = lp->RHZ << 6; /* remote HZ << 6 */
+ s64 m = 0;
+
+ /* not yet record reference time
+ * go away!! record it before come back!! */
+ if (lp->remote_ref_time == 0 || lp->local_ref_time == 0)
+ goto out;
+
+ /* we can't calc remote HZ with no different!! */
+ if (tp->rx_opt.rcv_tsval == lp->remote_ref_time
+ || tp->rx_opt.rcv_tsecr == lp->local_ref_time)
+ goto out;
+
+ m = HZ * (tp->rx_opt.rcv_tsval -
+ lp->remote_ref_time) / (tp->rx_opt.rcv_tsecr -
+ lp->local_ref_time);
+ if (m < 0)
+ m = -m;
+
+ if (rhz != 0) {
+ m -= (rhz >> 6); /* m is now error in remote HZ est */
+ rhz += m; /* 63/64 old + 1/64 new */
+ } else
+ rhz = m << 6;
+
+ /* record time for successful remote HZ calc */
+ lp->flag |= LP_VALID_RHZ;
+
+ out:
+ /* record reference time stamp */
+ lp->remote_ref_time = tp->rx_opt.rcv_tsval;
+ lp->local_ref_time = tp->rx_opt.rcv_tsecr;
+
+ return rhz >> 6;
+}
+
+/**
+ * tcp_lp_owd_calculator
+ *
+ * Calculate one way delay (in relative format).
+ * Original implement OWD as minus of remote time difference to local time
+ * difference directly. As this time difference just simply equal to RTT, when
+ * the network status is stable, remote RTT will equal to local RTT, and result
+ * OWD into zero.
+ * It seems to be a bug and so we fixed it.
+ */
+static inline u32 tcp_lp_owd_calculator(struct sock *sk)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
+ struct lp *lp = inet_csk_ca(sk);
+ s64 owd = 0;
+
+ lp->RHZ = tcp_lp_remote_hz_estimator(sk);
+
+ if (lp->flag & LP_VALID_RHZ) {
+ owd =
+ tp->rx_opt.rcv_tsval * (LP_RESOL / lp->RHZ) -
+ tp->rx_opt.rcv_tsecr * (LP_RESOL / HZ);
+ if (owd < 0)
+ owd = -owd;
+ }
+
+ if (owd > 0)
+ lp->flag |= LP_VALID_OWD;
+ else
+ lp->flag &= ~LP_VALID_OWD;
+
+ return owd;
+}
+
+/**
+ * tcp_lp_rtt_sample
+ *
+ * Implementation or rtt_sample.
+ * Will take the following action,
+ * 1. calc OWD,
+ * 2. record the min/max OWD,
+ * 3. calc smoothed OWD (SOWD).
+ * Most ideas come from the original TCP-LP implementation.
+ */
+static void tcp_lp_rtt_sample(struct sock *sk, u32 usrtt)
+{
+ struct lp *lp = inet_csk_ca(sk);
+ s64 mowd = tcp_lp_owd_calculator(sk);
+
+ /* sorry that we don't have valid data */
+ if (!(lp->flag & LP_VALID_RHZ) || !(lp->flag & LP_VALID_OWD))
+ return;
+
+ /* record the next min owd */
+ if (mowd < lp->owd_min)
+ lp->owd_min = mowd;
+
+ /* always forget the max of the max
+ * we just set owd_max as one below it */
+ if (mowd > lp->owd_max) {
+ if (mowd > lp->owd_max_rsv) {
+ if (lp->owd_max_rsv == 0)
+ lp->owd_max = mowd;
+ else
+ lp->owd_max = lp->owd_max_rsv;
+ lp->owd_max_rsv = mowd;
+ } else
+ lp->owd_max = mowd;
+ }
+
+ /* calc for smoothed owd */
+ if (lp->sowd != 0) {
+ mowd -= (lp->sowd >> 3); /* m is now error in owd est */
+ lp->sowd += mowd; /* owd = 7/8 owd + 1/8 new */
+ } else
+ lp->sowd = mowd << 3; /* take the measured time be owd */
+}
+
+/**
+ * tcp_lp_pkts_acked
+ *
+ * Implementation of pkts_acked.
+ * Deal with active drop under Early Congestion Indication.
+ * Only drop to half and 1 will be handle, because we hope to use back
+ * newReno in increase case.
+ * We work it out by following the idea from TCP-LP's paper directly
+ */
+static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
+ struct lp *lp = inet_csk_ca(sk);
+
+ /* calc inference */
+ if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
+ lp->inference = 3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr);
+
+ /* test if within inference */
+ if (lp->last_drop && (tcp_time_stamp - lp->last_drop < lp->inference))
+ lp->flag |= LP_WITHIN_INF;
+ else
+ lp->flag &= ~LP_WITHIN_INF;
+
+ /* test if within threshold */
+ if (lp->sowd >> 3 <
+ lp->owd_min + 15 * (lp->owd_max - lp->owd_min) / 100)
+ lp->flag |= LP_WITHIN_THR;
+ else
+ lp->flag &= ~LP_WITHIN_THR;
+
+#if CONFIG_TCP_CONG_LP_DEBUG == 1
+ printk(KERN_DEBUG "TCP-LP: %05o|%5u|%5u|%15u|%15u|%15u\n", lp->flag,
+ tp->snd_cwnd, lp->RHZ, lp->owd_min, lp->owd_max, lp->sowd >> 3);
+#endif
+
+ if (lp->flag & LP_WITHIN_THR)
+ return;
+
+ /* FIXME: try to reset owd_min and owd_max here
+ * so decrease the chance the min/max is no longer suitable
+ * and will usually within threshold when whithin inference */
+ lp->owd_min = (lp->sowd >> 3);
+ lp->owd_max = (lp->sowd >> 2);
+ lp->owd_max_rsv = (lp->sowd >> 2);
+
+ /* happened within inference
+ * drop snd_cwnd into 1 */
+ if (lp->flag & LP_WITHIN_INF)
+ tp->snd_cwnd = 1U;
+
+ /* happened after inference
+ * cut snd_cwnd into half */
+ else
+ tp->snd_cwnd = max(tp->snd_cwnd >> 1U, 1U);
+
+ /* record this drop time */
+ lp->last_drop = tcp_time_stamp;
+}
+
+static struct tcp_congestion_ops tcp_lp = {
+ .init = tcp_lp_init,
+ .ssthresh = tcp_reno_ssthresh,
+ .cong_avoid = tcp_lp_cong_avoid,
+ .min_cwnd = tcp_reno_min_cwnd,
+ .rtt_sample = tcp_lp_rtt_sample,
+ .pkts_acked = tcp_lp_pkts_acked,
+
+ .owner = THIS_MODULE,
+ .name = "lp"
+};
+
+static int __init lp_register(void)
+{
+ BUG_ON(sizeof(struct lp) > ICSK_CA_PRIV_SIZE);
+ return tcp_register_congestion_control(&tcp_lp);
+}
+
+static void __exit lp_unregister(void)
+{
+ tcp_unregister_congestion_control(&tcp_lp);
+}
+
+module_init(lp_register);
+module_exit(lp_unregister);
+
+MODULE_AUTHOR("Wong Hoi Sing Edison, Hung Hing Lun");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("TCP Low Priority");
^ permalink raw reply
* Re: IP1000 gigabit nic driver
From: David Vrabel @ 2006-05-01 11:32 UTC (permalink / raw)
To: David Vrabel; +Cc: Pekka Enberg, romieu, linux-kernel, netdev, david
In-Reply-To: <44554ADE.8030200@cantab.net>
[-- Attachment #1: Type: text/plain, Size: 441 bytes --]
David Vrabel wrote:
>
> - something (PHY reset/auto negotiation?) takes 2-3 seconds and
> appears to be done with interrupts disabled.
It was clocking the MII management interface (MDC) at 500 Hz so each PHY
register access took some 130 ms, and many registers accesses were being
done on initialization. According to the datasheet, the maximum
frequency for MDC is 2.5 MHz. Delays have been adjusted accordingly.
David Vrabel
[-- Attachment #2: drivers-net-ipg-speed-up-phy-access --]
[-- Type: text/plain, Size: 3542 bytes --]
Reduce delays when reading/writing the PHY registers so we clock the
MII management interface at 2.5 MHz (the maximum according to the
datasheet) instead of 500 Hz.
Signed-off-by: David Vrabel <dvrabel@cantab.net>
Index: linux-source-2.6.16/drivers/net/ipg.c
===================================================================
--- linux-source-2.6.16.orig/drivers/net/ipg.c 2006-05-01 11:52:32.555800238 +0100
+++ linux-source-2.6.16/drivers/net/ipg.c 2006-05-01 12:08:45.316188064 +0100
@@ -176,13 +176,13 @@
(IPG_PC_MGMTCLK_LO | (IPG_PC_MGMTDATA & 0) | IPG_PC_MGMTDIR |
phyctrlpolarity), ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
iowrite8(IPG_PC_RSVD_MASK &
(IPG_PC_MGMTCLK_HI | (IPG_PC_MGMTDATA & 0) | IPG_PC_MGMTDIR |
phyctrlpolarity), ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
}
static void send_end(void __iomem * ioaddr, u8 phyctrlpolarity)
@@ -198,7 +198,7 @@
iowrite8(IPG_PC_RSVD_MASK & (IPG_PC_MGMTCLK_LO | phyctrlpolarity),
ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
bit_data =
((ioread8(ioaddr + IPG_PHYCTRL) & IPG_PC_MGMTDATA) >> 1) & 1;
@@ -206,7 +206,7 @@
iowrite8(IPG_PC_RSVD_MASK & (IPG_PC_MGMTCLK_HI | phyctrlpolarity),
ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
return bit_data;
}
@@ -290,14 +290,14 @@
(IPG_PC_MGMTDATA & databit) | IPG_PC_MGMTDIR |
phyctrlpolarity), ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
iowrite8(IPG_PC_RSVD_MASK &
(IPG_PC_MGMTCLK_HI |
(IPG_PC_MGMTDATA & databit) | IPG_PC_MGMTDIR |
phyctrlpolarity), ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
}
send_three_state(ioaddr, phyctrlpolarity);
@@ -403,14 +403,14 @@
(IPG_PC_MGMTDATA & databit) | IPG_PC_MGMTDIR |
phyctrlpolarity), ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
iowrite8(IPG_PC_RSVD_MASK &
(IPG_PC_MGMTCLK_HI |
(IPG_PC_MGMTDATA & databit) | IPG_PC_MGMTDIR |
phyctrlpolarity), ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
}
/* The last cycle is a tri-state, so read from the PHY.
@@ -421,7 +421,7 @@
(IPG_PC_MGMTCLK_LO | phyctrlpolarity),
ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
field[j] |= ((ioread8(ioaddr + IPG_PHYCTRL) &
IPG_PC_MGMTDATA) >> 1)
@@ -431,7 +431,7 @@
(IPG_PC_MGMTCLK_HI | phyctrlpolarity),
ioaddr + IPG_PHYCTRL);
- mdelay(IPG_PC_PHYCTRLWAIT);
+ ndelay(IPG_PC_PHYCTRLWAIT_NS);
}
}
Index: linux-source-2.6.16/drivers/net/ipg.h
===================================================================
--- linux-source-2.6.16.orig/drivers/net/ipg.h 2006-05-01 12:08:58.343035854 +0100
+++ linux-source-2.6.16/drivers/net/ipg.h 2006-05-01 12:09:37.282602113 +0100
@@ -672,10 +672,10 @@
/* Number of IPG_AC_RESETWAIT timeperiods before declaring timeout. */
#define IPG_AC_RESET_TIMEOUT 0x0A
-/* Minimum number of miliseconds used to toggle MDC clock during
+/* Minimum number of nanoseconds used to toggle MDC clock during
* MII/GMII register access.
*/
-#define IPG_PC_PHYCTRLWAIT 0x01
+#define IPG_PC_PHYCTRLWAIT_NS 200
#define IPG_TFDLIST_LENGTH 0x100
^ permalink raw reply
* [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h>
From: Herbert Valerio Riedel @ 2006-05-01 13:46 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linux-mips, sshtylyov
since the au1000 driver already selects the CRC32 routines, simply replace
the internal ether_crc() implementation with the semantically equivalent
one from <linux/crc32.h>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
---
drivers/net/au1000_eth.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
9360df5368deaaaa8fc7dcaacf9b7ca446af94c4
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 29adebb..0823cb8 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -52,6 +52,7 @@
#include <linux/mii.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
+#include <linux/crc32.h>
#include <asm/mipsregs.h>
#include <asm/irq.h>
#include <asm/io.h>
@@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net
netif_wake_queue(dev);
}
-
-static unsigned const ethernet_polynomial = 0x04c11db7U;
-static inline u32 ether_crc(int length, unsigned char *data)
-{
- int crc = -1;
-
- while(--length >= 0) {
- unsigned char current_octet = *data++;
- int bit;
- for (bit = 0; bit < 8; bit++, current_octet >>= 1)
- crc = (crc << 1) ^
- ((crc < 0) ^ (current_octet & 1) ?
- ethernet_polynomial : 0);
- }
- return crc;
-}
-
static void set_rx_mode(struct net_device *dev)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
--
1.2.6
^ permalink raw reply related
* [PATCH] au1000_eth.c: use ether_crc() from <linux/crc32.h>
From: Herbert Valerio Riedel @ 2006-05-01 13:46 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linux-mips, sshtylyov
since the au1000 driver already selects the CRC32 routines, simply replace
the internal ether_crc() implementation with the semantically equivalent
one from <linux/crc32.h>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
---
drivers/net/au1000_eth.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
9360df5368deaaaa8fc7dcaacf9b7ca446af94c4
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 29adebb..0823cb8 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -52,6 +52,7 @@
#include <linux/mii.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
+#include <linux/crc32.h>
#include <asm/mipsregs.h>
#include <asm/irq.h>
#include <asm/io.h>
@@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net
netif_wake_queue(dev);
}
-
-static unsigned const ethernet_polynomial = 0x04c11db7U;
-static inline u32 ether_crc(int length, unsigned char *data)
-{
- int crc = -1;
-
- while(--length >= 0) {
- unsigned char current_octet = *data++;
- int bit;
- for (bit = 0; bit < 8; bit++, current_octet >>= 1)
- crc = (crc << 1) ^
- ((crc < 0) ^ (current_octet & 1) ?
- ethernet_polynomial : 0);
- }
- return crc;
-}
-
static void set_rx_mode(struct net_device *dev)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
--
1.2.6
^ permalink raw reply related
* wireless softmac origin (net/ieee80211/softmac)
From: Ian Brown @ 2006-05-01 14:19 UTC (permalink / raw)
To: netdev
Hello,
I am looking at 2.6.17-rc3 kernel.
I wonder: what is the origin of softmac in
2.6.17-rc3 kernel ?
I see in the *.c files under that folder:
Copyright (c) 2005, 2006 Johannes Berg <johannes@sipsolutions.net>
* Joseph Jezak <josejx@gentoo.org>
* Larry Finger <Larry.Finger@lwfinger.net>
* Danny van Dyk <kugelfang@gentoo.org>
* Michael Buesch <mbuesch@freenet.de>
Is this softmac layer was written from scratch ? or was it
taken (fully/partially) from softmac in the devicescape linux kernel stack ?
http://devicescape.com/
Best,
IB
^ permalink raw reply
* Re: wireless softmac origin (net/ieee80211/softmac)
From: Joseph Jezak @ 2006-05-01 14:30 UTC (permalink / raw)
To: NetDev; +Cc: Ian Brown
In-Reply-To: <d0383f90605010719p616243d0l8da568c02815f504@mail.gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ian Brown wrote:
> Hello,
> I am looking at 2.6.17-rc3 kernel.
> I wonder: what is the origin of softmac in
> 2.6.17-rc3 kernel ?
> I see in the *.c files under that folder:
> Copyright (c) 2005, 2006 Johannes Berg <johannes@sipsolutions.net>
> * Joseph Jezak <josejx@gentoo.org>
> * Larry Finger <Larry.Finger@lwfinger.net>
> * Danny van Dyk <kugelfang@gentoo.org>
> * Michael Buesch <mbuesch@freenet.de>
>
> Is this softmac layer was written from scratch ? or was it
> taken (fully/partially) from softmac in the devicescape linux kernel
> stack ?
> http://devicescape.com/
>
> Best,
> IB
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
It was written from scratch.
- -Joe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEVht7wGq7BLLARfoRAspnAJ9vQC8EUnzN9efWpJZijVNDnsSUIwCfUiVZ
1nsWLEQr+iA0BG18tUKoY8c=
=GRht
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: VLAN subinterfaces, bridges and udev
From: Ben Greear @ 2006-05-01 16:02 UTC (permalink / raw)
To: netdev, md
In-Reply-To: <20060430142929.GA8901@wonderland.linux.it>
Marco d'Itri wrote:
> [Please Cc me, I am not subscribed to netdev.]
>
> Can I rely on the presence of the $DEVPATH/driver symlink (e.g.
> /sys/class/net/eth0/driver) to check if a network interface is a "real"
> device insteaf of a VLAN or a bridge?
To distinguish I use a VLAN specific IOCTL (GET_VLAN_REALDEV_NAME_CMD).
If that IOCTL has no error, then it is a VLAN.
I don't know if there is a similar trick for bridges.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [1/1] AIO sendfile() implementation.
From: Evgeniy Polyakov @ 2006-05-01 16:09 UTC (permalink / raw)
To: netdev; +Cc: David Miller
Kevent [1] based AIO sendfile() implementation.
Patch can be found in archive [2] and is attached.
It is called /tmp/aio_sendfile.1 and depends on full kevent patchset
kevent_full.diff.2, which was recenly sent to netdev@ [3].
Patch is fairly trivial - just use file->f_op->sendpage() for page
sending, all asynchronous mechanism lives in page propagation into VFS
cache.
1. kevent system
http://tservice.net.ru/~s0mbre/old/?section=projects&item=kevent
2. kevent archive
http://tservice.net.ru/~s0mbre/archive/kevent/
3. full kevent patchset
http://marc.theaimsgroup.com/?l=linux-netdev&m=114631895701710&w=2
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
diff --git a/kernel/kevent/kevent_aio.c b/kernel/kevent/kevent_aio.c
index f72107a..249fbc2 100644
--- a/kernel/kevent/kevent_aio.c
+++ b/kernel/kevent/kevent_aio.c
@@ -31,6 +31,8 @@
#include <linux/buffer_head.h>
#include <linux/kevent.h>
+#include <net/sock.h>
+
#define KEVENT_AIO_DEBUG
#ifdef KEVENT_AIO_DEBUG
@@ -47,7 +49,7 @@ struct kevent_aio_private
loff_t processed;
atomic_t bio_page_num;
struct completion bio_complete;
- struct file *file;
+ struct file *file, *sock;
struct work_struct work;
};
@@ -320,15 +322,15 @@ static int kevent_mpage_readpages(struct
static size_t kevent_aio_vfs_read_actor(struct kevent *k, struct page *kpage, size_t len)
{
-#if 0
struct kevent_aio_private *priv = k->priv;
- struct kevent *n;
+ size_t ret;
+
+ ret = priv->sock->f_op->sendpage(priv->sock, kpage, 0, len, &priv->sock->f_pos, 1);
- n = kevent_alloc(GFP_KERNEL);
- if (!n)
- return -ENOMEM;
-#endif
- return len;
+ dprintk("%s: k=%p, page=%p, len=%zu, ret=%zd.\n",
+ __func__, k, kpage, len, ret);
+
+ return ret;
}
static int kevent_aio_vfs_read(struct kevent *k,
@@ -444,21 +446,28 @@ static void kevent_aio_work(void *data)
static int kevent_aio_enqueue(struct kevent *k)
{
int err;
- struct file *file;
+ struct file *file, *sock;
struct inode *inode;
struct kevent_aio_private *priv;
int fd = k->event.id.raw[0];
int num = k->event.id.raw[1];
+ int s = k->event.ret_data[0];
size_t size;
err = -ENODEV;
file = fget(fd);
if (!file)
goto err_out_exit;
+
+ sock = fget(s);
+ if (!sock)
+ goto err_out_fput_file;
err = -EINVAL;
if (!file->f_dentry || !file->f_dentry->d_inode)
goto err_out_fput;
+ if (!sock->f_dentry || !sock->f_dentry->d_inode)
+ goto err_out_fput;
inode = igrab(file->f_dentry->d_inode);
if (!inode)
@@ -477,6 +486,7 @@ static int kevent_aio_enqueue(struct kev
priv->size = size;
priv->offset = 0;
priv->file = file;
+ priv->sock = sock;
INIT_WORK(&priv->work, kevent_aio_work, k);
k->priv = priv;
@@ -492,6 +502,8 @@ static int kevent_aio_enqueue(struct kev
err_out_iput:
iput(inode);
err_out_fput:
+ fput(sock);
+err_out_fput_file:
fput(file);
err_out_exit:
@@ -503,6 +515,7 @@ static int kevent_aio_dequeue(struct kev
struct kevent_aio_private *priv = k->priv;
struct inode *inode = k->st->origin;
struct file *file = priv->file;
+ struct file *sock = priv->sock;
kevent_storage_dequeue(k->st, k);
flush_scheduled_work();
@@ -512,6 +525,7 @@ static int kevent_aio_dequeue(struct kev
k->priv = NULL;
iput(inode);
fput(file);
+ fput(sock);
return 0;
}
@@ -533,6 +547,9 @@ asmlinkage long sys_aio_sendfile(int ctl
ukread.id.raw[0] = fd;
ukread.id.raw[1] = num;
+ ukread.ret_data[0] = s;
+
+ dprintk("%s: fd=%d, s=%d, num=%d.\n", __func__, fd, s, num);
file = fget_light(ctl_fd, &fput_needed);
if (!file)
--
Evgeniy Polyakov
^ permalink raw reply related
* Re: tw32_f() in tg3_write_mem()
From: Michael Chan @ 2006-05-01 14:53 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20060430.230719.90327967.davem@davemloft.net>
On Sun, 2006-04-30 at 23:07 -0700, David S. Miller wrote:
> From: "Michael Chan" <mchan@broadcom.com>
> Date: Sun, 30 Apr 2006 22:05:40 -0700
>
> > Reading back the data register is a safe thing to do. This
> > guarantees that the data is written before we change the address
> > register to the zero value. Without the read, there is a danger of
> > the value being written to SRAM address 0 instead of the desired
> > address.
>
> Writes can be posted, but they cannot be reordered can they?
>
Right, reordering is not allowed unless the relaxed ordering attribute
is set. The read back here is not to guarantee ordering. Those SRAM
address and data registers require "set-up" times for the SRAM writes
and reads to work correctly. The "set-up" times are met either with
config. cycles or with a read when using MMIO cycles. No udelays are
needed, just a read will do.
^ permalink raw reply
* Fw: [Bugme-new] [Bug 6471] New: sky2 problem with Marvell 88E8055
From: Andrew Morton @ 2006-05-01 16:35 UTC (permalink / raw)
To: netdev; +Cc: bugme-daemon@kernel-bugs.osdl.org, prb
Begin forwarded message:
Date: Mon, 1 May 2006 05:20:30 -0700
From: bugme-daemon@bugzilla.kernel.org
To: bugme-new@lists.osdl.org
Subject: [Bugme-new] [Bug 6471] New: sky2 problem with Marvell 88E8055
http://bugzilla.kernel.org/show_bug.cgi?id=6471
Summary: sky2 problem with Marvell 88E8055
Kernel Version: 2.6.17-rc3
Status: NEW
Severity: high
Owner: jgarzik@pobox.com
Submitter: prb@du.se
Most recent kernel where this bug did not occur: 2.6.17-rc3
Distribution: Gentoo
Hardware Environment: Fujitsu-Siemens E8110, ethernet Card Marvell 88E8055
Software Environment:
Problem Description:
Unable to connect, sometimes kernel hangs
Steps to reproduce:
boot, modprobe sky2, dhclient -d eth1
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply
* Re: [PATCH 4/6] tg3: Add reset_phy parameter to chip reset functions
From: Michael Chan @ 2006-05-01 15:19 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20060429.185952.101410162.davem@davemloft.net>
On Sat, 2006-04-29 at 18:59 -0700, David S. Miller wrote:
> From: "Michael Chan" <mchan@broadcom.com>
> Date: Fri, 28 Apr 2006 16:36:08 -0700
>
> > Add a reset_phy parameter to tg3_reset_hw() and tg3_init_hw(). With
> > the full chip reset during MAC address change, the automatic PHY reset
> > during chip reset will cause a link down and bonding will not work
> > properly as a result. With this reset_phy parameter, we can do a chip
> > reset without link down when changing MAC address or MTU.
> >
> > Signed-off-by: Gary Zambrano <zambrano@broadcom.com>
> > Signed-off-by: Michael Chan <mchan@broadcom.com>
>
> Applied.
>
> Doesn't the signalling interface between the MAC and the
> PHY get reset during a chip reset and couldn't that cause
> problems if we bypass the PHY reset?
The PHY reset is needed if the PHY was previously put into low power
mode. In the cases where we reset the chip due to MTU or MAC address
changes, the power settings are not changed and therefore PHY reset is
not needed.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox