* [PATCH 13/20] appletalk: move to staging
From: Arnd Bergmann @ 2011-01-25 22:17 UTC (permalink / raw)
To: linux-kernel
Cc: Arnd Bergmann, Arnaldo Carvalho de Melo, netdev,
Greg Kroah-Hartman
In-Reply-To: <1295993854-4971-1-git-send-email-arnd@arndb.de>
For all I know, Appletalk is dead, the only reasonable
use right now would be nostalgia, and that can be served
well enough by old kernels. The code is largely not
in a bad shape, but it still uses the big kernel lock,
and nobody seems motivated to change that.
FWIW, the last release of MacOS that supported Appletalk
was MacOS X 10.5, made in 2007, and it has been abandoned
by Apple with 10.6. Using TCP/IP instead of Appletalk has
been supported since MacOS 7.6, which was released in
1997 and is able to run on most of the legacy hardware.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
MAINTAINERS | 3 +--
drivers/net/Makefile | 1 -
drivers/net/appletalk/Makefile | 7 -------
drivers/staging/Kconfig | 2 ++
drivers/staging/Makefile | 1 +
drivers/{net => staging}/appletalk/Kconfig | 0
{net => drivers/staging}/appletalk/Makefile | 7 +++++--
{net => drivers/staging}/appletalk/aarp.c | 2 +-
.../linux => drivers/staging/appletalk}/atalk.h | 0
{net => drivers/staging}/appletalk/atalk_proc.c | 2 +-
drivers/{net => staging}/appletalk/cops.c | 2 +-
drivers/{net => staging}/appletalk/cops.h | 0
drivers/{net => staging}/appletalk/cops_ffdrv.h | 0
drivers/{net => staging}/appletalk/cops_ltdrv.h | 0
{net => drivers/staging}/appletalk/ddp.c | 4 ++--
{net => drivers/staging}/appletalk/dev.c | 0
drivers/{net => staging}/appletalk/ipddp.c | 2 +-
drivers/{net => staging}/appletalk/ipddp.h | 0
drivers/{net => staging}/appletalk/ltpc.c | 2 +-
drivers/{net => staging}/appletalk/ltpc.h | 0
.../staging}/appletalk/sysctl_net_atalk.c | 2 +-
fs/compat_ioctl.c | 1 -
include/linux/Kbuild | 1 -
net/Kconfig | 1 -
net/Makefile | 1 -
net/socket.c | 1 -
26 files changed, 17 insertions(+), 25 deletions(-)
delete mode 100644 drivers/net/appletalk/Makefile
rename drivers/{net => staging}/appletalk/Kconfig (100%)
rename {net => drivers/staging}/appletalk/Makefile (56%)
rename {net => drivers/staging}/appletalk/aarp.c (99%)
rename {include/linux => drivers/staging/appletalk}/atalk.h (100%)
rename {net => drivers/staging}/appletalk/atalk_proc.c (99%)
rename drivers/{net => staging}/appletalk/cops.c (99%)
rename drivers/{net => staging}/appletalk/cops.h (100%)
rename drivers/{net => staging}/appletalk/cops_ffdrv.h (100%)
rename drivers/{net => staging}/appletalk/cops_ltdrv.h (100%)
rename {net => drivers/staging}/appletalk/ddp.c (99%)
rename {net => drivers/staging}/appletalk/dev.c (100%)
rename drivers/{net => staging}/appletalk/ipddp.c (99%)
rename drivers/{net => staging}/appletalk/ipddp.h (100%)
rename drivers/{net => staging}/appletalk/ltpc.c (99%)
rename drivers/{net => staging}/appletalk/ltpc.h (100%)
rename {net => drivers/staging}/appletalk/sysctl_net_atalk.c (98%)
diff --git a/MAINTAINERS b/MAINTAINERS
index fe5ca5f..5021051 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -554,8 +554,7 @@ F: drivers/hwmon/applesmc.c
APPLETALK NETWORK LAYER
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
S: Maintained
-F: drivers/net/appletalk/
-F: net/appletalk/
+F: drivers/staging/appletalk/
ARC FRAMEBUFFER DRIVER
M: Jaya Kumar <jayalk@intworks.biz>
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index b90738d..11a9c05 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -265,7 +265,6 @@ obj-$(CONFIG_MACB) += macb.o
obj-$(CONFIG_S6GMAC) += s6gmac.o
obj-$(CONFIG_ARM) += arm/
-obj-$(CONFIG_DEV_APPLETALK) += appletalk/
obj-$(CONFIG_TR) += tokenring/
obj-$(CONFIG_WAN) += wan/
obj-$(CONFIG_ARCNET) += arcnet/
diff --git a/drivers/net/appletalk/Makefile b/drivers/net/appletalk/Makefile
deleted file mode 100644
index 6cfc705..0000000
--- a/drivers/net/appletalk/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Makefile for drivers/net/appletalk
-#
-
-obj-$(CONFIG_IPDDP) += ipddp.o
-obj-$(CONFIG_COPS) += cops.o
-obj-$(CONFIG_LTPC) += ltpc.o
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 9fc5aa6..04514b5 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -167,6 +167,8 @@ source "drivers/staging/bcm/Kconfig"
source "drivers/staging/ft1000/Kconfig"
+source "drivers/staging/appletalk/Kconfig"
+
source "drivers/staging/intel_sst/Kconfig"
source "drivers/staging/speakup/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 878f381..0ec94e8 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -64,6 +64,7 @@ obj-$(CONFIG_ATH6K_LEGACY) += ath6kl/
obj-$(CONFIG_USB_ENESTORAGE) += keucr/
obj-$(CONFIG_BCM_WIMAX) += bcm/
obj-$(CONFIG_FT1000) += ft1000/
+obj-$(CONFIG_DEV_APPLETALK) += appletalk/
obj-$(CONFIG_SND_INTEL_SST) += intel_sst/
obj-$(CONFIG_SPEAKUP) += speakup/
obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217) += cptm1217/
diff --git a/drivers/net/appletalk/Kconfig b/drivers/staging/appletalk/Kconfig
similarity index 100%
rename from drivers/net/appletalk/Kconfig
rename to drivers/staging/appletalk/Kconfig
diff --git a/net/appletalk/Makefile b/drivers/staging/appletalk/Makefile
similarity index 56%
rename from net/appletalk/Makefile
rename to drivers/staging/appletalk/Makefile
index 5cda56e..2a5129a 100644
--- a/net/appletalk/Makefile
+++ b/drivers/staging/appletalk/Makefile
@@ -1,9 +1,12 @@
#
-# Makefile for the Linux AppleTalk layer.
+# Makefile for drivers/staging/appletalk
#
-
obj-$(CONFIG_ATALK) += appletalk.o
appletalk-y := aarp.o ddp.o dev.o
appletalk-$(CONFIG_PROC_FS) += atalk_proc.o
appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o
+
+obj-$(CONFIG_IPDDP) += ipddp.o
+obj-$(CONFIG_COPS) += cops.o
+obj-$(CONFIG_LTPC) += ltpc.o
diff --git a/net/appletalk/aarp.c b/drivers/staging/appletalk/aarp.c
similarity index 99%
rename from net/appletalk/aarp.c
rename to drivers/staging/appletalk/aarp.c
index 50dce79..7163a1d 100644
--- a/net/appletalk/aarp.c
+++ b/drivers/staging/appletalk/aarp.c
@@ -34,7 +34,7 @@
#include <net/sock.h>
#include <net/datalink.h>
#include <net/psnap.h>
-#include <linux/atalk.h>
+#include "atalk.h"
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
diff --git a/include/linux/atalk.h b/drivers/staging/appletalk/atalk.h
similarity index 100%
rename from include/linux/atalk.h
rename to drivers/staging/appletalk/atalk.h
diff --git a/net/appletalk/atalk_proc.c b/drivers/staging/appletalk/atalk_proc.c
similarity index 99%
rename from net/appletalk/atalk_proc.c
rename to drivers/staging/appletalk/atalk_proc.c
index 6ef0e76..d012ba2 100644
--- a/net/appletalk/atalk_proc.c
+++ b/drivers/staging/appletalk/atalk_proc.c
@@ -13,7 +13,7 @@
#include <linux/seq_file.h>
#include <net/net_namespace.h>
#include <net/sock.h>
-#include <linux/atalk.h>
+#include "atalk.h"
static __inline__ struct atalk_iface *atalk_get_interface_idx(loff_t pos)
diff --git a/drivers/net/appletalk/cops.c b/drivers/staging/appletalk/cops.c
similarity index 99%
rename from drivers/net/appletalk/cops.c
rename to drivers/staging/appletalk/cops.c
index 748c9f5..661d42e 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/staging/appletalk/cops.c
@@ -65,7 +65,6 @@ static const char *version =
#include <linux/if_arp.h>
#include <linux/if_ltalk.h>
#include <linux/delay.h> /* For udelay() */
-#include <linux/atalk.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
@@ -74,6 +73,7 @@ static const char *version =
#include <asm/io.h>
#include <asm/dma.h>
+#include "atalk.h"
#include "cops.h" /* Our Stuff */
#include "cops_ltdrv.h" /* Firmware code for Tangent type cards. */
#include "cops_ffdrv.h" /* Firmware code for Dayna type cards. */
diff --git a/drivers/net/appletalk/cops.h b/drivers/staging/appletalk/cops.h
similarity index 100%
rename from drivers/net/appletalk/cops.h
rename to drivers/staging/appletalk/cops.h
diff --git a/drivers/net/appletalk/cops_ffdrv.h b/drivers/staging/appletalk/cops_ffdrv.h
similarity index 100%
rename from drivers/net/appletalk/cops_ffdrv.h
rename to drivers/staging/appletalk/cops_ffdrv.h
diff --git a/drivers/net/appletalk/cops_ltdrv.h b/drivers/staging/appletalk/cops_ltdrv.h
similarity index 100%
rename from drivers/net/appletalk/cops_ltdrv.h
rename to drivers/staging/appletalk/cops_ltdrv.h
diff --git a/net/appletalk/ddp.c b/drivers/staging/appletalk/ddp.c
similarity index 99%
rename from net/appletalk/ddp.c
rename to drivers/staging/appletalk/ddp.c
index c410b93..940dd19 100644
--- a/net/appletalk/ddp.c
+++ b/drivers/staging/appletalk/ddp.c
@@ -63,8 +63,8 @@
#include <net/sock.h>
#include <net/tcp_states.h>
#include <net/route.h>
-#include <linux/atalk.h>
-#include "../core/kmap_skb.h"
+#include "atalk.h"
+#include "../../net/core/kmap_skb.h"
struct datalink_proto *ddp_dl, *aarp_dl;
static const struct proto_ops atalk_dgram_ops;
diff --git a/net/appletalk/dev.c b/drivers/staging/appletalk/dev.c
similarity index 100%
rename from net/appletalk/dev.c
rename to drivers/staging/appletalk/dev.c
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/staging/appletalk/ipddp.c
similarity index 99%
rename from drivers/net/appletalk/ipddp.c
rename to drivers/staging/appletalk/ipddp.c
index 10d0dba..58b4e60 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/staging/appletalk/ipddp.c
@@ -29,12 +29,12 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ip.h>
-#include <linux/atalk.h>
#include <linux/if_arp.h>
#include <linux/slab.h>
#include <net/route.h>
#include <asm/uaccess.h>
+#include "atalk.h"
#include "ipddp.h" /* Our stuff */
static const char version[] = KERN_INFO "ipddp.c:v0.01 8/28/97 Bradford W. Johnson <johns393@maroon.tc.umn.edu>\n";
diff --git a/drivers/net/appletalk/ipddp.h b/drivers/staging/appletalk/ipddp.h
similarity index 100%
rename from drivers/net/appletalk/ipddp.h
rename to drivers/staging/appletalk/ipddp.h
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/staging/appletalk/ltpc.c
similarity index 99%
rename from drivers/net/appletalk/ltpc.c
rename to drivers/staging/appletalk/ltpc.c
index e69eead..60caf89 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/staging/appletalk/ltpc.c
@@ -225,7 +225,6 @@ static int dma;
#include <linux/if_ltalk.h>
#include <linux/delay.h>
#include <linux/timer.h>
-#include <linux/atalk.h>
#include <linux/bitops.h>
#include <linux/gfp.h>
@@ -234,6 +233,7 @@ static int dma;
#include <asm/io.h>
/* our stuff */
+#include "atalk.h"
#include "ltpc.h"
static DEFINE_SPINLOCK(txqueue_lock);
diff --git a/drivers/net/appletalk/ltpc.h b/drivers/staging/appletalk/ltpc.h
similarity index 100%
rename from drivers/net/appletalk/ltpc.h
rename to drivers/staging/appletalk/ltpc.h
diff --git a/net/appletalk/sysctl_net_atalk.c b/drivers/staging/appletalk/sysctl_net_atalk.c
similarity index 98%
rename from net/appletalk/sysctl_net_atalk.c
rename to drivers/staging/appletalk/sysctl_net_atalk.c
index 04e9c0d..4c896b6 100644
--- a/net/appletalk/sysctl_net_atalk.c
+++ b/drivers/staging/appletalk/sysctl_net_atalk.c
@@ -8,7 +8,7 @@
#include <linux/sysctl.h>
#include <net/sock.h>
-#include <linux/atalk.h>
+#include "atalk.h"
static struct ctl_table atalk_table[] = {
{
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 61abb63..86a2d7d 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -56,7 +56,6 @@
#include <linux/syscalls.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
-#include <linux/atalk.h>
#include <linux/gfp.h>
#include <net/bluetooth/bluetooth.h>
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 2296d8b..362041b 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -43,7 +43,6 @@ header-y += agpgart.h
header-y += aio_abi.h
header-y += apm_bios.h
header-y += arcfb.h
-header-y += atalk.h
header-y += atm.h
header-y += atm_eni.h
header-y += atm_he.h
diff --git a/net/Kconfig b/net/Kconfig
index 7284062..082c8bc 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -204,7 +204,6 @@ source "net/8021q/Kconfig"
source "net/decnet/Kconfig"
source "net/llc/Kconfig"
source "net/ipx/Kconfig"
-source "drivers/net/appletalk/Kconfig"
source "net/x25/Kconfig"
source "net/lapb/Kconfig"
source "net/econet/Kconfig"
diff --git a/net/Makefile b/net/Makefile
index a3330eb..16d9947 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -27,7 +27,6 @@ obj-$(CONFIG_NET_KEY) += key/
obj-$(CONFIG_BRIDGE) += bridge/
obj-$(CONFIG_NET_DSA) += dsa/
obj-$(CONFIG_IPX) += ipx/
-obj-$(CONFIG_ATALK) += appletalk/
obj-$(CONFIG_WAN_ROUTER) += wanrouter/
obj-$(CONFIG_X25) += x25/
obj-$(CONFIG_LAPB) += lapb/
diff --git a/net/socket.c b/net/socket.c
index ac2219f..26f7bcf 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -103,7 +103,6 @@
#include <linux/ipv6_route.h>
#include <linux/route.h>
#include <linux/sockios.h>
-#include <linux/atalk.h>
static int sock_no_open(struct inode *irrelevant, struct file *dontcare);
static ssize_t sock_aio_read(struct kiocb *iocb, const struct iovec *iov,
--
1.7.1
^ permalink raw reply related
* [PATCH 14/20] staging/appletalk: remove the BKL
From: Arnd Bergmann @ 2011-01-25 22:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Arnd Bergmann, Arnaldo Carvalho de Melo, netdev
In-Reply-To: <1295993854-4971-1-git-send-email-arnd@arndb.de>
This changes appletalk to use lock_sock instead of
lock_kernel for serialization. I tried to make sure
that we don't hold the socket lock during sleeping
functions, but I did not try to prove whether the
locks are necessary in the first place.
Compile-tested only.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: netdev@vger.kernel.org
---
drivers/staging/appletalk/Kconfig | 1 -
drivers/staging/appletalk/ddp.c | 40 ++++++++++++++----------------------
2 files changed, 16 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/appletalk/Kconfig b/drivers/staging/appletalk/Kconfig
index 0b376a9..f5a8916 100644
--- a/drivers/staging/appletalk/Kconfig
+++ b/drivers/staging/appletalk/Kconfig
@@ -3,7 +3,6 @@
#
config ATALK
tristate "Appletalk protocol support"
- depends on BKL # waiting to be removed from net/appletalk/ddp.c
select LLC
---help---
AppleTalk is the protocol that Apple computers can use to communicate
diff --git a/drivers/staging/appletalk/ddp.c b/drivers/staging/appletalk/ddp.c
index 940dd19..0e2240c 100644
--- a/drivers/staging/appletalk/ddp.c
+++ b/drivers/staging/appletalk/ddp.c
@@ -54,7 +54,6 @@
#include <linux/capability.h>
#include <linux/module.h>
#include <linux/if_arp.h>
-#include <linux/smp_lock.h>
#include <linux/termios.h> /* For TIOCOUTQ/INQ */
#include <linux/compat.h>
#include <linux/slab.h>
@@ -1052,13 +1051,13 @@ static int atalk_release(struct socket *sock)
{
struct sock *sk = sock->sk;
- lock_kernel();
+ lock_sock(sk);
if (sk) {
sock_orphan(sk);
sock->sk = NULL;
atalk_destroy_socket(sk);
}
- unlock_kernel();
+ release_sock(sk);
return 0;
}
@@ -1143,7 +1142,7 @@ static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (addr->sat_family != AF_APPLETALK)
return -EAFNOSUPPORT;
- lock_kernel();
+ lock_sock(sk);
if (addr->sat_addr.s_net == htons(ATADDR_ANYNET)) {
struct atalk_addr *ap = atalk_find_primary();
@@ -1179,7 +1178,7 @@ static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
sock_reset_flag(sk, SOCK_ZAPPED);
err = 0;
out:
- unlock_kernel();
+ release_sock(sk);
return err;
}
@@ -1215,7 +1214,7 @@ static int atalk_connect(struct socket *sock, struct sockaddr *uaddr,
#endif
}
- lock_kernel();
+ lock_sock(sk);
err = -EBUSY;
if (sock_flag(sk, SOCK_ZAPPED))
if (atalk_autobind(sk) < 0)
@@ -1233,7 +1232,7 @@ static int atalk_connect(struct socket *sock, struct sockaddr *uaddr,
sk->sk_state = TCP_ESTABLISHED;
err = 0;
out:
- unlock_kernel();
+ release_sock(sk);
return err;
}
@@ -1249,7 +1248,7 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
struct atalk_sock *at = at_sk(sk);
int err;
- lock_kernel();
+ lock_sock(sk);
err = -ENOBUFS;
if (sock_flag(sk, SOCK_ZAPPED))
if (atalk_autobind(sk) < 0)
@@ -1277,17 +1276,7 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
memcpy(uaddr, &sat, sizeof(sat));
out:
- unlock_kernel();
- return err;
-}
-
-static unsigned int atalk_poll(struct file *file, struct socket *sock,
- poll_table *wait)
-{
- int err;
- lock_kernel();
- err = datagram_poll(file, sock, wait);
- unlock_kernel();
+ release_sock(sk);
return err;
}
@@ -1596,7 +1585,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
if (len > DDP_MAXSZ)
return -EMSGSIZE;
- lock_kernel();
+ lock_sock(sk);
if (usat) {
err = -EBUSY;
if (sock_flag(sk, SOCK_ZAPPED))
@@ -1651,7 +1640,9 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
sk, size, dev->name);
size += dev->hard_header_len;
+ release_sock(sk);
skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err);
+ lock_sock(sk);
if (!skb)
goto out;
@@ -1738,7 +1729,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
SOCK_DEBUG(sk, "SK %p: Done write (%Zd).\n", sk, len);
out:
- unlock_kernel();
+ release_sock(sk);
return err ? : len;
}
@@ -1753,9 +1744,10 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
int err = 0;
struct sk_buff *skb;
- lock_kernel();
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &err);
+ lock_sock(sk);
+
if (!skb)
goto out;
@@ -1787,7 +1779,7 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
skb_free_datagram(sk, skb); /* Free the datagram. */
out:
- unlock_kernel();
+ release_sock(sk);
return err ? : copied;
}
@@ -1887,7 +1879,7 @@ static const struct proto_ops atalk_dgram_ops = {
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
.getname = atalk_getname,
- .poll = atalk_poll,
+ .poll = datagram_poll,
.ioctl = atalk_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = atalk_compat_ioctl,
--
1.7.1
^ permalink raw reply related
* [PATCH 16/20] ipx: remove the BKL
From: Arnd Bergmann @ 2011-01-25 22:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Arnd Bergmann, Arnaldo Carvalho de Melo, netdev
In-Reply-To: <1295993854-4971-1-git-send-email-arnd@arndb.de>
This replaces all instances of lock_kernel in the
IPX code with lock_sock. As far as I can tell, this
is safe to do, because there is no global state
that needs to be locked in IPX, and the code does
not recursively take the lock or sleep indefinitely
while holding it.
Compile-tested only.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: netdev@vger.kernel.org
---
net/ipx/Kconfig | 1 -
net/ipx/af_ipx.c | 52 ++++++++++++++++++++--------------------------------
2 files changed, 20 insertions(+), 33 deletions(-)
diff --git a/net/ipx/Kconfig b/net/ipx/Kconfig
index 02549cb..e9ad006 100644
--- a/net/ipx/Kconfig
+++ b/net/ipx/Kconfig
@@ -3,7 +3,6 @@
#
config IPX
tristate "The IPX protocol"
- depends on BKL # should be fixable
select LLC
---help---
This is support for the Novell networking protocol, IPX, commonly
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index da3d21c..2731b51 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -42,7 +42,6 @@
#include <linux/uio.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
-#include <linux/smp_lock.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/string.h>
@@ -1299,7 +1298,7 @@ static int ipx_setsockopt(struct socket *sock, int level, int optname,
int opt;
int rc = -EINVAL;
- lock_kernel();
+ lock_sock(sk);
if (optlen != sizeof(int))
goto out;
@@ -1314,7 +1313,7 @@ static int ipx_setsockopt(struct socket *sock, int level, int optname,
ipx_sk(sk)->type = opt;
rc = 0;
out:
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1326,7 +1325,7 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname,
int len;
int rc = -ENOPROTOOPT;
- lock_kernel();
+ lock_sock(sk);
if (!(level == SOL_IPX && optname == IPX_TYPE))
goto out;
@@ -1347,7 +1346,7 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname,
rc = 0;
out:
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1396,7 +1395,7 @@ static int ipx_release(struct socket *sock)
if (!sk)
goto out;
- lock_kernel();
+ lock_sock(sk);
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_state_change(sk);
@@ -1404,7 +1403,7 @@ static int ipx_release(struct socket *sock)
sock->sk = NULL;
sk_refcnt_debug_release(sk);
ipx_destroy_socket(sk);
- unlock_kernel();
+ release_sock(sk);
out:
return 0;
}
@@ -1530,11 +1529,12 @@ out:
static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
+ struct sock *sk = sock->sk;
int rc;
- lock_kernel();
+ lock_sock(sk);
rc = __ipx_bind(sock, uaddr, addr_len);
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1551,7 +1551,7 @@ static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
sk->sk_state = TCP_CLOSE;
sock->state = SS_UNCONNECTED;
- lock_kernel();
+ lock_sock(sk);
if (addr_len != sizeof(*addr))
goto out;
addr = (struct sockaddr_ipx *)uaddr;
@@ -1598,7 +1598,7 @@ static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
ipxrtr_put(rt);
rc = 0;
out:
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1614,7 +1614,7 @@ static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
*uaddr_len = sizeof(struct sockaddr_ipx);
- lock_kernel();
+ lock_sock(sk);
if (peer) {
rc = -ENOTCONN;
if (sk->sk_state != TCP_ESTABLISHED)
@@ -1649,19 +1649,7 @@ static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
rc = 0;
out:
- unlock_kernel();
- return rc;
-}
-
-static unsigned int ipx_datagram_poll(struct file *file, struct socket *sock,
- poll_table *wait)
-{
- int rc;
-
- lock_kernel();
- rc = datagram_poll(file, sock, wait);
- unlock_kernel();
-
+ release_sock(sk);
return rc;
}
@@ -1736,7 +1724,7 @@ static int ipx_sendmsg(struct kiocb *iocb, struct socket *sock,
int rc = -EINVAL;
int flags = msg->msg_flags;
- lock_kernel();
+ lock_sock(sk);
/* Socket gets bound below anyway */
/* if (sk->sk_zapped)
return -EIO; */ /* Socket not bound */
@@ -1788,7 +1776,7 @@ static int ipx_sendmsg(struct kiocb *iocb, struct socket *sock,
if (rc >= 0)
rc = len;
out:
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1803,7 +1791,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
struct sk_buff *skb;
int copied, rc;
- lock_kernel();
+ lock_sock(sk);
/* put the autobinding in */
if (!ipxs->port) {
struct sockaddr_ipx uaddr;
@@ -1862,7 +1850,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
out_free:
skb_free_datagram(sk, skb);
out:
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1874,7 +1862,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct sock *sk = sock->sk;
void __user *argp = (void __user *)arg;
- lock_kernel();
+ lock_sock(sk);
switch (cmd) {
case TIOCOUTQ:
amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
@@ -1937,7 +1925,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
rc = -ENOIOCTLCMD;
break;
}
- unlock_kernel();
+ release_sock(sk);
return rc;
}
@@ -1984,7 +1972,7 @@ static const struct proto_ops ipx_dgram_ops = {
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
.getname = ipx_getname,
- .poll = ipx_datagram_poll,
+ .poll = datagram_poll,
.ioctl = ipx_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ipx_compat_ioctl,
--
1.7.1
^ permalink raw reply related
* [RFC 00/20] Proposal for remaining BKL users
From: Arnd Bergmann @ 2011-01-25 22:22 UTC (permalink / raw)
To: linux-kernel
Cc: autofs, linux-cifs, linux-x25, Arnd Bergmann, netdev, dri-devel,
linux-fsdevel
I've gone through all the code in the kernel that
uses the big kernel lock and come up with a solution
that seems at least half-reasonable for each of them.
The decisions are somewhat arbitrary, but here is
what I'd suggest we do:
* Remove in 2.6.39:
i830, autofs3, smbfs
* Move to staging now, kill in 2.6.41 (or later):
appletalk, hpfs
* Work around in an ugly way, but keep alive:
* ufs, ipx, i810, cx25721
* Fix properly:
* usbip, go7007, adfs, x25
Some of the patches are rather tricky and I haven't
really done much proper testing, so I'd much prefer
the maintainers to pick up the patches and do the
necessary testing where possible, or even come up
with a better solution.
Arnd Bergmann (20):
drm/i810: remove the BKL
drm: remove i830 driver
staging/usbip: convert to kthread
staging/cx25721: serialize access to devlist
staging/go7007: remove the BKL
staging: Remove autofs3
staging: remove smbfs
adfs: remove the big kernel lock
hpfs: rename big kernel lock to hpfs_lock
hpfs: replace BKL with a global mutex
hpfs: move to drivers/staging
x25: remove the BKL
appletalk: move to staging
staging/appletalk: remove the BKL
ufs: remove the BKL
ipx: remove the BKL
tracing: don't trace the BKL
rtmutex-tester: remove BKL tests
drivers: remove extraneous includes of smp_lock.h
BKL: That's all, folks
MAINTAINERS | 11 +-
drivers/gpu/drm/Kconfig | 47 +-
drivers/gpu/drm/Makefile | 1 -
drivers/gpu/drm/i810/i810_dma.c | 18 +-
drivers/gpu/drm/i810/i810_drv.c | 6 +-
drivers/gpu/drm/i830/Makefile | 8 -
drivers/gpu/drm/i830/i830_dma.c | 1560 ---------
drivers/gpu/drm/i830/i830_drv.c | 107 -
drivers/gpu/drm/i830/i830_drv.h | 295 --
drivers/gpu/drm/i830/i830_irq.c | 186 --
drivers/net/Makefile | 1 -
drivers/net/appletalk/Makefile | 7 -
drivers/scsi/megaraid/megaraid_sas_fp.c | 1 -
drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 -
drivers/staging/Kconfig | 8 +-
drivers/staging/Makefile | 4 +-
drivers/{net => staging}/appletalk/Kconfig | 1 -
{net => drivers/staging}/appletalk/Makefile | 7 +-
{net => drivers/staging}/appletalk/aarp.c | 2 +-
.../linux => drivers/staging/appletalk}/atalk.h | 0
{net => drivers/staging}/appletalk/atalk_proc.c | 2 +-
drivers/{net => staging}/appletalk/cops.c | 2 +-
drivers/{net => staging}/appletalk/cops.h | 0
drivers/{net => staging}/appletalk/cops_ffdrv.h | 0
drivers/{net => staging}/appletalk/cops_ltdrv.h | 0
{net => drivers/staging}/appletalk/ddp.c | 44 +-
{net => drivers/staging}/appletalk/dev.c | 0
drivers/{net => staging}/appletalk/ipddp.c | 2 +-
drivers/{net => staging}/appletalk/ipddp.h | 0
drivers/{net => staging}/appletalk/ltpc.c | 2 +-
drivers/{net => staging}/appletalk/ltpc.h | 0
.../staging}/appletalk/sysctl_net_atalk.c | 2 +-
drivers/staging/autofs/Kconfig | 22 -
drivers/staging/autofs/Makefile | 7 -
drivers/staging/autofs/TODO | 8 -
drivers/staging/autofs/autofs_i.h | 165 -
drivers/staging/autofs/dirhash.c | 260 --
drivers/staging/autofs/init.c | 52 -
drivers/staging/autofs/inode.c | 288 --
drivers/staging/autofs/root.c | 648 ----
drivers/staging/autofs/symlink.c | 26 -
drivers/staging/autofs/waitq.c | 205 --
drivers/staging/cx25821/Kconfig | 1 -
drivers/staging/cx25821/cx25821-alsa.c | 2 +
drivers/staging/cx25821/cx25821-core.c | 16 +-
drivers/staging/cx25821/cx25821-video.c | 9 +-
drivers/staging/cx25821/cx25821.h | 3 +-
drivers/staging/easycap/easycap.h | 1 -
drivers/staging/easycap/easycap_ioctl.c | 1 -
drivers/staging/go7007/Kconfig | 1 -
drivers/staging/go7007/s2250-loader.c | 3 -
{fs => drivers/staging}/hpfs/Kconfig | 5 +-
{fs => drivers/staging}/hpfs/Makefile | 0
drivers/staging/hpfs/TODO | 5 +
{fs => drivers/staging}/hpfs/alloc.c | 0
{fs => drivers/staging}/hpfs/anode.c | 0
{fs => drivers/staging}/hpfs/buffer.c | 0
{fs => drivers/staging}/hpfs/dentry.c | 0
{fs => drivers/staging}/hpfs/dir.c | 23 +-
{fs => drivers/staging}/hpfs/dnode.c | 0
{fs => drivers/staging}/hpfs/ea.c | 0
{fs => drivers/staging}/hpfs/file.c | 9 +-
{fs => drivers/staging}/hpfs/hpfs.h | 0
{fs => drivers/staging}/hpfs/hpfs_fn.h | 36 +
{fs => drivers/staging}/hpfs/inode.c | 9 +-
{fs => drivers/staging}/hpfs/map.c | 0
{fs => drivers/staging}/hpfs/name.c | 0
{fs => drivers/staging}/hpfs/namei.c | 49 +-
{fs => drivers/staging}/hpfs/super.c | 21 +-
drivers/staging/smbfs/Kconfig | 56 -
drivers/staging/smbfs/Makefile | 18 -
drivers/staging/smbfs/TODO | 8 -
drivers/staging/smbfs/cache.c | 208 --
drivers/staging/smbfs/dir.c | 699 ----
drivers/staging/smbfs/file.c | 456 ---
drivers/staging/smbfs/getopt.c | 64 -
drivers/staging/smbfs/getopt.h | 14 -
drivers/staging/smbfs/inode.c | 854 -----
drivers/staging/smbfs/ioctl.c | 68 -
drivers/staging/smbfs/proc.c | 3502 --------------------
drivers/staging/smbfs/proto.h | 89 -
drivers/staging/smbfs/request.c | 817 -----
drivers/staging/smbfs/request.h | 70 -
drivers/staging/smbfs/smb.h | 118 -
drivers/staging/smbfs/smb_debug.h | 34 -
drivers/staging/smbfs/smb_fs.h | 153 -
drivers/staging/smbfs/smb_fs_i.h | 37 -
drivers/staging/smbfs/smb_fs_sb.h | 100 -
drivers/staging/smbfs/smb_mount.h | 65 -
drivers/staging/smbfs/smbfs.txt | 8 -
drivers/staging/smbfs/smbiod.c | 343 --
drivers/staging/smbfs/smbno.h | 363 --
drivers/staging/smbfs/sock.c | 385 ---
drivers/staging/smbfs/symlink.c | 67 -
drivers/staging/usbip/Kconfig | 2 +-
drivers/staging/usbip/stub.h | 4 +-
drivers/staging/usbip/stub_dev.c | 13 +-
drivers/staging/usbip/stub_rx.c | 13 +-
drivers/staging/usbip/stub_tx.c | 14 +-
drivers/staging/usbip/usbip_common.c | 105 -
drivers/staging/usbip/usbip_common.h | 20 +-
drivers/staging/usbip/usbip_event.c | 31 +-
drivers/staging/usbip/vhci.h | 4 +-
drivers/staging/usbip/vhci_hcd.c | 10 +-
drivers/staging/usbip/vhci_rx.c | 16 +-
drivers/staging/usbip/vhci_sysfs.c | 9 +-
drivers/staging/usbip/vhci_tx.c | 14 +-
drivers/target/target_core_device.c | 1 -
drivers/target/target_core_fabric_lib.c | 1 -
drivers/target/target_core_file.c | 1 -
drivers/target/target_core_hba.c | 1 -
drivers/target/target_core_iblock.c | 1 -
drivers/target/target_core_pscsi.c | 1 -
drivers/target/target_core_rd.c | 1 -
drivers/target/target_core_tpg.c | 1 -
drivers/target/target_core_transport.c | 1 -
drivers/tty/n_hdlc.c | 1 -
drivers/tty/n_r3964.c | 1 -
drivers/tty/pty.c | 1 -
drivers/tty/tty_io.c | 1 -
drivers/tty/tty_ldisc.c | 2 -
drivers/tty/vt/selection.c | 1 -
drivers/tty/vt/vc_screen.c | 1 -
drivers/tty/vt/vt.c | 1 -
drivers/tty/vt/vt_ioctl.c | 1 -
fs/Kconfig | 1 -
fs/Makefile | 1 -
fs/adfs/Kconfig | 1 -
fs/adfs/dir.c | 6 -
fs/adfs/inode.c | 6 -
fs/adfs/super.c | 13 +-
fs/compat_ioctl.c | 1 -
fs/ufs/Kconfig | 1 -
fs/ufs/inode.c | 78 +-
fs/ufs/namei.c | 35 +-
fs/ufs/super.c | 55 +-
fs/ufs/truncate.c | 5 +-
fs/ufs/ufs.h | 6 +-
include/drm/Kbuild | 1 -
include/drm/i830_drm.h | 342 --
include/linux/Kbuild | 1 -
include/linux/hardirq.h | 9 +-
include/linux/smp_lock.h | 65 -
include/trace/events/bkl.h | 61 -
init/Kconfig | 5 -
kernel/rtmutex-tester.c | 39 +-
kernel/sched.c | 7 -
lib/Makefile | 1 -
lib/kernel_lock.c | 143 -
net/Kconfig | 1 -
net/Makefile | 1 -
net/ipx/Kconfig | 1 -
net/ipx/af_ipx.c | 52 +-
net/socket.c | 1 -
net/x25/Kconfig | 1 -
net/x25/af_x25.c | 61 +-
net/x25/x25_out.c | 7 +-
157 files changed, 356 insertions(+), 13722 deletions(-)
delete mode 100644 drivers/gpu/drm/i830/Makefile
delete mode 100644 drivers/gpu/drm/i830/i830_dma.c
delete mode 100644 drivers/gpu/drm/i830/i830_drv.c
delete mode 100644 drivers/gpu/drm/i830/i830_drv.h
delete mode 100644 drivers/gpu/drm/i830/i830_irq.c
delete mode 100644 drivers/net/appletalk/Makefile
rename drivers/{net => staging}/appletalk/Kconfig (98%)
rename {net => drivers/staging}/appletalk/Makefile (56%)
rename {net => drivers/staging}/appletalk/aarp.c (99%)
rename {include/linux => drivers/staging/appletalk}/atalk.h (100%)
rename {net => drivers/staging}/appletalk/atalk_proc.c (99%)
rename drivers/{net => staging}/appletalk/cops.c (99%)
rename drivers/{net => staging}/appletalk/cops.h (100%)
rename drivers/{net => staging}/appletalk/cops_ffdrv.h (100%)
rename drivers/{net => staging}/appletalk/cops_ltdrv.h (100%)
rename {net => drivers/staging}/appletalk/ddp.c (98%)
rename {net => drivers/staging}/appletalk/dev.c (100%)
rename drivers/{net => staging}/appletalk/ipddp.c (99%)
rename drivers/{net => staging}/appletalk/ipddp.h (100%)
rename drivers/{net => staging}/appletalk/ltpc.c (99%)
rename drivers/{net => staging}/appletalk/ltpc.h (100%)
rename {net => drivers/staging}/appletalk/sysctl_net_atalk.c (98%)
delete mode 100644 drivers/staging/autofs/Kconfig
delete mode 100644 drivers/staging/autofs/Makefile
delete mode 100644 drivers/staging/autofs/TODO
delete mode 100644 drivers/staging/autofs/autofs_i.h
delete mode 100644 drivers/staging/autofs/dirhash.c
delete mode 100644 drivers/staging/autofs/init.c
delete mode 100644 drivers/staging/autofs/inode.c
delete mode 100644 drivers/staging/autofs/root.c
delete mode 100644 drivers/staging/autofs/symlink.c
delete mode 100644 drivers/staging/autofs/waitq.c
rename {fs => drivers/staging}/hpfs/Kconfig (80%)
rename {fs => drivers/staging}/hpfs/Makefile (100%)
create mode 100644 drivers/staging/hpfs/TODO
rename {fs => drivers/staging}/hpfs/alloc.c (100%)
rename {fs => drivers/staging}/hpfs/anode.c (100%)
rename {fs => drivers/staging}/hpfs/buffer.c (100%)
rename {fs => drivers/staging}/hpfs/dentry.c (100%)
rename {fs => drivers/staging}/hpfs/dir.c (97%)
rename {fs => drivers/staging}/hpfs/dnode.c (100%)
rename {fs => drivers/staging}/hpfs/ea.c (100%)
rename {fs => drivers/staging}/hpfs/file.c (97%)
rename {fs => drivers/staging}/hpfs/hpfs.h (100%)
rename {fs => drivers/staging}/hpfs/hpfs_fn.h (91%)
rename {fs => drivers/staging}/hpfs/inode.c (98%)
rename {fs => drivers/staging}/hpfs/map.c (100%)
rename {fs => drivers/staging}/hpfs/name.c (100%)
rename {fs => drivers/staging}/hpfs/namei.c (96%)
rename {fs => drivers/staging}/hpfs/super.c (98%)
delete mode 100644 drivers/staging/smbfs/Kconfig
delete mode 100644 drivers/staging/smbfs/Makefile
delete mode 100644 drivers/staging/smbfs/TODO
delete mode 100644 drivers/staging/smbfs/cache.c
delete mode 100644 drivers/staging/smbfs/dir.c
delete mode 100644 drivers/staging/smbfs/file.c
delete mode 100644 drivers/staging/smbfs/getopt.c
delete mode 100644 drivers/staging/smbfs/getopt.h
delete mode 100644 drivers/staging/smbfs/inode.c
delete mode 100644 drivers/staging/smbfs/ioctl.c
delete mode 100644 drivers/staging/smbfs/proc.c
delete mode 100644 drivers/staging/smbfs/proto.h
delete mode 100644 drivers/staging/smbfs/request.c
delete mode 100644 drivers/staging/smbfs/request.h
delete mode 100644 drivers/staging/smbfs/smb.h
delete mode 100644 drivers/staging/smbfs/smb_debug.h
delete mode 100644 drivers/staging/smbfs/smb_fs.h
delete mode 100644 drivers/staging/smbfs/smb_fs_i.h
delete mode 100644 drivers/staging/smbfs/smb_fs_sb.h
delete mode 100644 drivers/staging/smbfs/smb_mount.h
delete mode 100644 drivers/staging/smbfs/smbfs.txt
delete mode 100644 drivers/staging/smbfs/smbiod.c
delete mode 100644 drivers/staging/smbfs/smbno.h
delete mode 100644 drivers/staging/smbfs/sock.c
delete mode 100644 drivers/staging/smbfs/symlink.c
delete mode 100644 include/drm/i830_drm.h
delete mode 100644 include/linux/smp_lock.h
delete mode 100644 include/trace/events/bkl.h
delete mode 100644 lib/kernel_lock.c
[re-sent to mailing lists, due to overly long
Cc list getting rejected by vger]
Cc: autofs@linux.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-cifs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-x25@vger.kernel.org
Cc: netdev@vger.kernel.org
^ permalink raw reply
* Re: [PATCH 14/20] staging/appletalk: remove the BKL
From: David Miller @ 2011-01-25 22:29 UTC (permalink / raw)
To: arnd; +Cc: linux-kernel, acme, netdev
In-Reply-To: <1295993854-4971-15-git-send-email-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 25 Jan 2011 23:17:28 +0100
> This changes appletalk to use lock_sock instead of
> lock_kernel for serialization. I tried to make sure
> that we don't hold the socket lock during sleeping
> functions, but I did not try to prove whether the
> locks are necessary in the first place.
>
> Compile-tested only.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
If you're moving appletalk to staging because "nobody is motivated
enough to remove the BKL" and then you actually do the work to remove
the BKL, I really don't see any point in doing the whole staging
thing.
We always keep an eye on every protocol that sits under the top-level
net/. Every socket API change propagates, as does every other
networking API change that matters for those protocols.
You can move appletalk down to staging if that stops happening, which
it won't.
^ permalink raw reply
* Re: [PATCH] TCP: fix a bug that triggers large number of TCP RST by mistake
From: Jerry Chu @ 2011-01-25 23:48 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110125.134816.48501871.davem@davemloft.net>
On Tue, Jan 25, 2011 at 1:48 PM, David Miller <davem@davemloft.net> wrote:
> From: "H.K. Jerry Chu" <hkchu@google.com>
> Date: Sat, 22 Jan 2011 11:06:17 -0800
>
>> From: Jerry Chu <hkchu@google.com>
>>
>> This patch fixes a bug that causes TCP RST packets to be generated
>> on otherwise correctly behaved applications, e.g., no unread data
>> on close,..., etc. To trigger the bug, at least two conditions must
>> be met:
>>
>> 1. The FIN flag is set on the last data packet, i.e., it's not on a
>> separate, FIN only packet.
>> 2. The size of the last data chunk on the receive side matches
>> exactly with the size of buffer posted by the receiver, and the
>> receiver closes the socket without any further read attempt.
>>
>> This bug was first noticed on our netperf based testbed for our IW10
>> proposal to IETF where a large number of RST packets were observed.
>> netperf's read side code meets the condition 2 above 100%.
>>
>> Before the fix, tcp_data_queue() will queue the last skb that meets
>> condition 1 to sk_receive_queue even though it has fully copied out
>> (skb_copy_datagram_iovec()) the data. Then if condition 2 is also met,
>> tcp_recvmsg() often returns all the copied out data successfully
>> without actually consuming the skb, due to a check
>> "if ((chunk = len - tp->ucopy.len) != 0) {"
>> and
>> "len -= chunk;"
>> after tcp_prequeue_process() that causes "len" to become 0 and an
>> early exit from the big while loop.
>>
>> I don't see any reason not to free the skb whose data have been fully
>> consumed in tcp_data_queue(), regardless of the FIN flag. We won't
>> get there if MSG_PEEK is on. Am I missing some arcane cases related
>> to urgent data?
>>
>> Signed-off-by: H.K. Jerry Chu <hkchu@google.com>
>
> This bug goes as far back as January, 2000 right after the softnet
> mega-merge happened via the netdev CVS tree (netdev-vger-cvs GIT
> commit 214d457e)
Yes I also tried to trace how long the bug has been there and it seems
to go back to the prehistoric era :). Guess only TCP types got alarmed
by spurious RSTs.
Jerry
>
> Good work, applied, thanks!
>
^ permalink raw reply
* Re: [GIT PULL nf-next-2.6] IPVS changes for 2.6.38-rc3
From: Simon Horman @ 2011-01-25 23:57 UTC (permalink / raw)
To: Patrick McHardy
Cc: lvs-devel, netfilter-devel, netdev, Changli Gao, Julian Anastasov
In-Reply-To: <4D3ED7BF.1080202@trash.net>
On Tue, Jan 25, 2011 at 03:01:35PM +0100, Patrick McHardy wrote:
> On 25.01.2011 14:17, Simon Horman wrote:
> > Hi Patrick,
> >
> > please consider pulling
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick
> >
> > Which includes the following changes, both of which I believe 2.6.38 material.
> >
> > Changli Gao (1):
> > netfilter: ipvs: fix compiler warnings
> >
> > Hans Schillstrom (1):
> > IPVS netns BUG, register sysctl for root ns
>
> That tree is based on nf-next-2.6, so I can't pull this into my nf-2.6
> tree.
Hi Patrick,
Sorry about this.
As it turns out I was mistaken in assuming that the IPVS netns changes
had been merged into nf-2.6. They haven't, they only exist in net-next-2.6.
All of the recent patches that I have passed on to you relate to the IPVS
netns changes so nf-next-2.6 is the right place for these fixes. So could
you please pull the above tree into nf-next-2.6? I do not believe there are
any nf-2.6 changes at this time.
Thanks
^ permalink raw reply
* [patch] kconfig: unify GENERIC_ISA_DMA and ISA_DMA_API
From: David Rientjes @ 2011-01-26 1:06 UTC (permalink / raw)
To: Andrew Morton
Cc: Russell King, Ralf Baechle, Kyle McMartin, James Bottomley,
Benjamin Herrenschmidt, Thomas Gleixner, H. Peter Anvin,
Ingo Molnar, David S. Miller, Greg Kroah-Hartman, Randy Dunlap,
x86, linux-arch, netdev, linux-scsi, linux-kernel
CONFIG_GENERIC_ISA_DMA and CONFIG_ISA_DMA_API usually have dependencies
on one another depending on the architecture and generic kernel code uses
either to determine whether an ISA-style DMA API is configured.
It doesn't make sense to enable one option without enabling the other and
leads to inconsistencies in generic code, for example, where drivers
depending on CONFIG_ISA_DMA_API actually require CONFIG_GENERIC_ISA_DMA
as well for dma_lock or request_dma(). This could be resolved by
requiring both options whenever one is enabled, but then only one option
is actually required.
This patch unifies both options and consolidates them into a single
option: CONFIG_GENERIC_ISA_DMA. It is also a prerequisite for a 1% text
savings for a future x86 patch that allows these options to be disabled
on that architecture when CONFIG_ZONE_DMA also becomes configurable.
Signed-off-by: David Rientjes <rientjes@google.com>
---
Documentation/DMA-ISA-LPC.txt | 10 +++++-----
arch/alpha/Kconfig | 4 ----
arch/arm/Kconfig | 10 +++-------
arch/arm/include/asm/dma.h | 4 ++--
arch/arm/kernel/Makefile | 2 +-
arch/m68knommu/Kconfig | 2 +-
arch/mips/Kconfig | 4 ----
arch/parisc/Kconfig | 2 +-
arch/powerpc/Kconfig | 7 +------
arch/x86/Kconfig | 4 ----
drivers/block/Kconfig | 2 +-
drivers/char/Kconfig | 2 +-
drivers/mmc/host/Kconfig | 2 +-
drivers/net/Kconfig | 10 +++++-----
drivers/net/appletalk/Kconfig | 2 +-
drivers/net/cs89x0.c | 2 +-
drivers/net/hamradio/Kconfig | 4 ++--
drivers/net/irda/Kconfig | 10 +++++-----
drivers/net/tokenring/Kconfig | 2 +-
drivers/net/wan/Kconfig | 6 +++---
drivers/net/wireless/Kconfig | 2 +-
drivers/parport/parport_pc.c | 2 +-
drivers/scsi/Kconfig | 12 ++++++------
include/sound/core.h | 2 +-
net/irda/irda_device.c | 2 +-
sound/core/Makefile | 8 ++++----
sound/isa/Kconfig | 2 +-
sound/oss/Kconfig | 2 +-
sound/pci/Kconfig | 4 ++--
29 files changed, 53 insertions(+), 74 deletions(-)
diff --git a/Documentation/DMA-ISA-LPC.txt b/Documentation/DMA-ISA-LPC.txt
--- a/Documentation/DMA-ISA-LPC.txt
+++ b/Documentation/DMA-ISA-LPC.txt
@@ -20,8 +20,8 @@ physical addresses (see Documentation/DMA-API.txt for details).
The second contains the routines specific to ISA DMA transfers. Since
this is not present on all platforms make sure you construct your
-Kconfig to be dependent on ISA_DMA_API (not ISA) so that nobody tries
-to build your driver on unsupported platforms.
+Kconfig to be dependent on GENERIC_ISA_DMA (not only ISA) so that
+nobody tries to build your driver on unsupported platforms.
Part II - Buffer allocation
---------------------------
@@ -53,9 +53,9 @@ Part III - Address translation
To translate the virtual address to a physical use the normal DMA
API. Do _not_ use isa_virt_to_phys() even though it does the same
thing. The reason for this is that the function isa_virt_to_phys()
-will require a Kconfig dependency to ISA, not just ISA_DMA_API which
-is really all you need. Remember that even though the DMA controller
-has its origins in ISA it is used elsewhere.
+will require a Kconfig dependency to ISA, not just GENERIC_ISA_DMA
+which is really all you need. Remember that even though the DMA
+controller has its origins in ISA it is used elsewhere.
Note: x86_64 had a broken DMA API when it came to ISA but has since
been fixed. If your arch has problems then fix the DMA API instead of
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -309,10 +309,6 @@ config ISA
(MCA) or VESA. ISA is an older system, now being displaced by PCI;
newer boards don't support it. If you have ISA, say Y, otherwise N.
-config ISA_DMA_API
- bool
- default y
-
config PCI
bool
depends on !ALPHA_JENSEN
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -388,7 +388,7 @@ config ARCH_NETX
config ARCH_H720X
bool "Hynix HMS720x-based"
select CPU_ARM720T
- select ISA_DMA_API
+ select GENERIC_ISA_DMA
select ARCH_USES_GETTIMEOFFSET
help
This enables support for systems based on the Hynix HMS720x
@@ -644,7 +644,7 @@ config ARCH_RPC
select TIMER_ACORN
select ARCH_MAY_HAVE_PC_FDC
select HAVE_PATA_PLATFORM
- select ISA_DMA_API
+ select GENERIC_ISA_DMA
select NO_IOPORT
select ARCH_SPARSEMEM_ENABLE
select ARCH_USES_GETTIMEOFFSET
@@ -1198,11 +1198,7 @@ config ISA
# Select ISA DMA controller support
config ISA_DMA
bool
- select ISA_DMA_API
-
-# Select ISA DMA interface
-config ISA_DMA_API
- bool
+ select GENERIC_ISA_DMA
config PCI
bool "PCI support" if MIGHT_HAVE_PCI
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -10,7 +10,7 @@
#define MAX_DMA_ADDRESS 0xffffffff
#endif
-#ifdef CONFIG_ISA_DMA_API
+#ifdef CONFIG_GENERIC_ISA_DMA
/*
* This is used to support drivers written for the x86 ISA DMA API.
* It should not be re-used except for that purpose.
@@ -138,7 +138,7 @@ extern int get_dma_residue(unsigned int chan);
#define NO_DMA 255
#endif
-#endif /* CONFIG_ISA_DMA_API */
+#endif /* CONFIG_GENERIC_ISA_DMA */
#ifdef CONFIG_PCI
extern int isa_dma_bridge_buggy;
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o
obj-$(CONFIG_LEDS) += leds.o
obj-$(CONFIG_OC_ETM) += etm.o
-obj-$(CONFIG_ISA_DMA_API) += dma.o
+obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
obj-$(CONFIG_ARCH_ACORN) += ecard.o
obj-$(CONFIG_FIQ) += fiq.o
obj-$(CONFIG_MODULES) += armksyms.o module.o
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -771,7 +771,7 @@ source "mm/Kconfig"
endmenu
-config ISA_DMA_API
+config GENERIC_ISA_DMA
bool
depends on !M5272
default y
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -907,15 +907,11 @@ config NO_IOPORT
config GENERIC_ISA_DMA
bool
select ZONE_DMA if GENERIC_ISA_DMA_SUPPORT_BROKEN=n
- select ISA_DMA_API
config GENERIC_ISA_DMA_SUPPORT_BROKEN
bool
select GENERIC_ISA_DMA
-config ISA_DMA_API
- bool
-
config GENERIC_GPIO
bool
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -85,7 +85,7 @@ config NEED_DMA_MAP_STATE
config NEED_SG_DMA_LENGTH
def_bool y
-config ISA_DMA_API
+config GENERIC_ISA_DMA
bool
config ARCH_MAY_HAVE_PC_FDC
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -601,10 +601,6 @@ config SECCOMP
endmenu
-config ISA_DMA_API
- bool
- default !PPC_ISERIES || PCI
-
menu "Bus options"
config ISA
@@ -630,8 +626,7 @@ config NEED_SG_DMA_LENGTH
config GENERIC_ISA_DMA
bool
- depends on ISA_DMA_API
- default y
+ default !PPC_ISERIES || PCI
config PPC_INDIRECT_PCI
bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2000,10 +2000,6 @@ source "drivers/pci/pcie/Kconfig"
source "drivers/pci/Kconfig"
-# x86_64 have no ISA slots, but do have ISA-style DMA.
-config ISA_DMA_API
- def_bool y
-
if X86_32
config ISA
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -65,7 +65,7 @@ config AMIGA_Z2RAM
config BLK_DEV_XD
tristate "XT hard disk support"
- depends on ISA && ISA_DMA_API
+ depends on ISA && GENERIC_ISA_DMA
select CHECK_SIGNATURE
help
Very old 8 bit hard disk controllers used in the IBM XT computer
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -236,7 +236,7 @@ config ISI
config SYNCLINK
tristate "Microgate SyncLink card support"
- depends on SERIAL_NONSTANDARD && PCI && ISA_DMA_API
+ depends on SERIAL_NONSTANDARD && PCI && GENERIC_ISA_DMA
help
Provides support for the SyncLink ISA and PCI multiprotocol serial
adapters. These adapters support asynchronous and HDLC bit
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -235,7 +235,7 @@ config MMC_OMAP_HS
config MMC_WBSD
tristate "Winbond W83L51xD SD/MMC Card Interface support"
- depends on ISA_DMA_API
+ depends on GENERIC_ISA_DMA
help
This selects the Winbond(R) W83L51xD Secure digital and
Multimedia card Interface.
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -655,7 +655,7 @@ config EL2
config ELPLUS
tristate "3c505 \"EtherLink Plus\" support"
- depends on NET_VENDOR_3COM && ISA && ISA_DMA_API
+ depends on NET_VENDOR_3COM && ISA && GENERIC_ISA_DMA
---help---
Information about this network (Ethernet) card can be found in
<file:Documentation/networking/3c505.txt>. If you have a card of
@@ -693,7 +693,7 @@ config EL3
config 3C515
tristate "3c515 ISA \"Fast EtherLink\""
- depends on NET_VENDOR_3COM && (ISA || EISA) && ISA_DMA_API
+ depends on NET_VENDOR_3COM && (ISA || EISA) && GENERIC_ISA_DMA
help
If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet
network card, say Y and read the Ethernet-HOWTO, available from
@@ -766,7 +766,7 @@ config TYPHOON
config LANCE
tristate "AMD LANCE and PCnet (AT1500 and NE2100) support"
- depends on ISA && ISA_DMA_API
+ depends on ISA && GENERIC_ISA_DMA
help
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
@@ -1113,7 +1113,7 @@ config NI52
config NI65
tristate "NI6510 support"
- depends on NET_VENDOR_RACAL && ISA && ISA_DMA_API
+ depends on NET_VENDOR_RACAL && ISA && GENERIC_ISA_DMA
help
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
@@ -1306,7 +1306,7 @@ config NE2000
config ZNET
tristate "Zenith Z-Note support (EXPERIMENTAL)"
- depends on NET_ISA && EXPERIMENTAL && ISA_DMA_API
+ depends on NET_ISA && EXPERIMENTAL && GENERIC_ISA_DMA
help
The Zenith Z-Note notebook computer has a built-in network
(Ethernet) card, and this is the Linux driver for it. Note that the
diff --git a/drivers/net/appletalk/Kconfig b/drivers/net/appletalk/Kconfig
--- a/drivers/net/appletalk/Kconfig
+++ b/drivers/net/appletalk/Kconfig
@@ -41,7 +41,7 @@ config DEV_APPLETALK
config LTPC
tristate "Apple/Farallon LocalTalk PC support"
- depends on DEV_APPLETALK && (ISA || EISA) && ISA_DMA_API
+ depends on DEV_APPLETALK && (ISA || EISA) && GENERIC_ISA_DMA
help
This allows you to use the AppleTalk PC card to connect to LocalTalk
networks. The card is also known as the Farallon PhoneNet PC card.
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -107,7 +107,7 @@
* Note that even if DMA is turned off we still support the 'dma' and 'use_dma'
* module options so we don't break any startup scripts.
*/
-#ifndef CONFIG_ISA_DMA_API
+#ifndef CONFIG_GENERIC_ISA_DMA
#define ALLOW_DMA 0
#else
#define ALLOW_DMA 1
diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
--- a/drivers/net/hamradio/Kconfig
+++ b/drivers/net/hamradio/Kconfig
@@ -46,7 +46,7 @@ config BPQETHER
config DMASCC
tristate "High-speed (DMA) SCC driver for AX.25"
- depends on ISA && AX25 && BROKEN_ON_SMP && ISA_DMA_API
+ depends on ISA && AX25 && BROKEN_ON_SMP && GENERIC_ISA_DMA
---help---
This is a driver for high-speed SCC boards, i.e. those supporting
DMA on one port. You usually use those boards to connect your
@@ -79,7 +79,7 @@ config DMASCC
config SCC
tristate "Z8530 SCC driver"
- depends on ISA && AX25 && ISA_DMA_API
+ depends on ISA && AX25 && GENERIC_ISA_DMA
---help---
These cards are used to connect your Linux box to an amateur radio
in order to communicate with other computers. If you want to use
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -281,7 +281,7 @@ config SIGMATEL_FIR
config NSC_FIR
tristate "NSC PC87108/PC87338"
- depends on IRDA && ISA_DMA_API
+ depends on IRDA && GENERIC_ISA_DMA
help
Say Y here if you want to build support for the NSC PC87108 and
PC87338 IrDA chipsets. This driver supports SIR,
@@ -292,7 +292,7 @@ config NSC_FIR
config WINBOND_FIR
tristate "Winbond W83977AF (IR)"
- depends on IRDA && ISA_DMA_API
+ depends on IRDA && GENERIC_ISA_DMA
help
Say Y here if you want to build IrDA support for the Winbond
W83977AF super-io chipset. This driver should be used for the IrDA
@@ -318,7 +318,7 @@ config AU1000_FIR
config SMC_IRCC_FIR
tristate "SMSC IrCC (EXPERIMENTAL)"
- depends on EXPERIMENTAL && IRDA && ISA_DMA_API
+ depends on EXPERIMENTAL && IRDA && GENERIC_ISA_DMA
help
Say Y here if you want to build support for the SMC Infrared
Communications Controller. It is used in a wide variety of
@@ -328,7 +328,7 @@ config SMC_IRCC_FIR
config ALI_FIR
tristate "ALi M5123 FIR (EXPERIMENTAL)"
- depends on EXPERIMENTAL && IRDA && ISA_DMA_API
+ depends on EXPERIMENTAL && IRDA && GENERIC_ISA_DMA
help
Say Y here if you want to build support for the ALi M5123 FIR
Controller. The ALi M5123 FIR Controller is embedded in ALi M1543C,
@@ -356,7 +356,7 @@ config SA1100_FIR
config VIA_FIR
tristate "VIA VT8231/VT1211 SIR/MIR/FIR"
- depends on IRDA && ISA_DMA_API
+ depends on IRDA && GENERIC_ISA_DMA
help
Say Y here if you want to build support for the VIA VT8231
and VIA VT1211 IrDA controllers, found on the motherboards using
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -84,7 +84,7 @@ config 3C359
config TMS380TR
tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
- depends on PCI || ISA && ISA_DMA_API || MCA
+ depends on PCI || ISA && GENERIC_ISA_DMA || MCA
select FW_LOADER
---help---
This driver provides generic support for token ring adapters
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -25,7 +25,7 @@ if WAN
# There is no way to detect a comtrol sv11 - force it modular for now.
config HOSTESS_SV11
tristate "Comtrol Hostess SV-11 support"
- depends on ISA && m && ISA_DMA_API && INET && HDLC
+ depends on ISA && m && GENERIC_ISA_DMA && INET && HDLC
help
Driver for Comtrol Hostess SV-11 network card which
operates on low speed synchronous serial links at up to
@@ -37,7 +37,7 @@ config HOSTESS_SV11
# The COSA/SRP driver has not been tested as non-modular yet.
config COSA
tristate "COSA/SRP sync serial boards support"
- depends on ISA && m && ISA_DMA_API && HDLC
+ depends on ISA && m && GENERIC_ISA_DMA && HDLC
---help---
Driver for COSA and SRP synchronous serial boards.
@@ -87,7 +87,7 @@ config LANMEDIA
# There is no way to detect a Sealevel board. Force it modular
config SEALEVEL_4021
tristate "Sealevel Systems 4021 support"
- depends on ISA && m && ISA_DMA_API && INET && HDLC
+ depends on ISA && m && GENERIC_ISA_DMA && INET && HDLC
help
This is a driver for the Sealevel Systems ACB 56 serial I/O adapter.
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -53,7 +53,7 @@ config LIBERTAS_THINFIRM_USB
config AIRO
tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards"
- depends on ISA_DMA_API && (PCI || BROKEN)
+ depends on GENERIC_ISA_DMA && (PCI || BROKEN)
select WIRELESS_EXT
select CRYPTO
select WEXT_SPY
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -68,7 +68,7 @@
#define PARPORT_PC_MAX_PORTS PARPORT_MAX
-#ifdef CONFIG_ISA_DMA_API
+#ifdef CONFIG_GENERIC_ISA_DMA
#define HAS_DMA
#endif
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -437,7 +437,7 @@ config SCSI_3W_SAS
config SCSI_7000FASST
tristate "7000FASST SCSI support"
- depends on ISA && SCSI && ISA_DMA_API
+ depends on ISA && SCSI && GENERIC_ISA_DMA
select CHECK_SIGNATURE
help
This driver supports the Western Digital 7000 SCSI host adapter
@@ -475,7 +475,7 @@ config SCSI_AHA152X
config SCSI_AHA1542
tristate "Adaptec AHA1542 support"
- depends on ISA && SCSI && ISA_DMA_API
+ depends on ISA && SCSI && GENERIC_ISA_DMA
---help---
This is support for a SCSI host adapter. It is explained in section
3.4 of the SCSI-HOWTO, available from
@@ -635,7 +635,7 @@ config SCSI_HPTIOP
config SCSI_BUSLOGIC
tristate "BusLogic SCSI support"
- depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API && VIRT_TO_BUS
+ depends on (PCI || ISA || MCA) && SCSI && GENERIC_ISA_DMA && VIRT_TO_BUS
---help---
This is support for BusLogic MultiMaster and FlashPoint SCSI Host
Adapters. Consult the SCSI-HOWTO, available from
@@ -722,7 +722,7 @@ config SCSI_DTC3280
config SCSI_EATA
tristate "EATA ISA/EISA/PCI (DPT and generic EATA/DMA-compliant boards) support"
- depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API
+ depends on (ISA || EISA || PCI) && SCSI && GENERIC_ISA_DMA
---help---
This driver supports all EATA/DMA-compliant SCSI host adapters. DPT
ISA and all EISA I/O addresses are probed looking for the "EATA"
@@ -817,7 +817,7 @@ config SCSI_FD_MCS
config SCSI_GDTH
tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
- depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API
+ depends on (ISA || EISA || PCI) && SCSI && GENERIC_ISA_DMA
---help---
Formerly called GDT SCSI Disk Array Controller Support.
@@ -1526,7 +1526,7 @@ config SCSI_T128
config SCSI_U14_34F
tristate "UltraStor 14F/34F support"
- depends on ISA && SCSI && ISA_DMA_API
+ depends on ISA && SCSI && GENERIC_ISA_DMA
---help---
This is support for the UltraStor 14F and 34F SCSI-2 host adapters.
The source at <file:drivers/scsi/u14-34f.c> contains some
diff --git a/include/sound/core.h b/include/sound/core.h
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -311,7 +311,7 @@ int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd);
/* isadma.c */
-#ifdef CONFIG_ISA_DMA_API
+#ifdef CONFIG_GENERIC_ISA_DMA
#define DMA_MODE_NO_ENABLE 0x0100
void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode);
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -298,7 +298,7 @@ struct net_device *alloc_irdadev(int sizeof_priv)
}
EXPORT_SYMBOL(alloc_irdadev);
-#ifdef CONFIG_ISA_DMA_API
+#ifdef CONFIG_GENERIC_ISA_DMA
/*
* Function setup_dma (idev, buffer, count, mode)
*
diff --git a/sound/core/Makefile b/sound/core/Makefile
--- a/sound/core/Makefile
+++ b/sound/core/Makefile
@@ -4,10 +4,10 @@
#
snd-y := sound.o init.o memory.o info.o control.o misc.o device.o
-snd-$(CONFIG_ISA_DMA_API) += isadma.o
-snd-$(CONFIG_SND_OSSEMUL) += sound_oss.o info_oss.o
-snd-$(CONFIG_SND_VMASTER) += vmaster.o
-snd-$(CONFIG_SND_JACK) += jack.o
+snd-$(CONFIG_GENERIC_ISA_DMA) += isadma.o
+snd-$(CONFIG_SND_OSSEMUL) += sound_oss.o info_oss.o
+snd-$(CONFIG_SND_VMASTER) += vmaster.o
+snd-$(CONFIG_SND_JACK) += jack.o
snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
pcm_memory.o
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -19,7 +19,7 @@ config SND_SB16_DSP
menuconfig SND_ISA
bool "ISA sound devices"
- depends on ISA && ISA_DMA_API
+ depends on ISA && GENERIC_ISA_DMA
default y
help
Support for sound devices connected via the ISA bus.
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -253,7 +253,7 @@ config MSND_FIFOSIZE
menuconfig SOUND_OSS
tristate "OSS sound modules"
- depends on ISA_DMA_API && VIRT_TO_BUS
+ depends on GENERIC_ISA_DMA && VIRT_TO_BUS
help
OSS is the Open Sound System suite of sound card drivers. They make
sound programming easier since they provide a common API. Say Y or
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -33,7 +33,7 @@ config SND_ALS300
config SND_ALS4000
tristate "Avance Logic ALS4000"
- depends on ISA_DMA_API
+ depends on GENERIC_ISA_DMA
select SND_OPL3_LIB
select SND_MPU401_UART
select SND_PCM
@@ -266,7 +266,7 @@ config SND_CS46XX_NEW_DSP
config SND_CS5530
tristate "CS5530 Audio"
- depends on ISA_DMA_API
+ depends on GENERIC_ISA_DMA
select SND_SB16_DSP
help
Say Y here to include support for audio on Cyrix/NatSemi CS5530 chips.
^ permalink raw reply
* [PATCH net-next 01/11] tg3: Revise 5719 internal FIFO overflow solution
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
Commit cf79003d598b1f82a4caa0564107283b4f560e14, entitled
"tg3: Fix 5719 internal FIFO overflow problem", proposed a way to solve
an internal FIFO overflow problem. We have since discovered a slightly
better way to solve the problem. This patch changes the code so that
the problem is contained closer to the problem source.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 46 ++++++++--------------------------------------
drivers/net/tg3.h | 4 ++++
2 files changed, 12 insertions(+), 38 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e3d80c9..07d4e61 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8227,8 +8227,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
(tp->tg3_flags3 & TG3_FLG3_5717_PLUS)) {
val = tr32(TG3_RDMA_RSRVCTRL_REG);
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
- val &= ~TG3_RDMA_RSRVCTRL_TXMRGN_MASK;
- val |= TG3_RDMA_RSRVCTRL_TXMRGN_320B;
+ val &= ~(TG3_RDMA_RSRVCTRL_TXMRGN_MASK |
+ TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK |
+ TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK);
+ val |= TG3_RDMA_RSRVCTRL_TXMRGN_320B |
+ TG3_RDMA_RSRVCTRL_FIFO_LWM_1_5K |
+ TG3_RDMA_RSRVCTRL_FIFO_HWM_1_5K;
}
tw32(TG3_RDMA_RSRVCTRL_REG,
val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
@@ -13394,42 +13398,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
tp->pcie_readrq = 4096;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
- u16 word;
-
- pci_read_config_word(tp->pdev,
- tp->pcie_cap + PCI_EXP_LNKSTA,
- &word);
- switch (word & PCI_EXP_LNKSTA_CLS) {
- case PCI_EXP_LNKSTA_CLS_2_5GB:
- word &= PCI_EXP_LNKSTA_NLW;
- word >>= PCI_EXP_LNKSTA_NLW_SHIFT;
- switch (word) {
- case 2:
- tp->pcie_readrq = 2048;
- break;
- case 4:
- tp->pcie_readrq = 1024;
- break;
- }
- break;
-
- case PCI_EXP_LNKSTA_CLS_5_0GB:
- word &= PCI_EXP_LNKSTA_NLW;
- word >>= PCI_EXP_LNKSTA_NLW_SHIFT;
- switch (word) {
- case 1:
- tp->pcie_readrq = 2048;
- break;
- case 2:
- tp->pcie_readrq = 1024;
- break;
- case 4:
- tp->pcie_readrq = 512;
- break;
- }
- }
- }
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
+ tp->pcie_readrq = 2048;
pcie_set_readrq(tp->pdev, tp->pcie_readrq);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index d62c8d9..0a0987a 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1333,6 +1333,10 @@
#define TG3_RDMA_RSRVCTRL_REG 0x00004900
#define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
+#define TG3_RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000c00
+#define TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000ff0
+#define TG3_RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000c0000
+#define TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000ff000
#define TG3_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000
#define TG3_RDMA_RSRVCTRL_TXMRGN_MASK 0xffe00000
/* 0x4904 --> 0x4910 unused */
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 04/11] tg3: Disable multivec mode for 1 MSIX vector
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
For single vector MSI-X allocations, we do not want to enable
multivector modes. This patch makes the necessary corrections.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 07da2b5..b1274bc 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8322,7 +8322,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
udelay(100);
- if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX) {
+ if ((tp->tg3_flags2 & TG3_FLG2_USING_MSIX) &&
+ tp->irq_cnt > 1) {
val = tr32(MSGINT_MODE);
val |= MSGINT_MODE_MULTIVEC_EN | MSGINT_MODE_ENABLE;
tw32(MSGINT_MODE, val);
@@ -9062,7 +9063,8 @@ static void tg3_ints_init(struct tg3 *tp)
if (tp->tg3_flags2 & TG3_FLG2_USING_MSI_OR_MSIX) {
u32 msi_mode = tr32(MSGINT_MODE);
- if (tp->tg3_flags2 & TG3_FLG2_USING_MSIX)
+ if ((tp->tg3_flags2 & TG3_FLG2_USING_MSIX) &&
+ tp->irq_cnt > 1)
msi_mode |= MSGINT_MODE_MULTIVEC_EN;
tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE);
}
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 0/11] tg3: 5719, VLAN, and EEE bugfixes
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
This patchset implements bugfixes for the 5719, the VLAN code and
enhances EEE support.
^ permalink raw reply
* [PATCH net-next 06/11] tg3: Fix loopback tests
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
The half-duplex bit in the MAC MODE register will be set during the
loopback test if the external link is in half-duplex mode. This will
cause the loopback test to fail on newer devices. This patch turns the
half-duplex bit off for the test.
Also, newer devices fail the internal phy loopback test because the phy
link takes a little while to come up. This patch adds code to wait for
the link before proceeding with the test.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index b957b60..988861a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10845,8 +10845,9 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
return 0;
- mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) |
- MAC_MODE_PORT_INT_LPBACK;
+ mac_mode = tp->mac_mode &
+ ~(MAC_MODE_PORT_MODE_MASK | MAC_MODE_HALF_DUPLEX);
+ mac_mode |= MAC_MODE_PORT_INT_LPBACK;
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
mac_mode |= MAC_MODE_LINK_POLARITY;
if (tp->phy_flags & TG3_PHYFLG_10_100_ONLY)
@@ -10868,7 +10869,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
tg3_writephy(tp, MII_BMCR, val);
udelay(40);
- mac_mode = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
+ mac_mode = tp->mac_mode &
+ ~(MAC_MODE_PORT_MODE_MASK | MAC_MODE_HALF_DUPLEX);
if (tp->phy_flags & TG3_PHYFLG_IS_FET) {
tg3_writephy(tp, MII_TG3_FET_PTEST,
MII_TG3_FET_PTEST_FRC_TX_LINK |
@@ -10896,6 +10898,13 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
MII_TG3_EXT_CTRL_LNK3_LED_MODE);
}
tw32(MAC_MODE, mac_mode);
+
+ /* Wait for link */
+ for (i = 0; i < 100; i++) {
+ if (tr32(MAC_TX_STATUS) & TX_STATUS_LINK_UP)
+ break;
+ mdelay(1);
+ }
} else {
return -EINVAL;
}
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 02/11] tg3: Fix 5719 A0 tx completion bug
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
The 5719 A0 has a bug that manifests itself as if the chipset were
reordering memory writes. The best known way to solve this problem is
to turn off LSO and jumbo frames.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 12 ++++++++----
drivers/net/tg3.h | 1 +
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 07d4e61..8756f31 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8108,8 +8108,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
/* Program the jumbo buffer descriptor ring control
* blocks on those devices that have them.
*/
- if ((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) &&
- !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0 ||
+ ((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) &&
+ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS))) {
/* Setup replenish threshold. */
tw32(RCVBDI_JUMBO_THRESH, tp->rx_jumbo_pending / 8);
@@ -13329,7 +13330,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
}
/* Determine TSO capabilities */
- if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0)
+ ; /* Do nothing. HW bug. */
+ else if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3;
else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
@@ -13380,7 +13383,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
}
- if (tp->tg3_flags3 & TG3_FLG3_5717_PLUS)
+ if ((tp->tg3_flags3 & TG3_FLG3_5717_PLUS) &&
+ tp->pci_chip_rev_id != CHIPREV_ID_5719_A0)
tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 0a0987a..52ae644 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -141,6 +141,7 @@
#define CHIPREV_ID_57780_A1 0x57780001
#define CHIPREV_ID_5717_A0 0x05717000
#define CHIPREV_ID_57765_A0 0x57785000
+#define CHIPREV_ID_5719_A0 0x05719000
#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
#define ASIC_REV_5700 0x07
#define ASIC_REV_5701 0x00
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 10/11] tg3: Fix eee preprocessor naming
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
This patch fixes a preprocessor naming bug for one of the EEE registers.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 2 +-
drivers/net/tg3.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index eb90400..c7ac812 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7829,7 +7829,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
TG3_CPMU_DBTMR1_LNKIDLE_2047US);
tw32_f(TG3_CPMU_EEE_DBTMR2,
- TG3_CPMU_DBTMR1_APE_TX_2047US |
+ TG3_CPMU_DBTMR2_APE_TX_2047US |
TG3_CPMU_DBTMR2_TXIDXEQ_2047US);
}
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 1dbe5ec..716fc00 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1106,7 +1106,7 @@
#define TG3_CPMU_DBTMR1_PCIEXIT_2047US 0x07ff0000
#define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000070ff
#define TG3_CPMU_EEE_DBTMR2 0x000036b8
-#define TG3_CPMU_DBTMR1_APE_TX_2047US 0x07ff0000
+#define TG3_CPMU_DBTMR2_APE_TX_2047US 0x07ff0000
#define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000070ff
#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 05/11] tg3: Restrict phy ioctl access
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
If management firmware is present and the device is down, the firmware
will assume control of the phy. If a phy access were allowed from the
host, it will collide with firmware phy accesses, resulting in
unpredictable behavior. This patch fixes the problem by disallowing phy
accesses during the problematic condition.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index b1274bc..b957b60 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -11165,7 +11165,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
break; /* We have no PHY */
- if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
+ ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
+ !netif_running(dev)))
return -EAGAIN;
spin_lock_bh(&tp->lock);
@@ -11181,7 +11183,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
break; /* We have no PHY */
- if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
+ if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) ||
+ ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
+ !netif_running(dev)))
return -EAGAIN;
spin_lock_bh(&tp->lock);
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 08/11] tg3: Disable EEE during loopback tests
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
EEE interferes with the hardware's ability to loop a packet back to the
host. This patch disables the feature for the duration of the test.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 0f00270..997f0d2 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -11013,14 +11013,19 @@ out:
static int tg3_test_loopback(struct tg3 *tp)
{
int err = 0;
- u32 cpmuctrl = 0;
+ u32 eee_cap, cpmuctrl = 0;
if (!netif_running(tp->dev))
return TG3_LOOPBACK_FAILED;
+ eee_cap = tp->phy_flags & TG3_PHYFLG_EEE_CAP;
+ tp->phy_flags &= ~TG3_PHYFLG_EEE_CAP;
+
err = tg3_reset_hw(tp, 1);
- if (err)
- return TG3_LOOPBACK_FAILED;
+ if (err) {
+ err = TG3_LOOPBACK_FAILED;
+ goto done;
+ }
/* Turn off gphy autopowerdown. */
if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
@@ -11040,8 +11045,10 @@ static int tg3_test_loopback(struct tg3 *tp)
udelay(10);
}
- if (status != CPMU_MUTEX_GNT_DRIVER)
- return TG3_LOOPBACK_FAILED;
+ if (status != CPMU_MUTEX_GNT_DRIVER) {
+ err = TG3_LOOPBACK_FAILED;
+ goto done;
+ }
/* Turn off link-based power management. */
cpmuctrl = tr32(TG3_CPMU_CTRL);
@@ -11070,6 +11077,9 @@ static int tg3_test_loopback(struct tg3 *tp)
if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
tg3_phy_toggle_apd(tp, true);
+done:
+ tp->phy_flags |= eee_cap;
+
return err;
}
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 03/11] tg3: Use new VLAN code
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
This patch pivots the tg3 driver to the new VLAN infrastructure.
All references to vlgrp have been removed. The driver still attempts to
disable VLAN tag stripping if CONFIG_VLAN_8021Q or
CONFIG_VLAN_8021Q_MODULE is not defined.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 95 +++++-----------------------------------------------
drivers/net/tg3.h | 3 --
2 files changed, 10 insertions(+), 88 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 8756f31..07da2b5 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -60,12 +60,6 @@
#define BAR_0 0
#define BAR_2 2
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-#define TG3_VLAN_TAG_USED 1
-#else
-#define TG3_VLAN_TAG_USED 0
-#endif
-
#include "tg3.h"
#define DRV_MODULE_NAME "tg3"
@@ -134,9 +128,6 @@
TG3_TX_RING_SIZE)
#define NEXT_TX(N) (((N) + 1) & (TG3_TX_RING_SIZE - 1))
-#define TG3_RX_DMA_ALIGN 16
-#define TG3_RX_HEADROOM ALIGN(VLAN_HLEN, TG3_RX_DMA_ALIGN)
-
#define TG3_DMA_BYTE_ENAB 64
#define TG3_RX_STD_DMA_SZ 1536
@@ -4722,8 +4713,6 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
struct sk_buff *skb;
dma_addr_t dma_addr;
u32 opaque_key, desc_idx, *post_ptr;
- bool hw_vlan __maybe_unused = false;
- u16 vtag __maybe_unused = 0;
desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK;
opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
@@ -4782,12 +4771,12 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
tg3_recycle_rx(tnapi, tpr, opaque_key,
desc_idx, *post_ptr);
- copy_skb = netdev_alloc_skb(tp->dev, len + VLAN_HLEN +
+ copy_skb = netdev_alloc_skb(tp->dev, len +
TG3_RAW_IP_ALIGN);
if (copy_skb == NULL)
goto drop_it_no_recycle;
- skb_reserve(copy_skb, TG3_RAW_IP_ALIGN + VLAN_HLEN);
+ skb_reserve(copy_skb, TG3_RAW_IP_ALIGN);
skb_put(copy_skb, len);
pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
skb_copy_from_linear_data(skb, copy_skb->data, len);
@@ -4814,30 +4803,11 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
}
if (desc->type_flags & RXD_FLAG_VLAN &&
- !(tp->rx_mode & RX_MODE_KEEP_VLAN_TAG)) {
- vtag = desc->err_vlan & RXD_VLAN_MASK;
-#if TG3_VLAN_TAG_USED
- if (tp->vlgrp)
- hw_vlan = true;
- else
-#endif
- {
- struct vlan_ethhdr *ve = (struct vlan_ethhdr *)
- __skb_push(skb, VLAN_HLEN);
-
- memmove(ve, skb->data + VLAN_HLEN,
- ETH_ALEN * 2);
- ve->h_vlan_proto = htons(ETH_P_8021Q);
- ve->h_vlan_TCI = htons(vtag);
- }
- }
+ !(tp->rx_mode & RX_MODE_KEEP_VLAN_TAG))
+ __vlan_hwaccel_put_tag(skb,
+ desc->err_vlan & RXD_VLAN_MASK);
-#if TG3_VLAN_TAG_USED
- if (hw_vlan)
- vlan_gro_receive(&tnapi->napi, tp->vlgrp, vtag, skb);
- else
-#endif
- napi_gro_receive(&tnapi->napi, skb);
+ napi_gro_receive(&tnapi->napi, skb);
received++;
budget--;
@@ -5740,11 +5710,9 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
base_flags |= TXD_FLAG_TCPUDP_CSUM;
}
-#if TG3_VLAN_TAG_USED
if (vlan_tx_tag_present(skb))
base_flags |= (TXD_FLAG_VLAN |
(vlan_tx_tag_get(skb) << 16));
-#endif
len = skb_headlen(skb);
@@ -5986,11 +5954,10 @@ static netdev_tx_t tg3_start_xmit_dma_bug(struct sk_buff *skb,
}
}
}
-#if TG3_VLAN_TAG_USED
+
if (vlan_tx_tag_present(skb))
base_flags |= (TXD_FLAG_VLAN |
(vlan_tx_tag_get(skb) << 16));
-#endif
if ((tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) &&
!mss && skb->len > VLAN_ETH_FRAME_LEN)
@@ -9537,17 +9504,10 @@ static void __tg3_set_rx_mode(struct net_device *dev)
rx_mode = tp->rx_mode & ~(RX_MODE_PROMISC |
RX_MODE_KEEP_VLAN_TAG);
+#if !defined(CONFIG_VLAN_8021Q) && !defined(CONFIG_VLAN_8021Q_MODULE)
/* When ASF is in use, we always keep the RX_MODE_KEEP_VLAN_TAG
* flag clear.
*/
-#if TG3_VLAN_TAG_USED
- if (!tp->vlgrp &&
- !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
- rx_mode |= RX_MODE_KEEP_VLAN_TAG;
-#else
- /* By definition, VLAN is disabled always in this
- * case.
- */
if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
rx_mode |= RX_MODE_KEEP_VLAN_TAG;
#endif
@@ -11235,31 +11195,6 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return -EOPNOTSUPP;
}
-#if TG3_VLAN_TAG_USED
-static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
-{
- struct tg3 *tp = netdev_priv(dev);
-
- if (!netif_running(dev)) {
- tp->vlgrp = grp;
- return;
- }
-
- tg3_netif_stop(tp);
-
- tg3_full_lock(tp, 0);
-
- tp->vlgrp = grp;
-
- /* Update RX_MODE_KEEP_VLAN_TAG bit in RX_MODE register. */
- __tg3_set_rx_mode(dev);
-
- tg3_netif_start(tp);
-
- tg3_full_unlock(tp);
-}
-#endif
-
static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
{
struct tg3 *tp = netdev_priv(dev);
@@ -13071,9 +13006,7 @@ static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
{
-#if TG3_VLAN_TAG_USED
dev->vlan_features |= flags;
-#endif
}
static inline u32 tg3_rx_ret_ring_size(struct tg3 *tp)
@@ -13835,11 +13768,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
else
tp->tg3_flags &= ~TG3_FLAG_POLL_SERDES;
- tp->rx_offset = NET_IP_ALIGN + TG3_RX_HEADROOM;
+ tp->rx_offset = NET_IP_ALIGN;
tp->rx_copy_thresh = TG3_RX_COPY_THRESHOLD;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
(tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) {
- tp->rx_offset -= NET_IP_ALIGN;
+ tp->rx_offset = 0;
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
tp->rx_copy_thresh = ~(u16)0;
#endif
@@ -14603,9 +14536,6 @@ static const struct net_device_ops tg3_netdev_ops = {
.ndo_do_ioctl = tg3_ioctl,
.ndo_tx_timeout = tg3_tx_timeout,
.ndo_change_mtu = tg3_change_mtu,
-#if TG3_VLAN_TAG_USED
- .ndo_vlan_rx_register = tg3_vlan_rx_register,
-#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = tg3_poll_controller,
#endif
@@ -14622,9 +14552,6 @@ static const struct net_device_ops tg3_netdev_ops_dma_bug = {
.ndo_do_ioctl = tg3_ioctl,
.ndo_tx_timeout = tg3_tx_timeout,
.ndo_change_mtu = tg3_change_mtu,
-#if TG3_VLAN_TAG_USED
- .ndo_vlan_rx_register = tg3_vlan_rx_register,
-#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = tg3_poll_controller,
#endif
@@ -14674,9 +14601,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
SET_NETDEV_DEV(dev, &pdev->dev);
-#if TG3_VLAN_TAG_USED
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-#endif
tp = netdev_priv(dev);
tp->pdev = pdev;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 52ae644..fc8ecdd 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2813,9 +2813,6 @@ struct tg3 {
u32 rx_std_max_post;
u32 rx_offset;
u32 rx_pkt_map_sz;
-#if TG3_VLAN_TAG_USED
- struct vlan_group *vlgrp;
-#endif
/* begin "everything else" cacheline(s) section */
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 11/11] tg3: Update copyrights and update version to 3.117
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
This patch updates copyrights and updates the tg3 version to 3.117.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 6 +++---
drivers/net/tg3.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index c7ac812..4ca0b7a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4,7 +4,7 @@
* Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com)
* Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com)
* Copyright (C) 2004 Sun Microsystems Inc.
- * Copyright (C) 2005-2010 Broadcom Corporation.
+ * Copyright (C) 2005-2011 Broadcom Corporation.
*
* Firmware is:
* Derived from proprietary unpublished source code,
@@ -64,10 +64,10 @@
#define DRV_MODULE_NAME "tg3"
#define TG3_MAJ_NUM 3
-#define TG3_MIN_NUM 116
+#define TG3_MIN_NUM 117
#define DRV_MODULE_VERSION \
__stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
-#define DRV_MODULE_RELDATE "December 3, 2010"
+#define DRV_MODULE_RELDATE "January 25, 2011"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 716fc00..73884b6 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -4,7 +4,7 @@
* Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com)
* Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com)
* Copyright (C) 2004 Sun Microsystems Inc.
- * Copyright (C) 2007-2010 Broadcom Corporation.
+ * Copyright (C) 2007-2011 Broadcom Corporation.
*/
#ifndef _T3_H
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 09/11] tg3: Fix EEE interoperability issue
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
This patch fixes a problem where EEE will fail to work in certain
environments.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 42 +++++++++++++++++++++++++++++++++++-------
drivers/net/tg3.h | 4 ++++
2 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 997f0d2..eb90400 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1776,9 +1776,29 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
tg3_phy_cl45_read(tp, MDIO_MMD_AN,
TG3_CL45_D7_EEERES_STAT, &val);
- if (val == TG3_CL45_D7_EEERES_STAT_LP_1000T ||
- val == TG3_CL45_D7_EEERES_STAT_LP_100TX)
+ switch (val) {
+ case TG3_CL45_D7_EEERES_STAT_LP_1000T:
+ switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
+ case ASIC_REV_5717:
+ case ASIC_REV_5719:
+ case ASIC_REV_57765:
+ /* Enable SM_DSP clock and tx 6dB coding. */
+ val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
+ MII_TG3_AUXCTL_ACTL_SMDSP_ENA |
+ MII_TG3_AUXCTL_ACTL_TX_6DB;
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
+
+ tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0000);
+
+ /* Turn off SM_DSP clock. */
+ val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
+ MII_TG3_AUXCTL_ACTL_TX_6DB;
+ tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
+ }
+ /* Fallthrough */
+ case TG3_CL45_D7_EEERES_STAT_LP_100TX:
tp->setlpicnt = 2;
+ }
}
if (!tp->setlpicnt) {
@@ -2968,11 +2988,19 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
MII_TG3_AUXCTL_ACTL_TX_6DB;
tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
- if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
- !tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
- tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2,
- val | MII_TG3_DSP_CH34TP2_HIBW01);
+ switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
+ case ASIC_REV_5717:
+ case ASIC_REV_57765:
+ if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
+ tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, val |
+ MII_TG3_DSP_CH34TP2_HIBW01);
+ /* Fall through */
+ case ASIC_REV_5719:
+ val = MII_TG3_DSP_TAP26_ALNOKO |
+ MII_TG3_DSP_TAP26_RMRXSTO |
+ MII_TG3_DSP_TAP26_OPCSINPT;
+ tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
+ }
val = 0;
if (tp->link_config.autoneg == AUTONEG_ENABLE) {
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index fc8ecdd..1dbe5ec 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2113,6 +2113,10 @@
#define MII_TG3_DSP_TAP1 0x0001
#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007
+#define MII_TG3_DSP_TAP26 0x001a
+#define MII_TG3_DSP_TAP26_ALNOKO 0x0001
+#define MII_TG3_DSP_TAP26_RMRXSTO 0x0002
+#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004
#define MII_TG3_DSP_AADJ1CH0 0x001f
#define MII_TG3_DSP_CH34TP2 0x4022
#define MII_TG3_DSP_CH34TP2_HIBW01 0x0010
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 07/11] tg3: Disable MAC loopback test for CPMU devices
From: Matt Carlson @ 2011-01-26 1:58 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
On CPMU devices, the MAC loopback test does not test any important paths
the phy loopback test doesn't also test. The phy loopback test is the
more comprehensive test. This patch disables the MAC loopback test for
these devices.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 988861a..0f00270 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10840,9 +10840,11 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
if (loopback_mode == TG3_MAC_LOOPBACK) {
/* HW errata - mac loopback fails in some cases on 5780.
* Normal traffic and PHY loopback are not affected by
- * errata.
+ * errata. Also, the MAC loopback test is deprecated for
+ * all newer ASIC revisions.
*/
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 ||
+ (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT))
return 0;
mac_mode = tp->mac_mode &
--
1.7.2.2
^ permalink raw reply related
* Re: [RFC 00/20] Proposal for remaining BKL users
From: Greg KH @ 2011-01-26 2:22 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Mauro Carvalho Chehab, Frederic Weisbecker, dri-devel,
Mikulas Patocka, H. Peter Anvin, Ian Kent, linux-cifs,
Nick Bowler, linux-x25, Takahiro Hirofuchi, Ross Cohen,
Arnaldo Carvalho de Melo, Evgeniy Dushistov, Stuart Swales,
Thomas Gleixner, Arjan van de Ven, autofs, Jeff Layton, netdev,
linux-kernel, Palash Bandyopadhyay, linux-fsdevel, Andrew Morton
In-Reply-To: <1295993854-4971-1-git-send-email-arnd@arndb.de>
On Tue, Jan 25, 2011 at 11:17:14PM +0100, Arnd Bergmann wrote:
> I've gone through all the code in the kernel that
> uses the big kernel lock and come up with a solution
> that seems at least half-reasonable for each of them.
>
> The decisions are somewhat arbitrary, but here is
> what I'd suggest we do:
>
> * Remove in 2.6.39:
> i830, autofs3, smbfs
I thought some people really wanted to keep i830. Or was that i810?
I'll drop autofs3 and smbfs, thanks.
> * Move to staging now, kill in 2.6.41 (or later):
> appletalk, hpfs
Sounds good to me.
> * Work around in an ugly way, but keep alive:
> * ufs, ipx, i810, cx25721
>
> * Fix properly:
> * usbip, go7007, adfs, x25
Thanks for the usbip and go7007 patches, I'll queue them up.
greg k-h
^ permalink raw reply
* Re: [PATCH net-next 0/11] tg3: 5719, VLAN, and EEE bugfixes
From: David Miller @ 2011-01-26 3:38 UTC (permalink / raw)
To: mcarlson; +Cc: netdev, andy
In-Reply-To: <1296007137-23146-1-git-send-email-mcarlson@broadcom.com>
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Tue, 25 Jan 2011 17:58:46 -0800
> This patchset implements bugfixes for the 5719, the VLAN code and
> enhances EEE support.
All applied to net-next-2.6, thanks.
In particular, thanks for taking care of the vlan conversion.
^ permalink raw reply
* Re: [PATCH 2/2] xen: netfront: Drop GSO SKBs which do not have csum_blank.
From: David Miller @ 2011-01-26 3:44 UTC (permalink / raw)
To: ian.campbell; +Cc: netdev, jeremy, xen-devel
In-Reply-To: <1295975400-538-2-git-send-email-ian.campbell@citrix.com>
From: Ian Campbell <ian.campbell@citrix.com>
Date: Tue, 25 Jan 2011 17:10:00 +0000
> The Linux network stack expects all GSO SKBs to have ip_summed ==
> CHECKSUM_PARTIAL (which implies that the frame contains a partial
> checksum) and the Xen network ring protocol similarly expects an SKB
> which has GSO set to also have NETRX_csum_blank (which also implies a
> partial checksum). Therefore drop such frames on receive otherwise
> they will trigger the warning in skb_gso_segment.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
The GSO code does in fact warn in the logs about this situation, but
it _DOES NOT_ drop the packet. Therefore, either you guys should do
the same or we should make the generic code drop too.
I think the generic code is doing the right thing, therefore what you
should probably do is put the checksum of the SKB into the right state
when you detect this situation (and perhaps bump a ethtool driver
local statistic which specifically tracks this exact event).
Or, even better, you should fix whatever causes this in the first
place.
Dropping frames ought to be the last option, stuff like this is
impossible to debug if someone starts wondering why they are getting
frame drops.
You don't even account for this in a unique statistic somewhere, so
people can figure out the actual spcific _reason_ for the drop. They
will just see "rx_error" and scratch their heads.
Anyways, I think dropping is fundamentally wrong, so I'm not applying
this.
^ permalink raw reply
* Re: [PATCH v3] smc91x: add devicetree support
From: David Miller @ 2011-01-26 3:45 UTC (permalink / raw)
To: thomas-SDxUXYEhEBiCuPEqFHbRBg
Cc: nios2-dev-1eJk0qcHJCcaeqlQEoCUNoJY59XmG8rH,
netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1295957508-2701-1-git-send-email-thomas-SDxUXYEhEBiCuPEqFHbRBg@public.gmane.org>
From: Thomas Chou <thomas-SDxUXYEhEBiCuPEqFHbRBg@public.gmane.org>
Date: Tue, 25 Jan 2011 20:11:48 +0800
> @@ -2394,6 +2395,13 @@ static int smc_drv_resume(struct device *dev)
> return 0;
> }
>
> +static const struct of_device_id smc91x_match[] = {
> + { .compatible = "smsc,lan91c94", },
> + { .compatible = "smsc,lan91c111", },
> + {},
> +}
> +MODULE_DEVICE_TABLE(of, smc91x_match);
> +
> static struct dev_pm_ops smc_drv_pm_ops = {
> .suspend = smc_drv_suspend,
> .resume = smc_drv_resume,
You should not unconditionally put the 'of' device table into the
module image, otherwise the module will be marked as being able to
support OF based devices but the code to support that won't actually
be comiled into the module.
^ permalink raw reply
* [PATCH v4] smc91x: add devicetree support
From: Thomas Chou @ 2011-01-26 5:22 UTC (permalink / raw)
To: Grant Likely, David Miller
Cc: nios2-dev-1eJk0qcHJCcaeqlQEoCUNoJY59XmG8rH,
netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110125.194532.71125517.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Signed-off-by: Thomas Chou <thomas-SDxUXYEhEBiCuPEqFHbRBg@public.gmane.org>
---
v2 specify part numbers in compat as Grant suggested.
v3 more specific part name.
v4 include match table only for OF as David suggested.
drivers/net/smc91x.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 726df61..43654a3 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -81,6 +81,7 @@ static const char version[] =
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/workqueue.h>
+#include <linux/of.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
@@ -2394,6 +2395,15 @@ static int smc_drv_resume(struct device *dev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id smc91x_match[] = {
+ { .compatible = "smsc,lan91c94", },
+ { .compatible = "smsc,lan91c111", },
+ {},
+}
+MODULE_DEVICE_TABLE(of, smc91x_match);
+#endif
+
static struct dev_pm_ops smc_drv_pm_ops = {
.suspend = smc_drv_suspend,
.resume = smc_drv_resume,
@@ -2406,6 +2416,9 @@ static struct platform_driver smc_driver = {
.name = CARDNAME,
.owner = THIS_MODULE,
.pm = &smc_drv_pm_ops,
+#ifdef CONFIG_OF
+ .of_match_table = smc91x_match,
+#endif
},
};
--
1.7.3.5
^ permalink raw reply related
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