* [patch 3/4] mv643xx_eth: fix byte order when checksum offload is enabled
From: akpm @ 2008-02-05 7:47 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, byron.bbradley, dale, mlachwani, viro
From: Byron Bradley <byron.bbradley@gmail.com>
The Marvell Orion system on chips have an integrated mv643xx MAC. On these
little endian ARM devices mv643xx will oops when checksum offload is
enabled. Swapping the byte order of the protocol and checksum solves this
problem.
Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Cc: Dale Farnsworth <dale@farnsworth.org>
Cc: Manish Lachwani <mlachwani@mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/mv643xx_eth.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff -puN drivers/net/mv643xx_eth.c~mv643xx_eth-fix-byte-order-when-checksum-offload-is-enabled drivers/net/mv643xx_eth.c
--- a/drivers/net/mv643xx_eth.c~mv643xx_eth-fix-byte-order-when-checksum-offload-is-enabled
+++ a/drivers/net/mv643xx_eth.c
@@ -1652,6 +1652,11 @@ static void eth_tx_fill_frag_descs(struc
}
}
+static inline __be16 sum16_as_be(__sum16 sum)
+{
+ return (__force __be16)sum;
+}
+
/**
* eth_tx_submit_descs_for_skb - submit data from an skb to the tx hw
*
@@ -1689,7 +1694,7 @@ static void eth_tx_submit_descs_for_skb(
desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- BUG_ON(skb->protocol != ETH_P_IP);
+ BUG_ON(skb->protocol != htons(ETH_P_IP));
cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
ETH_GEN_IP_V_4_CHECKSUM |
@@ -1698,10 +1703,10 @@ static void eth_tx_submit_descs_for_skb(
switch (ip_hdr(skb)->protocol) {
case IPPROTO_UDP:
cmd_sts |= ETH_UDP_FRAME;
- desc->l4i_chk = udp_hdr(skb)->check;
+ desc->l4i_chk = ntohs(sum16_as_be(udp_hdr(skb)->check));
break;
case IPPROTO_TCP:
- desc->l4i_chk = tcp_hdr(skb)->check;
+ desc->l4i_chk = ntohs(sum16_as_be(tcp_hdr(skb)->check));
break;
default:
BUG();
_
^ permalink raw reply
* [patch 2/4] forcedeth: fix MAC address detection on network card (regression in 2.6.23)
From: akpm @ 2008-02-05 7:47 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, michael.pyne, AAbdulla, aabdulla, stable
From: Michael Pyne <michael.pyne@kdemail.net>
Partially revert a change to mac address detection introduced to the forcedeth
driver. The change was intended to correct mac address detection for newer
nVidia chipsets where the mac address was stored in reverse order. One of
those chipsets appears to still have the mac address in reverse order (or at
least, it does on my system).
The change that broke mac address detection for my card was commit
ef756b3e56c68a4d76d9d7b9a73fa8f4f739180f "forcedeth: mac address correct"
My network card is an nVidia built-in Ethernet card, output from lspci as
follows (with text and numeric ids):
$ lspci | grep Ethernet
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
$ lspci -n | grep 07.0
00:07.0 0680: 10de:03ef (rev a2)
The vendor id is, of course, nVidia. The device id corresponds to the
NVIDIA_NVENET_19 entry.
The included patch fixes the MAC address detection on my system.
Interestingly, the MAC address appears to be in the range reserved for my
motherboard manufacturer (Gigabyte) and not nVidia.
Signed-off-by: Michael J. Pyne <michael.pyne@kdemail.net>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Cc: <stable@kernel.org>
On Wed, 21 Nov 2007 15:34:52 -0800
"Ayaz Abdulla" <AAbdulla@nvidia.com> wrote:
> The solution is to get the OEM to update their BIOS (instead of
> integrating this patch) since the MCP61 specs indicate that the MAC
> Address should be in correct order from BIOS.
>
> By changing the feature DEV_HAS_CORRECT_MACADDR to all MCP61 boards, it
> could cause it to break on other OEM systems who have implemented it
> correctly.
>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/forcedeth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623 drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
+++ a/drivers/net/forcedeth.c
@@ -5554,7 +5554,7 @@ static struct pci_device_id pci_tbl[] =
},
{ /* MCP61 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_19),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
},
{ /* MCP65 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_20),
_
^ permalink raw reply
* [patch 4/4] drivers/net/tlan.c: compilation warning fix
From: akpm @ 2008-02-05 7:47 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, lpotenza
From: Leonardo Potenza <lpotenza@inwind.it>
Add a check for the pci_register_driver() return value. Removed unused
variable pad_allocated.
The aim of this patch is to remove the following warning messages:
drivers/net/tlan.c: In function 'tlan_probe':
drivers/net/tlan.c:486: warning: ignoring return value of 'pci_register_driver', declared with attribute warn_unused_result
Signed-off-by: Leonardo Potenza <lpotenza@inwind.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/tlan.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff -puN drivers/net/tlan.c~drivers-net-tlanc-compilation-warning-fix drivers/net/tlan.c
--- a/drivers/net/tlan.c~drivers-net-tlanc-compilation-warning-fix
+++ a/drivers/net/tlan.c
@@ -465,7 +465,7 @@ static struct pci_driver tlan_driver = {
static int __init tlan_probe(void)
{
- static int pad_allocated;
+ int rc = -ENODEV;
printk(KERN_INFO "%s", tlan_banner);
@@ -473,17 +473,22 @@ static int __init tlan_probe(void)
if (TLanPadBuffer == NULL) {
printk(KERN_ERR "TLAN: Could not allocate memory for pad buffer.\n");
- return -ENOMEM;
+ rc = -ENOMEM;
+ goto err_out;
}
memset(TLanPadBuffer, 0, TLAN_MIN_FRAME_SIZE);
- pad_allocated = 1;
TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n");
/* Use new style PCI probing. Now the kernel will
do most of this for us */
- pci_register_driver(&tlan_driver);
+ rc = pci_register_driver(&tlan_driver);
+
+ if (rc != 0) {
+ printk(KERN_ERR "TLAN: Could not register pci driver.\n");
+ goto err_out_pci_free;
+ }
TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n");
TLan_EisaProbe();
@@ -493,11 +498,17 @@ static int __init tlan_probe(void)
tlan_have_pci, tlan_have_eisa);
if (TLanDevicesInstalled == 0) {
- pci_unregister_driver(&tlan_driver);
- pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, TLanPadBufferDMA);
- return -ENODEV;
+ rc = -ENODEV;
+ goto err_out_pci_unreg;
}
return 0;
+
+err_out_pci_unreg:
+ pci_unregister_driver(&tlan_driver);
+err_out_pci_free:
+ pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, TLanPadBufferDMA);
+err_out:
+ return rc;
}
_
^ permalink raw reply
* [patch 1/4] forcedeth: power down phy when interface is down
From: akpm @ 2008-02-05 7:47 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, eswierk, aabdulla
From: "Ed Swierk" <eswierk@arastra.com>
Bring the physical link down when the interface is down by placing the PHY
in power-down state, unless WOL is enabled. This mirrors the behavior of
other drivers including e1000 and tg3.
Without the patch, ifconfig down leaves the physical link up, which confuses
datacenter users who expect the link lights both on the NIC and the switch to
go out when they bring an interface down.
Furthermore, even though the phy is powered on, autonegotiation stops working,
so a normally gigabit link might suddenly become 100 Mbit half-duplex when the
interface goes down, and become gigabit when it comes up again.
Ayaz said:
I would not include this patch until further testing is performed. NVIDIA
MCP chips use 3rd party PHY vendors. By powering down the phy, it could
have adverse affects on certain phys.
Signed-off-by: Ed Swierk <eswierk@arastra.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/forcedeth.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff -puN drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1324,9 +1324,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
- /* restart auto negotiation */
+ /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
- mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+ mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4803,6 +4803,10 @@ static int nv_open(struct net_device *de
dprintk(KERN_DEBUG "nv_open: begin\n");
+ /* power up phy */
+ mii_rw(dev, np->phyaddr, MII_BMCR,
+ mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4985,6 +4989,10 @@ static int nv_close(struct net_device *d
if (np->wolenabled) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
nv_start_rx(dev);
+ } else {
+ /* power down phy */
+ mii_rw(dev, np->phyaddr, MII_BMCR,
+ mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
}
/* FIXME: power down nic */
_
^ permalink raw reply
* [patch 1/2] hamradio: fix dmascc section mismatch
From: akpm @ 2008-02-05 7:45 UTC (permalink / raw)
To: davem; +Cc: netdev, akpm, randy.dunlap, klaus.kudielka, sam
From: Randy Dunlap <randy.dunlap@oracle.com>
hw[] is used in both init and exit functions so it cannot be initdata (section
mismatch is when CONFIG_MODULES=n and CONFIG_DMASCC=y).
WARNING: vmlinux.o(.exit.text+0xba7): Section mismatch: reference to .init.data: (between 'dmascc_exit' and 'sixpack_exit_driver')
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Klaus Kudielka <klaus.kudielka@gmx.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/hamradio/dmascc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/net/hamradio/dmascc.c~hamradio-fix-dmascc-section-mismatch drivers/net/hamradio/dmascc.c
--- a/drivers/net/hamradio/dmascc.c~hamradio-fix-dmascc-section-mismatch
+++ a/drivers/net/hamradio/dmascc.c
@@ -262,8 +262,8 @@ static void tm_isr(struct scc_priv *priv
static int io[MAX_NUM_DEVS] __initdata = { 0, };
-/* Beware! hw[] is also used in cleanup_module(). */
-static struct scc_hardware hw[NUM_TYPES] __initdata_or_module = HARDWARE;
+/* Beware! hw[] is also used in dmascc_exit(). */
+static struct scc_hardware hw[NUM_TYPES] = HARDWARE;
/* Global variables */
_
^ permalink raw reply
* [patch 2/2] tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
From: akpm @ 2008-02-05 7:45 UTC (permalink / raw)
To: davem; +Cc: netdev, akpm, nwfilardo, jeff, maxk
From: "Nathaniel Filardo" <nwfilardo@gmail.com>
Taken from http://bugzilla.kernel.org/show_bug.cgi?id=9806
The TUN/TAP driver only permits one-way transitions of IFF_NO_PI or
IFF_ONE_QUEUE during the lifetime of a tap/tun interface. Note that
tun_set_iff contains
541 if (ifr->ifr_flags & IFF_NO_PI)
542 tun->flags |= TUN_NO_PI;
543
544 if (ifr->ifr_flags & IFF_ONE_QUEUE)
545 tun->flags |= TUN_ONE_QUEUE;
This is easily fixed by adding else branches which clear these bits.
Steps to reproduce:
This is easily reproduced by setting an interface persistant using tunctl then
attempting to open it as IFF_TAP or IFF_TUN, without asserting the IFF_NO_PI
flag. The ioctl() will succeed and the ifr.flags word is not modified, but the
interface remains in IFF_NO_PI mode (as it was set by tunctl).
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Garzik <jeff@garzik.org>
Acked-by: Maxim Krasnyansky <maxk@qualcomm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/tun.c | 4 ++++
1 file changed, 4 insertions(+)
diff -puN drivers/net/tun.c~tun-dev-impossible-to-deassert-iff_one_queue-or-iff_no_pi drivers/net/tun.c
--- a/drivers/net/tun.c~tun-dev-impossible-to-deassert-iff_one_queue-or-iff_no_pi
+++ a/drivers/net/tun.c
@@ -529,9 +529,13 @@ static int tun_set_iff(struct file *file
if (ifr->ifr_flags & IFF_NO_PI)
tun->flags |= TUN_NO_PI;
+ else
+ tun->flags &= ~TUN_NO_PI;
if (ifr->ifr_flags & IFF_ONE_QUEUE)
tun->flags |= TUN_ONE_QUEUE;
+ else
+ tun->flags &= ~TUN_ONE_QUEUE;
file->private_data = tun;
tun->attached = 1;
_
^ permalink raw reply
* Re: 2.6.24-mm1 - Build failure at net/sched/cls_flow.c:598
From: Rami Rosen @ 2008-02-05 7:24 UTC (permalink / raw)
To: Andrew Morton; +Cc: Tilman Schmidt, linux-kernel, Patrick McHardy, netdev
In-Reply-To: <20080204152505.62b2b8b5.akpm@linux-foundation.org>
Hello,
I had sent a patch recently (which is currently pending) which
solves this problem.
see:
http://www.spinics.net/lists/netdev/msg54455.html
Regards,
Rami Rosen
On Feb 5, 2008 1:25 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 04 Feb 2008 23:32:49 +0100
> Tilman Schmidt <tilman@imap.cc> wrote:
>
> > My attempt to build this failed with:
> >
> > CC [M] net/sched/cls_flow.o
> > net/sched/cls_flow.c: In function ___flow_dump___:
> > net/sched/cls_flow.c:598: error: ___struct tcf_ematch_tree___ has no member named ___hdr___
> >
> > Config attached.
>
> Thanks. hm.
>
> #else /* CONFIG_NET_EMATCH */
>
> struct tcf_ematch_tree
> {
> };
>
> methinks Patrick has a CONFIG_NET_EMATCH=n problem?
> --
> 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
>
^ permalink raw reply
* Re: [PATCH] 2.6.24-mm1 section type conflict cleanup
From: Kamalesh Babulal @ 2008-02-05 4:49 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Andrew Morton, linux-kernel, netdev, apw, balbir
In-Reply-To: <20080204180454.GA16050@uranus.ravnborg.org>
Sam Ravnborg wrote:
> On Mon, Feb 04, 2008 at 09:52:23PM +0530, Kamalesh Babulal wrote:
>> Hi Andrew,
>>
>> The 2.6.24-mm1 kernel build fails at many places with section type
>> conflict build error.
>
> What arch?
> We have troubles with powerpc as pointed out by Al in another thread.
>
> Sam
Hi Sam,
This clean up is done for the powerpc, sorry forgot to mention it.
--
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
^ permalink raw reply
* [PATCH] sky2: fix for Yukon FE (regression in 2.6.25)
From: Stephen Hemminger @ 2008-02-05 3:45 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Petr Vandrovec, netdev
In-Reply-To: <47A51168.5040301@vandrovec.name>
The Yukon FE chip has a ram buffer therefore it needs the alignment
restriction and hang check workarounds.
Therefore:
* Autodetect the prescence/absence of ram buffer
* Rename the flag value to reflect this
* Use it consistently (ie don't reread register)
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2008-02-03 10:20:43.000000000 -0800
+++ b/drivers/net/sky2.c 2008-02-03 10:32:25.000000000 -0800
@@ -855,7 +855,7 @@ static void sky2_mac_init(struct sky2_hw
sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
/* On chips without ram buffer, pause is controled by MAC level */
- if (sky2_read8(hw, B2_E_0) == 0) {
+ if (!(hw->flags & SKY2_HW_RAM_BUFFER)) {
sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8);
sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8);
@@ -1192,7 +1192,7 @@ static struct sk_buff *sky2_rx_alloc(str
struct sk_buff *skb;
int i;
- if (sky2->hw->flags & SKY2_HW_FIFO_HANG_CHECK) {
+ if (sky2->hw->flags & SKY2_HW_RAM_BUFFER) {
unsigned char *start;
/*
* Workaround for a bug in FIFO that cause hang
@@ -1385,6 +1385,7 @@ static int sky2_up(struct net_device *de
if (ramsize > 0) {
u32 rxspace;
+ hw->flags |= SKY2_HW_RAM_BUFFER;
pr_debug(PFX "%s: ram buffer %dK\n", dev->name, ramsize);
if (ramsize < 16)
rxspace = ramsize / 2;
@@ -2023,7 +2024,7 @@ static int sky2_change_mtu(struct net_de
synchronize_irq(hw->pdev->irq);
- if (sky2_read8(hw, B2_E_0) == 0)
+ if (!(hw->flags & SKY2_HW_RAM_BUFFER))
sky2_set_tx_stfwd(hw, port);
ctl = gma_read16(hw, port, GM_GP_CTRL);
@@ -2559,7 +2560,7 @@ static void sky2_watchdog(unsigned long
++active;
/* For chips with Rx FIFO, check if stuck */
- if ((hw->flags & SKY2_HW_FIFO_HANG_CHECK) &&
+ if ((hw->flags & SKY2_HW_RAM_BUFFER) &&
sky2_rx_hung(dev)) {
pr_info(PFX "%s: receiver hang detected\n",
dev->name);
@@ -2715,11 +2716,7 @@ static int __devinit sky2_init(struct sk
switch(hw->chip_id) {
case CHIP_ID_YUKON_XL:
- hw->flags = SKY2_HW_GIGABIT
- | SKY2_HW_NEWER_PHY;
- if (hw->chip_rev < 3)
- hw->flags |= SKY2_HW_FIFO_HANG_CHECK;
-
+ hw->flags = SKY2_HW_GIGABIT | SKY2_HW_NEWER_PHY;
break;
case CHIP_ID_YUKON_EC_U:
@@ -2745,7 +2742,7 @@ static int __devinit sky2_init(struct sk
dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n");
return -EOPNOTSUPP;
}
- hw->flags = SKY2_HW_GIGABIT | SKY2_HW_FIFO_HANG_CHECK;
+ hw->flags = SKY2_HW_GIGABIT;
break;
case CHIP_ID_YUKON_FE:
--- a/drivers/net/sky2.h 2008-02-03 10:20:43.000000000 -0800
+++ b/drivers/net/sky2.h 2008-02-03 10:26:45.000000000 -0800
@@ -2045,7 +2045,7 @@ struct sky2_hw {
#define SKY2_HW_FIBRE_PHY 0x00000002
#define SKY2_HW_GIGABIT 0x00000004
#define SKY2_HW_NEWER_PHY 0x00000008
-#define SKY2_HW_FIFO_HANG_CHECK 0x00000010
+#define SKY2_HW_RAM_BUFFER 0x00000010
#define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */
#define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */
#define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */
^ permalink raw reply
* [PATCH] [POWERPC] iSeries: fix section mismatch in iseries_veth
From: Stephen Rothwell @ 2008-02-05 3:19 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev, Jeff Garzik, netdev
WARNING: vmlinux.o(.text+0x25dca0): Section mismatch in reference from the function .veth_probe() to the function .init.text:.veth_probe_one()
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/net/iseries_veth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Jeff, can this go in through the powerpc tree?
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 419861c..58d3bb6 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -1020,7 +1020,7 @@ static const struct ethtool_ops ops = {
.get_link = veth_get_link,
};
-static struct net_device * __init veth_probe_one(int vlan,
+static struct net_device *veth_probe_one(int vlan,
struct vio_dev *vio_dev)
{
struct net_device *dev;
--
1.5.4
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* Re: [2.6.24-mm1] TCP/IPv6 connect() oopses at twothirdsMD4Transform()
From: Tetsuo Handa @ 2008-02-05 3:02 UTC (permalink / raw)
To: Matt Mackall; +Cc: netdev, linux-kernel, tytso, akpm
In-Reply-To: <1202178600.17934.165.camel@cinder.waste.org>
Hello.
> random: revert braindamage that snuck into checkpatch cleanup
>
> Signed-off-by: Matt Mackall <mpm@selenic.com>
Yes. It solved the oops.
Thank you.
^ permalink raw reply
* Re: [2.6.24-mm1] TCP/IPv6 connect() oopses at twothirdsMD4Transform()
From: Matt Mackall @ 2008-02-05 2:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Tetsuo Handa, netdev, linux-kernel, Theodore Ts'o
In-Reply-To: <20080204173652.0fbe8885.akpm@linux-foundation.org>
On Mon, 2008-02-04 at 17:36 -0800, Andrew Morton wrote:
> On Tue, 05 Feb 2008 10:28:43 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> > Hello.
> >
> > Kernel config is at http://I-love.SAKURA.ne.jp/tmp/config-2.6.24-mm1
> >
> > 2.6.24 works fine.
> err, Matt?
random: revert braindamage that snuck into checkpatch cleanup
Signed-off-by: Matt Mackall <mpm@selenic.com>
diff -r 50a6e531a9f2 drivers/char/random.c
--- a/drivers/char/random.c Mon Feb 04 20:23:02 2008 -0600
+++ b/drivers/char/random.c Mon Feb 04 20:28:08 2008 -0600
@@ -1306,7 +1306,7 @@
* Rotation is separate from addition to prevent recomputation
*/
#define ROUND(f, a, b, c, d, x, s) \
- (a += f(b, c, d) + in[x], a = (a << s) | (a >> (32 - s)))
+ (a += f(b, c, d) + x, a = (a << s) | (a >> (32 - s)))
#define K1 0
#define K2 013240474631UL
#define K3 015666365641UL
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply
* Re: [PATCH 00/24 for-2.6.25] DM9000 updates for 2.6.25
From: Ben Dooks @ 2008-02-05 1:44 UTC (permalink / raw)
To: Andrew Morton; +Cc: Ben Dooks, netdev, jeff, daniel, laurentp
In-Reply-To: <20080204161940.2fc8ca14.akpm@linux-foundation.org>
On Mon, Feb 04, 2008 at 04:19:40PM -0800, Andrew Morton wrote:
> On Tue, 05 Feb 2008 00:01:59 +0000
> Ben Dooks <ben-linux@fluff.org> wrote:
>
> > Subject: [PATCH 00/24 for-2.6.25] DM9000 updates for 2.6.25
>
> Holy cow.
>
> > This patch set is a series of updates for the DM9000
> > driver, to tidy-up some of the source, stop the accesses
> > to the PHY and EEPROM sitting and spinning with locks
> > held, and to add ethtool support.
>
> Jeff, the immediate issue is that the driver doesn't compile on mips. I
> have the below lameo fix for it, but it appears to be wrong. Or at least
> suboptimal.
>
> So if you're unprepared to chew on this lot (and 24 patches two weeks into the
> merge window is one hell of a chew) then we do need to get that
> regression fixed, at least.
To be fair, jeff has already acked most of these patches, this set is
a repost hopefully without the offending patches.
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
>
> mips:
>
> drivers/net/dm9000.c: In function `dm9000_open':
> drivers/net/dm9000.c:627: error: `IRQT_RISING' undeclared (first use in this function)
> drivers/net/dm9000.c:627: error: (Each undeclared identifier is reported only once
> drivers/net/dm9000.c:627: error: for each function it appears in.)
>
> Cc: Daniel Mack <daniel@caiaq.de>
> Cc: Russell King <rmk@arm.linux.org.uk>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/dm9000.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff -puN drivers/net/dm9000.c~drivers-net-dm9000c-vague-probably-wrong-build-fix drivers/net/dm9000.c
> --- a/drivers/net/dm9000.c~drivers-net-dm9000c-vague-probably-wrong-build-fix
> +++ a/drivers/net/dm9000.c
> @@ -113,8 +113,10 @@
> #define writesw outsw
> #define writesl outsl
> #define DM9000_IRQ_FLAGS (IRQF_SHARED | IRQF_TRIGGER_HIGH)
> -#else
> +#elif defined(ARM)
> #define DM9000_IRQ_FLAGS (IRQF_SHARED | IRQT_RISING)
> +#else
> +#define DM9000_IRQ_FLAGS (IRQF_SHARED)
> #endif
>
> /*
> _
>
> --
> 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
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* Re: [2.6.24-mm1] TCP/IPv6 connect() oopses at twothirdsMD4Transform()
From: Andrew Morton @ 2008-02-05 1:36 UTC (permalink / raw)
To: Tetsuo Handa; +Cc: netdev, linux-kernel, Matt Mackall, Theodore Ts'o
In-Reply-To: <200802050128.m151ShPX088549@www262.sakura.ne.jp>
On Tue, 05 Feb 2008 10:28:43 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
> Hello.
>
> Kernel config is at http://I-love.SAKURA.ne.jp/tmp/config-2.6.24-mm1
>
> 2.6.24 works fine.
Thanks for testing and reporting. It really helps.
> Regards.
> ----------
> BUG: unable to handle kernel paging request at 25476bec
> IP: [<c0211c28>] twothirdsMD4Transform+0x78/0x37c
> *pde = 00000000
> Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
> last sysfs file: /sys/devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/type
> Modules linked in: nfsd lockd sunrpc exportfs pcnet32
>
> Pid: 2148, comm: a.out Not tainted (2.6.24-mm1 #1)
> EIP: 0060:[<c0211c28>] EFLAGS: 00010286 CPU: 0
> EIP is at twothirdsMD4Transform+0x78/0x37c
> EAX: 00084000 EBX: 08000000 ECX: 80000000 EDX: db45ddec
> ESI: 00000000 EDI: 52806380 EBP: db45dddc ESP: db45ddc8
> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> Process a.out (pid: 2148, ti=db45d000 task=deaf9250 task.ti=db45d000)
> Stack: 80000000 def6ef9c 00006380 c0759d60 db45de1c db45de28 c0211fd2 00000040
> c0759d40 00000000 00000000 00000000 01000000 52806380 1f2e00ba fffa249f
> 5a696b37 8dbe1970 cf7579d0 3b0cc350 a54b10a8 def6e9a0 00000000 def6ef8c
> Call Trace:
> [<c0211fd2>] ? secure_tcpv6_sequence_number+0x58/0x7a
> [<c0322247>] ? tcp_v6_connect+0x46d/0x4e3
> [<c02ade07>] ? lock_sock_nested+0x56/0x5e
> [<c02ecbae>] ? inet_stream_connect+0x1c/0x163
> [<c02ecc24>] ? inet_stream_connect+0x92/0x163
> [<c02ab14b>] ? sys_connect+0x72/0x98
> [<c013b945>] ? lock_release_holdtime+0x4e/0x54
> [<c0115250>] ? do_page_fault+0x1c5/0x3fc
> [<c013e858>] ? __lock_release+0x4b/0x51
> [<c0115250>] ? do_page_fault+0x1c5/0x3fc
> [<c02ab9f5>] ? sys_socketcall+0x6f/0x15e
> [<c0103ae7>] ? restore_nocheck+0x12/0x15
> [<c0103a86>] ? syscall_call+0x7/0xb
> =======================
> Code: 31 c1 03 0c ba 8b 7a 0c 01 ce 8b 4d ec c1 c6 0b 31 d9 21 f1 31 d9 03 0c ba 8b 7a 10 01 c8 8b 4d ec c1 c0 13 31 f1 21 c1 33 4d ec <03> 0c ba 8b 7a 14 01 cb 89 c1 c1 c3 03 31 f1 21 d9 31 f1 03 0c
> EIP: [<c0211c28>] twothirdsMD4Transform+0x78/0x37c SS:ESP 0068:db45ddc8
> ---[ end trace 160518059a282c77 ]---
err, Matt?
^ permalink raw reply
* [2.6.24-mm1] TCP/IPv6 connect() oopses at twothirdsMD4Transform()
From: Tetsuo Handa @ 2008-02-05 1:28 UTC (permalink / raw)
To: akpm; +Cc: netdev, linux-kernel
Hello.
Kernel config is at http://I-love.SAKURA.ne.jp/tmp/config-2.6.24-mm1
2.6.24 works fine.
Regards.
----------
BUG: unable to handle kernel paging request at 25476bec
IP: [<c0211c28>] twothirdsMD4Transform+0x78/0x37c
*pde = 00000000
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
last sysfs file: /sys/devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/type
Modules linked in: nfsd lockd sunrpc exportfs pcnet32
Pid: 2148, comm: a.out Not tainted (2.6.24-mm1 #1)
EIP: 0060:[<c0211c28>] EFLAGS: 00010286 CPU: 0
EIP is at twothirdsMD4Transform+0x78/0x37c
EAX: 00084000 EBX: 08000000 ECX: 80000000 EDX: db45ddec
ESI: 00000000 EDI: 52806380 EBP: db45dddc ESP: db45ddc8
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process a.out (pid: 2148, ti=db45d000 task=deaf9250 task.ti=db45d000)
Stack: 80000000 def6ef9c 00006380 c0759d60 db45de1c db45de28 c0211fd2 00000040
c0759d40 00000000 00000000 00000000 01000000 52806380 1f2e00ba fffa249f
5a696b37 8dbe1970 cf7579d0 3b0cc350 a54b10a8 def6e9a0 00000000 def6ef8c
Call Trace:
[<c0211fd2>] ? secure_tcpv6_sequence_number+0x58/0x7a
[<c0322247>] ? tcp_v6_connect+0x46d/0x4e3
[<c02ade07>] ? lock_sock_nested+0x56/0x5e
[<c02ecbae>] ? inet_stream_connect+0x1c/0x163
[<c02ecc24>] ? inet_stream_connect+0x92/0x163
[<c02ab14b>] ? sys_connect+0x72/0x98
[<c013b945>] ? lock_release_holdtime+0x4e/0x54
[<c0115250>] ? do_page_fault+0x1c5/0x3fc
[<c013e858>] ? __lock_release+0x4b/0x51
[<c0115250>] ? do_page_fault+0x1c5/0x3fc
[<c02ab9f5>] ? sys_socketcall+0x6f/0x15e
[<c0103ae7>] ? restore_nocheck+0x12/0x15
[<c0103a86>] ? syscall_call+0x7/0xb
=======================
Code: 31 c1 03 0c ba 8b 7a 0c 01 ce 8b 4d ec c1 c6 0b 31 d9 21 f1 31 d9 03 0c ba 8b 7a 10 01 c8 8b 4d ec c1 c0 13 31 f1 21 c1 33 4d ec <03> 0c ba 8b 7a 14 01 cb 89 c1 c1 c3 03 31 f1 21 d9 31 f1 03 0c
EIP: [<c0211c28>] twothirdsMD4Transform+0x78/0x37c SS:ESP 0068:db45ddc8
---[ end trace 160518059a282c77 ]---
^ permalink raw reply
* Re: include/linux/pcounter.h
From: Andrew Morton @ 2008-02-05 0:43 UTC (permalink / raw)
To: David Miller; +Cc: herbert, netdev, linux-kernel
In-Reply-To: <20080204.162035.74110396.davem@davemloft.net>
On Mon, 04 Feb 2008 16:20:35 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
> Date: Mon, 4 Feb 2008 01:44:02 -0800
>
> > Please do not merge pieces of generic kernel infrastructure while
> > keeping it all secret on the netdev list. Ever.
>
> It was so damn secret that it sat in your -mm tree for months.
I never noticed it and I doubt if anyone else did. How was I (or anyone
else) to have known?
> Don't be rediculious Andrew.
There is nothing ridiculous about requiring that new generic kernel
infrastructure patches be appropriately submitted and reviewed.
^ permalink raw reply
* Re: [PATCH 00/24 for-2.6.25] DM9000 updates for 2.6.25
From: Andrew Morton @ 2008-02-05 0:19 UTC (permalink / raw)
To: Ben Dooks; +Cc: netdev, jeff, daniel, laurentp
In-Reply-To: <20080205000159.432081941@fluff.org.uk>
On Tue, 05 Feb 2008 00:01:59 +0000
Ben Dooks <ben-linux@fluff.org> wrote:
> Subject: [PATCH 00/24 for-2.6.25] DM9000 updates for 2.6.25
Holy cow.
> This patch set is a series of updates for the DM9000
> driver, to tidy-up some of the source, stop the accesses
> to the PHY and EEPROM sitting and spinning with locks
> held, and to add ethtool support.
Jeff, the immediate issue is that the driver doesn't compile on mips. I
have the below lameo fix for it, but it appears to be wrong. Or at least
suboptimal.
So if you're unprepared to chew on this lot (and 24 patches two weeks into the
merge window is one hell of a chew) then we do need to get that
regression fixed, at least.
From: Andrew Morton <akpm@linux-foundation.org>
mips:
drivers/net/dm9000.c: In function `dm9000_open':
drivers/net/dm9000.c:627: error: `IRQT_RISING' undeclared (first use in this function)
drivers/net/dm9000.c:627: error: (Each undeclared identifier is reported only once
drivers/net/dm9000.c:627: error: for each function it appears in.)
Cc: Daniel Mack <daniel@caiaq.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/dm9000.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff -puN drivers/net/dm9000.c~drivers-net-dm9000c-vague-probably-wrong-build-fix drivers/net/dm9000.c
--- a/drivers/net/dm9000.c~drivers-net-dm9000c-vague-probably-wrong-build-fix
+++ a/drivers/net/dm9000.c
@@ -113,8 +113,10 @@
#define writesw outsw
#define writesl outsl
#define DM9000_IRQ_FLAGS (IRQF_SHARED | IRQF_TRIGGER_HIGH)
-#else
+#elif defined(ARM)
#define DM9000_IRQ_FLAGS (IRQF_SHARED | IRQT_RISING)
+#else
+#define DM9000_IRQ_FLAGS (IRQF_SHARED)
#endif
/*
_
^ permalink raw reply
* Re: include/linux/pcounter.h
From: David Miller @ 2008-02-05 0:20 UTC (permalink / raw)
To: akpm; +Cc: herbert, netdev, linux-kernel
In-Reply-To: <20080204014402.1c55d3fe.akpm@linux-foundation.org>
From: Andrew Morton <akpm@linux-foundation.org>
Date: Mon, 4 Feb 2008 01:44:02 -0800
> Please do not merge pieces of generic kernel infrastructure while
> keeping it all secret on the netdev list. Ever.
It was so damn secret that it sat in your -mm tree for months.
Don't be rediculious Andrew.
^ permalink raw reply
* Re: [PATCH 02/24 for-2.6.25] DM9000: Add platform data to specify external phy
From: Ben Dooks @ 2008-02-05 0:14 UTC (permalink / raw)
To: Ben Dooks; +Cc: netdev, jeff, akpm, daniel, laurentp, Ben Dooks
In-Reply-To: <20080205000814.732404707@fluff.org.uk>
This should have been:
Patch from: Laurent Pinchart <laurentp@cse-semaphore.com>
This patch adds a flag to the DM9000 platform data which, when set,
configures the device to use an external PHY.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Ben Dooks <ben-linuy@fluff.org>
> Index: linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
> ===================================================================
> --- linux-2.6.24-git5-dm9k.orig/drivers/net/dm9000.c
> +++ linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
> @@ -137,6 +137,7 @@ typedef struct board_info {
> u16 dbug_cnt;
> u8 io_mode; /* 0:word, 2:byte */
> u8 phy_addr;
> + unsigned int flags;
>
> void (*inblk)(void __iomem *port, void *data, int length);
> void (*outblk)(void __iomem *port, void *data, int length);
> @@ -525,6 +526,8 @@ dm9000_probe(struct platform_device *pde
>
> if (pdata->dumpblk != NULL)
> db->dumpblk = pdata->dumpblk;
> +
> + db->flags = pdata->flags;
> }
>
> dm9000_reset(db);
> @@ -665,6 +668,9 @@ dm9000_init_dm9000(struct net_device *de
> iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
> iow(db, DM9000_GPR, 0); /* Enable PHY */
>
> + if (db->flags & DM9000_PLATF_EXT_PHY)
> + iow(db, DM9000_NCR, NCR_EXT_PHY);
> +
> /* Program operating register */
> iow(db, DM9000_TCR, 0); /* TX Polling clear */
> iow(db, DM9000_BPTR, 0x3f); /* Less 3Kb, 200us */
> Index: linux-2.6.24-git5-dm9k/include/linux/dm9000.h
> ===================================================================
> --- linux-2.6.24-git5-dm9k.orig/include/linux/dm9000.h
> +++ linux-2.6.24-git5-dm9k/include/linux/dm9000.h
> @@ -19,6 +19,7 @@
> #define DM9000_PLATF_8BITONLY (0x0001)
> #define DM9000_PLATF_16BITONLY (0x0002)
> #define DM9000_PLATF_32BITONLY (0x0004)
> +#define DM9000_PLATF_EXT_PHY (0x0008)
>
> /* platfrom data for platfrom device structure's platfrom_data field */
>
>
> --
> Ben (ben@fluff.org, http://www.fluff.org/)
>
> 'a smiley only costs 4 bytes'
> --
> 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
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* Re: [PATCH 01/24 for-2.6.25] DM9000: Fix endian-ness of data accesses.
From: Ben Dooks @ 2008-02-05 0:13 UTC (permalink / raw)
To: Ben Dooks; +Cc: netdev, jeff, akpm, daniel, laurentp
In-Reply-To: <20080205000814.539308209@fluff.org.uk>
On Tue, Feb 05, 2008 at 12:02:00AM +0000, Ben Dooks wrote:
This should have been:
Patch From: Laurent Pinchart <laurentp@cse-semaphore.com>
This patch splits the receive status in 8bit wide fields and convert the
packet length from little endian to CPU byte order.
Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
> Index: linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
> ===================================================================
> --- linux-2.6.24-git5-dm9k.orig/drivers/net/dm9000.c
> +++ linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
> @@ -867,7 +867,8 @@ dm9000_timer(unsigned long data)
> }
>
> struct dm9000_rxhdr {
> - u16 RxStatus;
> + u8 RxPktReady;
> + u8 RxStatus;
> u16 RxLen;
> } __attribute__((__packed__));
>
> @@ -908,7 +909,7 @@ dm9000_rx(struct net_device *dev)
>
> (db->inblk)(db->io_data, &rxhdr, sizeof(rxhdr));
>
> - RxLen = rxhdr.RxLen;
> + RxLen = le16_to_cpu(rxhdr.RxLen);
>
> /* Packet Status check */
> if (RxLen < 0x40) {
> @@ -920,17 +921,17 @@ dm9000_rx(struct net_device *dev)
> PRINTK1("RST: RX Len:%x\n", RxLen);
> }
>
> - if (rxhdr.RxStatus & 0xbf00) {
> + if (rxhdr.RxStatus & 0xbf) {
> GoodPacket = false;
> - if (rxhdr.RxStatus & 0x100) {
> + if (rxhdr.RxStatus & 0x01) {
> PRINTK1("fifo error\n");
> dev->stats.rx_fifo_errors++;
> }
> - if (rxhdr.RxStatus & 0x200) {
> + if (rxhdr.RxStatus & 0x02) {
> PRINTK1("crc error\n");
> dev->stats.rx_crc_errors++;
> }
> - if (rxhdr.RxStatus & 0x8000) {
> + if (rxhdr.RxStatus & 0x80) {
> PRINTK1("length error\n");
> dev->stats.rx_length_errors++;
> }
>
> --
> Ben (ben@fluff.org, http://www.fluff.org/)
>
> 'a smiley only costs 4 bytes'
> --
> 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
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* [PATCH 10/24 for-2.6.25] DM9000: Remove barely used SROM array read.
From: Ben Dooks @ 2008-02-05 0:02 UTC (permalink / raw)
To: netdev; +Cc: jeff, akpm, daniel, laurentp, Ben Dooks
In-Reply-To: <20080205000159.432081941@fluff.org.uk>
[-- Attachment #1: simtec/simtec-drivers-net-dm9000-remove-srom-read.patch --]
[-- Type: text/plain, Size: 2666 bytes --]
The srom array in the board data is only being used in the device probe
routines. The probe also only uses the first 6 bytes of an array
we spend 512ms reading 128 bytes from. Change to reading the
MAC area directly to the MAC address structure.
As a side product, we rename the read_srom_word to dm9000_read_eeprom
to bring it into line with the rest of the driver. No change is made
to the delay in this function, which will be dealt with in a later
patch.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.24-quilt3/drivers/net/dm9000.c
===================================================================
--- linux-2.6.24-quilt3.orig/drivers/net/dm9000.c
+++ linux-2.6.24-quilt3/drivers/net/dm9000.c
@@ -132,7 +132,6 @@ typedef struct board_info {
struct resource *data_req;
struct resource *irq_res;
- unsigned char srom[128];
spinlock_t lock;
struct mii_if_info mii;
@@ -166,7 +165,8 @@ static irqreturn_t dm9000_interrupt(int,
static int dm9000_phy_read(struct net_device *dev, int phyaddr_unsused, int reg);
static void dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg,
int value);
-static u16 read_srom_word(board_info_t *, int);
+
+static void dm9000_read_eeprom(board_info_t *, int addr, unsigned char *to);
static void dm9000_rx(struct net_device *);
static void dm9000_hash_table(struct net_device *);
@@ -630,13 +630,9 @@ dm9000_probe(struct platform_device *pde
db->mii.mdio_read = dm9000_phy_read;
db->mii.mdio_write = dm9000_phy_write;
- /* Read SROM content */
- for (i = 0; i < 64; i++)
- ((u16 *) db->srom)[i] = read_srom_word(db, i);
-
- /* Set Node Address */
- for (i = 0; i < 6; i++)
- ndev->dev_addr[i] = db->srom[i];
+ /* try reading the node address from the attached EEPROM */
+ for (i = 0; i < 6; i += 2)
+ dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i);
if (!is_valid_ether_addr(ndev->dev_addr)) {
/* try reading from mac */
@@ -1001,17 +997,19 @@ dm9000_rx(struct net_device *dev)
}
/*
- * Read a word data from SROM
+ * Read a word data from EEPROM
*/
-static u16
-read_srom_word(board_info_t * db, int offset)
+static void
+dm9000_read_eeprom(board_info_t * db, int offset, unsigned char *to)
{
iow(db, DM9000_EPAR, offset);
iow(db, DM9000_EPCR, EPCR_ERPRR);
mdelay(8); /* according to the datasheet 200us should be enough,
but it doesn't work */
iow(db, DM9000_EPCR, 0x0);
- return (ior(db, DM9000_EPDRL) + (ior(db, DM9000_EPDRH) << 8));
+
+ to[0] = ior(db, DM9000_EPDRL);
+ to[1] = ior(db, DM9000_EPDRH);
}
#ifdef DM9000_PROGRAM_EEPROM
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* [PATCH 08/24 for-2.6.25] DM9000: Do not sleep with spinlock and IRQs held
From: Ben Dooks @ 2008-02-05 0:02 UTC (permalink / raw)
To: netdev; +Cc: jeff, akpm, daniel, laurentp, Ben Dooks
In-Reply-To: <20080205000159.432081941@fluff.org.uk>
[-- Attachment #1: simtec/simtec-drivers-net-dm9000-phy-unlocksleep.patch --]
[-- Type: text/plain, Size: 1886 bytes --]
The phy read and write routines call udelay() with the board
lock held, and with the posibility of IRQs being disabled. Since
these delays can be up to 500usec, and are only required as we
have to save the chip's address register.
To improve the behaviour, hold the lock whilst we are writing
and then restore the state before the delay and then repeat
the process once the delay has happened.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.24-quilt3/drivers/net/dm9000.c
===================================================================
--- linux-2.6.24-quilt3.orig/drivers/net/dm9000.c
+++ linux-2.6.24-quilt3/drivers/net/dm9000.c
@@ -1130,7 +1130,15 @@ dm9000_phy_read(struct net_device *dev,
iow(db, DM9000_EPAR, DM9000_PHY | reg);
iow(db, DM9000_EPCR, 0xc); /* Issue phyxcer read command */
+
+ writeb(reg_save, db->io_addr);
+ spin_unlock_irqrestore(&db->lock,flags);
+
udelay(100); /* Wait read complete */
+
+ spin_lock_irqsave(&db->lock,flags);
+ reg_save = readb(db->io_addr);
+
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */
/* The read data keeps on REG_0D & REG_0E */
@@ -1138,7 +1146,6 @@ dm9000_phy_read(struct net_device *dev,
/* restore the previous address */
writeb(reg_save, db->io_addr);
-
spin_unlock_irqrestore(&db->lock,flags);
return ret;
@@ -1167,7 +1174,15 @@ dm9000_phy_write(struct net_device *dev,
iow(db, DM9000_EPDRH, ((value >> 8) & 0xff));
iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */
+
+ writeb(reg_save, db->io_addr);
+ spin_unlock_irqrestore(&db->lock,flags);
+
udelay(500); /* Wait write complete */
+
+ spin_lock_irqsave(&db->lock,flags);
+ reg_save = readb(db->io_addr);
+
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
/* restore the previous address */
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* [PATCH 05/24 for-2.6.25] DM9000: Pass IRQ flags via platform resources
From: Ben Dooks @ 2008-02-05 0:02 UTC (permalink / raw)
To: netdev; +Cc: jeff, akpm, daniel, laurentp, Ben Dooks, Bryan Wu, Alex Landau
In-Reply-To: <20080205000159.432081941@fluff.org.uk>
[-- Attachment #1: simtec/simtec-drivers-net-dm9000-platdata-irq.patch --]
[-- Type: text/plain, Size: 2192 bytes --]
Use the flags in the IRQ resource to specify the type of
IRQ being requested, so that systems which do not have
level-based interrupts, or change the interrupt in some
other way can specify this without making an #ifdef mess
in the driver.
This is specifically designed to undo the change in commit
4e4fc05a2b6e7bd2e0facd96e0c18dceb34d9349 which hardwires the
type for everyone but blackfin to IRQT_RISING, which breaks
all a number of Simtec boards which use (and setup in the
bootloader) active low IRQs.
Note, although there where originally objections due to
the use of IORESOURCE_IRQ and IRQT_ flags not sharing the
same definition, at least <include/linux/interrupt.h> notes
these are the same.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
CC: Daniel Mack <daniel@caiaq.de>
CC: Bryan Wu <bryan.wu@analog.com>
CC: Alex Landau <landau.alex@gmail.com>
Index: linux-2.6.24-quilt2/drivers/net/dm9000.c
===================================================================
--- linux-2.6.24-quilt2.orig/drivers/net/dm9000.c
+++ linux-2.6.24-quilt2/drivers/net/dm9000.c
@@ -90,9 +90,9 @@
#define writesb outsb
#define writesw outsw
#define writesl outsl
-#define DM9000_IRQ_FLAGS (IRQF_SHARED | IRQF_TRIGGER_HIGH)
+#define DEFAULT_TRIGGER IRQF_TRIGGER_HIGH
#else
-#define DM9000_IRQ_FLAGS (IRQF_SHARED | IRQT_RISING)
+#define DEFAULT_TRIGGER (0)
#endif
/*
@@ -614,10 +614,21 @@ static int
dm9000_open(struct net_device *dev)
{
board_info_t *db = (board_info_t *) dev->priv;
+ unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK;
dev_dbg(db->dev, "entering %s\n", __func__);
- if (request_irq(dev->irq, &dm9000_interrupt, DM9000_IRQ_FLAGS, dev->name, dev))
+ /* If there is no IRQ type specified, default to something that
+ * may work, and tell the user that this is a problem */
+
+ if (irqflags == IRQF_TRIGGER_NONE) {
+ dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
+ irqflags = DEFAULT_TRIGGER;
+ }
+
+ irqflags |= IRQF_SHARED;
+
+ if (request_irq(dev->irq, &dm9000_interrupt, irqflags, dev->name, dev))
return -EAGAIN;
/* Initialize DM9000 board */
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* [PATCH 11/24 for-2.6.25] DM9000: Add mutex to protect access
From: Ben Dooks @ 2008-02-05 0:02 UTC (permalink / raw)
To: netdev; +Cc: jeff, akpm, daniel, laurentp, Ben Dooks
In-Reply-To: <20080205000159.432081941@fluff.org.uk>
[-- Attachment #1: simtec/simtec-drivers-net-dm9000-lock-eeprom.patch --]
[-- Type: text/plain, Size: 4976 bytes --]
Add a mutex to serialise access to the chip functions from
entries such as the ethtool and the MII code. This should
reduce the amount of time the spinlock is held to protect
the address register.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.24-quilt3/drivers/net/dm9000.c
===================================================================
--- linux-2.6.24-quilt3.orig/drivers/net/dm9000.c
+++ linux-2.6.24-quilt3/drivers/net/dm9000.c
@@ -102,6 +102,24 @@ static int watchdog = 5000;
module_param(watchdog, int, 0400);
MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
+/* DM9000 register address locking.
+ *
+ * The DM9000 uses an address register to control where data written
+ * to the data register goes. This means that the address register
+ * must be preserved over interrupts or similar calls.
+ *
+ * During interrupt and other critical calls, a spinlock is used to
+ * protect the system, but the calls themselves save the address
+ * in the address register in case they are interrupting another
+ * access to the device.
+ *
+ * For general accesses a lock is provided so that calls which are
+ * allowed to sleep are serialised so that the address register does
+ * not need to be saved. This lock also serves to serialise access
+ * to the EEPROM and PHY access registers which are shared between
+ * these two devices.
+ */
+
/* Structure/enum declaration ------------------------------- */
typedef struct board_info {
@@ -132,6 +150,8 @@ typedef struct board_info {
struct resource *data_req;
struct resource *irq_res;
+ struct mutex addr_lock; /* phy and eeprom access lock */
+
spinlock_t lock;
struct mii_if_info mii;
@@ -365,26 +385,16 @@ static void dm9000_get_drvinfo(struct ne
static int dm9000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
board_info_t *dm = to_dm9000_board(dev);
- unsigned long flags;
- spin_lock_irqsave(&dm->lock, flags);
mii_ethtool_gset(&dm->mii, cmd);
- spin_lock_irqsave(&dm->lock, flags);
-
return 0;
}
static int dm9000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
board_info_t *dm = to_dm9000_board(dev);
- unsigned long flags;
- int rc;
-
- spin_lock_irqsave(&dm->lock, flags);
- rc = mii_ethtool_sset(&dm->mii, cmd);
- spin_lock_irqsave(&dm->lock, flags);
- return rc;
+ return mii_ethtool_sset(&dm->mii, cmd);
}
static int dm9000_nway_reset(struct net_device *dev)
@@ -475,6 +485,7 @@ dm9000_probe(struct platform_device *pde
db->dev = &pdev->dev;
spin_lock_init(&db->lock);
+ mutex_init(&db->addr_lock);
if (pdev->num_resources < 2) {
ret = -ENODEV;
@@ -1000,8 +1011,10 @@ dm9000_rx(struct net_device *dev)
* Read a word data from EEPROM
*/
static void
-dm9000_read_eeprom(board_info_t * db, int offset, unsigned char *to)
+dm9000_read_eeprom(board_info_t *db, int offset, unsigned char *to)
{
+ mutex_lock(&db->addr_lock);
+
iow(db, DM9000_EPAR, offset);
iow(db, DM9000_EPCR, EPCR_ERPRR);
mdelay(8); /* according to the datasheet 200us should be enough,
@@ -1010,6 +1023,8 @@ dm9000_read_eeprom(board_info_t * db, in
to[0] = ior(db, DM9000_EPDRL);
to[1] = ior(db, DM9000_EPDRH);
+
+ mutex_unlock(&db->addr_lock);
}
#ifdef DM9000_PROGRAM_EEPROM
@@ -1019,12 +1034,16 @@ dm9000_read_eeprom(board_info_t * db, in
static void
write_srom_word(board_info_t * db, int offset, u16 val)
{
+ mutex_lock(&db->addr_lock);
+
iow(db, DM9000_EPAR, offset);
iow(db, DM9000_EPDRH, ((val >> 8) & 0xff));
iow(db, DM9000_EPDRL, (val & 0xff));
iow(db, DM9000_EPCR, EPCR_WEP | EPCR_ERPRW);
mdelay(8); /* same shit */
iow(db, DM9000_EPCR, 0);
+
+ mutex_unlock(&db->addr_lock);
}
/*
@@ -1132,6 +1151,8 @@ dm9000_phy_read(struct net_device *dev,
unsigned int reg_save;
int ret;
+ mutex_lock(&db->addr_lock);
+
spin_lock_irqsave(&db->lock,flags);
/* Save previous register address */
@@ -1159,6 +1180,7 @@ dm9000_phy_read(struct net_device *dev,
writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock,flags);
+ mutex_unlock(&db->addr_lock);
return ret;
}
@@ -1172,6 +1194,8 @@ dm9000_phy_write(struct net_device *dev,
unsigned long flags;
unsigned long reg_save;
+ mutex_lock(&db->addr_lock);
+
spin_lock_irqsave(&db->lock,flags);
/* Save previous register address */
@@ -1187,7 +1211,7 @@ dm9000_phy_write(struct net_device *dev,
iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */
writeb(reg_save, db->io_addr);
- spin_unlock_irqrestore(&db->lock,flags);
+ spin_unlock_irqrestore(&db->lock, flags);
dm9000_msleep(db, 1); /* Wait write complete */
@@ -1199,7 +1223,8 @@ dm9000_phy_write(struct net_device *dev,
/* restore the previous address */
writeb(reg_save, db->io_addr);
- spin_unlock_irqrestore(&db->lock,flags);
+ spin_unlock_irqrestore(&db->lock, flags);
+ mutex_unlock(&db->addr_lock);
}
static int
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ permalink raw reply
* [PATCH 09/24 for-2.6.25] DM9000: Use msleep() instead of udelay()
From: Ben Dooks @ 2008-02-05 0:02 UTC (permalink / raw)
To: netdev; +Cc: jeff, akpm, daniel, laurentp, Ben Dooks
In-Reply-To: <20080205000159.432081941@fluff.org.uk>
[-- Attachment #1: simtec/simtec-drivers-net-dm9000-phy-msleep.patch --]
[-- Type: text/plain, Size: 2191 bytes --]
We can use sleeping functions when reading and writing the
PHY registers, so let us sleep instead of busy waiting for
the PHY.
Note, this also fixes a bug reading the PHY where only 100uS
was being used instead of 150uS
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Index: linux-2.6.24-quilt3/drivers/net/dm9000.c
===================================================================
--- linux-2.6.24-quilt3.orig/drivers/net/dm9000.c
+++ linux-2.6.24-quilt3/drivers/net/dm9000.c
@@ -116,6 +116,7 @@ typedef struct board_info {
u8 io_mode; /* 0:word, 2:byte */
u8 phy_addr;
unsigned int flags;
+ unsigned int in_suspend :1;
int debug_level;
@@ -1111,6 +1112,18 @@ dm9000_hash_table(struct net_device *dev
/*
+ * Sleep, either by using msleep() or if we are suspending, then
+ * use mdelay() to sleep.
+ */
+static void dm9000_msleep(board_info_t *db, unsigned int ms)
+{
+ if (db->in_suspend)
+ mdelay(ms);
+ else
+ msleep(ms);
+}
+
+/*
* Read a word from phyxcer
*/
static int
@@ -1134,7 +1147,7 @@ dm9000_phy_read(struct net_device *dev,
writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock,flags);
- udelay(100); /* Wait read complete */
+ dm9000_msleep(db, 1); /* Wait read complete */
spin_lock_irqsave(&db->lock,flags);
reg_save = readb(db->io_addr);
@@ -1178,7 +1191,7 @@ dm9000_phy_write(struct net_device *dev,
writeb(reg_save, db->io_addr);
spin_unlock_irqrestore(&db->lock,flags);
- udelay(500); /* Wait write complete */
+ dm9000_msleep(db, 1); /* Wait write complete */
spin_lock_irqsave(&db->lock,flags);
reg_save = readb(db->io_addr);
@@ -1195,8 +1208,12 @@ static int
dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
{
struct net_device *ndev = platform_get_drvdata(dev);
+ board_info_t *db;
if (ndev) {
+ db = (board_info_t *) ndev->priv;
+ db->in_suspend = 1;
+
if (netif_running(ndev)) {
netif_device_detach(ndev);
dm9000_shutdown(ndev);
@@ -1219,6 +1236,8 @@ dm9000_drv_resume(struct platform_device
netif_device_attach(ndev);
}
+
+ db->in_suspend = 0;
}
return 0;
}
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
^ 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