Netdev List
 help / color / mirror / Atom feed
* [PATCH] can: Update logging style
From: Joe Perches @ 2011-11-29 18:54 UTC (permalink / raw)
  To: Oliver Hartkopp, Urs Thuermann
  Cc: David S. Miller, linux-can, netdev, linux-kernel

Use pr_fmt, pr_<level> and pr_<level>_ratelimited.
Coalesce format strings.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/can/af_can.c |   31 ++++++++++++++-----------------
 net/can/bcm.c    |   14 ++++++++------
 net/can/gw.c     |    6 ++++--
 net/can/proc.c   |    8 ++++----
 net/can/raw.c    |    8 +++++---
 5 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/net/can/af_can.c b/net/can/af_can.c
index 0ce2ad0..c4f0da5 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -40,6 +40,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kmod.h>
@@ -62,8 +64,8 @@
 
 #include "af_can.h"
 
-static __initdata const char banner[] = KERN_INFO
-	"can: controller area network core (" CAN_VERSION_STRING ")\n";
+static __initdata const char banner[] =
+	"controller area network core (" CAN_VERSION_STRING ")";
 
 MODULE_DESCRIPTION("Controller Area Network PF_CAN core");
 MODULE_LICENSE("Dual BSD/GPL");
@@ -161,8 +163,8 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
 		 * return -EPROTONOSUPPORT
 		 */
 		if (err)
-			printk_ratelimited(KERN_ERR "can: request_module "
-			       "(can-proto-%d) failed.\n", protocol);
+			pr_err_ratelimited("request_module (can-proto-%d) failed\n",
+					   protocol);
 
 		cp = can_get_proto(protocol);
 	}
@@ -505,8 +507,7 @@ void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
 
 	d = find_dev_rcv_lists(dev);
 	if (!d) {
-		printk(KERN_ERR "BUG: receive list not found for "
-		       "dev %s, id %03X, mask %03X\n",
+		pr_err("BUG: receive list not found for dev %s, id %03X, mask %03X\n",
 		       DNAME(dev), can_id, mask);
 		goto out;
 	}
@@ -532,8 +533,7 @@ void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
 	 */
 
 	if (!next) {
-		printk(KERN_ERR "BUG: receive list entry not found for "
-		       "dev %s, id %03X, mask %03X\n",
+		pr_err("BUG: receive list entry not found for dev %s, id %03X, mask %03X\n",
 		       DNAME(dev), can_id, mask);
 		r = NULL;
 		goto out;
@@ -701,8 +701,7 @@ int can_proto_register(const struct can_proto *cp)
 	int err = 0;
 
 	if (proto < 0 || proto >= CAN_NPROTO) {
-		printk(KERN_ERR "can: protocol number %d out of range\n",
-		       proto);
+		pr_err("protocol number %d out of range\n", proto);
 		return -EINVAL;
 	}
 
@@ -713,8 +712,7 @@ int can_proto_register(const struct can_proto *cp)
 	mutex_lock(&proto_tab_lock);
 
 	if (proto_tab[proto]) {
-		printk(KERN_ERR "can: protocol %d already registered\n",
-		       proto);
+		pr_err("protocol %d already registered\n", proto);
 		err = -EBUSY;
 	} else
 		RCU_INIT_POINTER(proto_tab[proto], cp);
@@ -769,8 +767,7 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
 		/* create new dev_rcv_lists for this device */
 		d = kzalloc(sizeof(*d), GFP_KERNEL);
 		if (!d) {
-			printk(KERN_ERR
-			       "can: allocation of receive list failed\n");
+			pr_err("allocation of receive list failed\n");
 			return NOTIFY_DONE;
 		}
 		BUG_ON(dev->ml_priv);
@@ -790,8 +787,8 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
 				dev->ml_priv = NULL;
 			}
 		} else
-			printk(KERN_ERR "can: notifier: receive list not "
-			       "found for dev %s\n", dev->name);
+			pr_err("notifier: receive list not found for dev %s\n",
+			       dev->name);
 
 		spin_unlock(&can_rcvlists_lock);
 
@@ -824,7 +821,7 @@ static struct notifier_block can_netdev_notifier __read_mostly = {
 
 static __init int can_init(void)
 {
-	printk(banner);
+	pr_info("%s\n", banner);
 
 	memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list));
 
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 151b773..540c804 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -39,6 +39,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -77,8 +79,8 @@
 		     (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
 
 #define CAN_BCM_VERSION CAN_VERSION
-static __initdata const char banner[] = KERN_INFO
-	"can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n";
+static __initdata const char banner[] =
+	"broadcast manager protocol (rev " CAN_BCM_VERSION " t)";
 
 MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
 MODULE_LICENSE("Dual BSD/GPL");
@@ -729,8 +731,8 @@ static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op)
 		/* mark as removed subscription */
 		op->rx_reg_dev = NULL;
 	} else
-		printk(KERN_ERR "can-bcm: bcm_rx_unreg: registered device "
-		       "mismatch %p %p\n", op->rx_reg_dev, dev);
+		pr_err("%s: registered device mismatch %p %p\n",
+		       __func__, op->rx_reg_dev, dev);
 }
 
 /*
@@ -1606,11 +1608,11 @@ static int __init bcm_module_init(void)
 {
 	int err;
 
-	printk(banner);
+	pr_info("%s\n", banner);
 
 	err = can_proto_register(&bcm_can_proto);
 	if (err < 0) {
-		printk(KERN_ERR "can: registration of bcm protocol failed\n");
+		pr_err("registration of bcm protocol failed\n");
 		return err;
 	}
 
diff --git a/net/can/gw.c b/net/can/gw.c
index 3d79b12..e17253f 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -39,6 +39,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -59,7 +61,7 @@
 
 #define CAN_GW_VERSION "20101209"
 static __initdata const char banner[] =
-	KERN_INFO "can: netlink gateway (rev " CAN_GW_VERSION ")\n";
+	"netlink gateway (rev " CAN_GW_VERSION ")";
 
 MODULE_DESCRIPTION("PF_CAN netlink gateway");
 MODULE_LICENSE("Dual BSD/GPL");
@@ -913,7 +915,7 @@ static int cgw_remove_job(struct sk_buff *skb,  struct nlmsghdr *nlh, void *arg)
 
 static __init int cgw_module_init(void)
 {
-	printk(banner);
+	pr_info("%s\n", banner);
 
 	cgw_cache = kmem_cache_create("can_gw", sizeof(struct cgw_job),
 				      0, 0, NULL);
diff --git a/net/can/proc.c b/net/can/proc.c
index ba873c3..c3aedf5 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -39,6 +39,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/list.h>
@@ -118,8 +120,7 @@ static unsigned long calc_rate(unsigned long oldjif, unsigned long newjif,
 
 	/* see can_stat_update() - this should NEVER happen! */
 	if (count > (ULONG_MAX / HZ)) {
-		printk(KERN_ERR "can: calc_rate: count exceeded! %ld\n",
-		       count);
+		pr_err("%s: count exceeded! %ld\n", __func__, count);
 		return 99999999;
 	}
 
@@ -475,8 +476,7 @@ void can_init_proc(void)
 	can_dir = proc_mkdir("can", init_net.proc_net);
 
 	if (!can_dir) {
-		printk(KERN_INFO "can: failed to create /proc/net/can . "
-		       "CONFIG_PROC_FS missing?\n");
+		pr_info("failed to create /proc/net/can . CONFIG_PROC_FS missing?\n");
 		return;
 	}
 
diff --git a/net/can/raw.c b/net/can/raw.c
index cde1b4a..2875c55 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -39,6 +39,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/uio.h>
@@ -56,7 +58,7 @@
 
 #define CAN_RAW_VERSION CAN_VERSION
 static __initdata const char banner[] =
-	KERN_INFO "can: raw protocol (rev " CAN_RAW_VERSION ")\n";
+	"raw protocol (rev " CAN_RAW_VERSION ")";
 
 MODULE_DESCRIPTION("PF_CAN raw protocol");
 MODULE_LICENSE("Dual BSD/GPL");
@@ -783,11 +785,11 @@ static __init int raw_module_init(void)
 {
 	int err;
 
-	printk(banner);
+	pr_info("%s\n", banner);
 
 	err = can_proto_register(&raw_can_proto);
 	if (err < 0)
-		printk(KERN_ERR "can: registration of raw protocol failed\n");
+		pr_err("registration of raw protocol failed\n");
 
 	return err;
 }
-- 
1.7.6.405.gc1be0

^ permalink raw reply related

* Re: [bug?] r8169: hangs under heavy load
From: Lucas Stach @ 2011-11-29 19:09 UTC (permalink / raw)
  To: Netdev, Francois Romieu

[please cc me on every answer, I'm not subscribed to the list]

Hello Francois and others,

>Gerd, can you try the patch below ? It should match Haye's description.
>
>diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
>index 6f06aa1..97b5593 100644
>--- a/drivers/net/ethernet/realtek/r8169.c
>+++ b/drivers/net/ethernet/realtek/r8169.c
>@@ -4885,8 +4885,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
> 	RTL_W16(IntrMitigate, 0x5151);
> 
> 	/* Work around for RxFIFO overflow. */
>-	if (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
>-	    tp->mac_version == RTL_GIGA_MAC_VER_22) {
>+	if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
> 		tp->intr_event |= RxFIFOOver | PCSTimeout;
> 		tp->intr_event &= ~RxOverflow;
> 	}
>@@ -5804,6 +5803,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
> 	 */
> 	status = RTL_R16(IntrStatus);
> 	while (status && status != 0xffff) {
>+		status &= ~tp->intr_event;
>+		if (!status)
>+			break;
>+
> 		handled = 1;
> 
> 		/* Handle all of the error cases first. These will reset
>@@ -5818,7 +5821,6 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
> 			switch (tp->mac_version) {
> 			/* Work around for rx fifo overflow */
> 			case RTL_GIGA_MAC_VER_11:
>-			case RTL_GIGA_MAC_VER_22:
> 			case RTL_GIGA_MAC_VER_26:
> 				netif_stop_queue(dev);
> 				rtl8169_tx_timeout(dev);
>@@ -5828,6 +5830,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
> 			case RTL_GIGA_MAC_VER_19:
> 			case RTL_GIGA_MAC_VER_20:
> 			case RTL_GIGA_MAC_VER_21:
>+			case RTL_GIGA_MAC_VER_22:
 			case RTL_GIGA_MAC_VER_23:
 			case RTL_GIGA_MAC_VER_24:
 			case RTL_GIGA_MAC_VER_27:

I have tried the above patch in an attempt to solve my problem described
in message "Lockups with r8169 driver (Was: Hangs with Linux
3.2.0-rc3)", which are really similar to the problem described in this
thread.

The patch doesn't help, in fact it renders the ethernet adapter
unusable, as it is failing even the media detect (according to network
manager). I will gladly test any other patches you come up with.

Thanks,
Lucas

^ permalink raw reply

* Re: [PATCH] sctp: integer overflow in sctp_auth_create_key()
From: Xi Wang @ 2011-11-29 19:24 UTC (permalink / raw)
  To: Vladislav Yasevich
  Cc: linux-kernel, Sridhar Samudrala, David S. Miller, linux-sctp,
	netdev, security
In-Reply-To: <4ED4F428.9030807@hp.com>

Thanks for clarifying this!

I will leave the check there and incorporate your comments into a new patch.

- xi

On Nov 29, 2011, at 10:03 AM, Vladislav Yasevich wrote:
> 
> That should be ok as well.  There is an overflow guard in the api
> entry point so that should guard against overflows from user space.
> 
> On the network end I miscalculated a little.  The key is actually made up
> of user_key (1 short) + 2 * key_vector (3 shorts) for a total of 7*MAX_USHORT;
> however, that still will not overflow 32 bits.
> 
> -vlad

^ permalink raw reply

* [PATCH v2] sctp: better integer overflow check in sctp_auth_create_key()
From: Xi Wang @ 2011-11-29 19:26 UTC (permalink / raw)
  To: Vladislav Yasevich
  Cc: linux-kernel, Sridhar Samudrala, David S. Miller, linux-sctp,
	netdev, security
In-Reply-To: <A1A6AF9D-8C35-4702-9693-7BCBEDE27219@gmail.com>

The check from commit 30c2235c is incomplete and cannot prevent
cases like key_len = 0x80000000 (INT_MAX + 1).  In that case, the
left-hand side of the check (INT_MAX - key_len), which is unsigned,
becomes 0xffffffff (UINT_MAX) and bypasses the check.

However this shouldn't be a security issue.  The function is called
from the following two code paths:

 1) setsockopt()

 2) sctp_auth_asoc_set_secret()

In case (1), sca_keylength is never going to exceed 65535 since it's
bounded by a u16 from the user API.  As such, the key length will
never overflow.

In case (2), sca_keylength is computed based on the user key (1 short)
and 2 * key_vector (3 shorts) for a total of 7 * USHRT_MAX, which still
will not overflow.

In other words, this overflow check is not really necessary.  Just
make it more correct.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
---
 net/sctp/auth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 865e68f..bf81204 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -82,7 +82,7 @@ static struct sctp_auth_bytes *sctp_auth_create_key(__u32 key_len, gfp_t gfp)
 	struct sctp_auth_bytes *key;
 
 	/* Verify that we are not going to overflow INT_MAX */
-	if ((INT_MAX - key_len) < sizeof(struct sctp_auth_bytes))
+	if (key_len > (INT_MAX - sizeof(struct sctp_auth_bytes)))
 		return NULL;
 
 	/* Allocate the shared key */
-- 
1.7.5.4

^ permalink raw reply related

* Re: [PATCH] sctp: integer overflow in sctp_auth_create_key()
From: Xi Wang @ 2011-11-29 19:31 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, vladislav.yasevich, sri, linux-sctp, netdev,
	security
In-Reply-To: <20111129.011932.1501413448765180498.davem@davemloft.net>

Sorry my bad.

BTW it seems that the patch was not applied correctly either in
the commit a5e5c374 --- it says "No differences found".

Can you please apply the new patch v2?  Thanks.

- xi

On Nov 29, 2011, at 1:19 AM, David Miller wrote:
> 
> Applied, but I had to apply your patch by hand because it was
> corrupted by your email client.
> 
> Please fix this problem because I am not applying any other patch
> you've submitted which has this issue.

^ permalink raw reply

* Re: [PATCH v2] sctp: better integer overflow check in sctp_auth_create_key()
From: David Miller @ 2011-11-29 19:35 UTC (permalink / raw)
  To: xi.wang; +Cc: vladislav.yasevich, linux-kernel, sri, linux-sctp, netdev,
	security
In-Reply-To: <125BB325-72D4-4FEF-A5CC-118680EC78D2@gmail.com>

From: Xi Wang <xi.wang@gmail.com>
Date: Tue, 29 Nov 2011 14:26:30 -0500

> The check from commit 30c2235c is incomplete and cannot prevent
> cases like key_len = 0x80000000 (INT_MAX + 1).  In that case, the
> left-hand side of the check (INT_MAX - key_len), which is unsigned,
> becomes 0xffffffff (UINT_MAX) and bypasses the check.
> 
> However this shouldn't be a security issue.  The function is called
> from the following two code paths:
> 
>  1) setsockopt()
> 
>  2) sctp_auth_asoc_set_secret()
> 
> In case (1), sca_keylength is never going to exceed 65535 since it's
> bounded by a u16 from the user API.  As such, the key length will
> never overflow.
> 
> In case (2), sca_keylength is computed based on the user key (1 short)
> and 2 * key_vector (3 shorts) for a total of 7 * USHRT_MAX, which still
> will not overflow.
> 
> In other words, this overflow check is not really necessary.  Just
> make it more correct.
> 
> Signed-off-by: Xi Wang <xi.wang@gmail.com>
> Cc: Vlad Yasevich <vladislav.yasevich@hp.com>

I already applied your patch, you cannot just post a patch as if
it hasn't been applied to the tree, it doesn't work like that.

Once I've applied one of your patches, it is "cast in stone" and
cannot be reverted.  You must therefore develop relative to the
change.

^ permalink raw reply

* [PATCH 0/4] nfc: Logging updates
From: Joe Perches @ 2011-11-29 19:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: netdev, linux-kernel

Use the standard logging styles

Joe Perches (4):
  nfc: Use standard logging styles
  nfc: Convert nfc_dbg to pr_debug
  nfc: Remove unused nfc_printk and nfc_<level> macros
  nfc: Remove function tracer like entry messages

 net/nfc/core.c     |   60 +++++++++++++-----------------------
 net/nfc/nci/core.c |   84 +++++++++++++++++++++------------------------------
 net/nfc/nci/data.c |   30 ++++++++++--------
 net/nfc/nci/ntf.c  |   83 ++++++++++++++++++++++++++-------------------------
 net/nfc/nci/rsp.c  |   84 ++++++++++++++++++++++++++-------------------------
 net/nfc/netlink.c  |   32 ++------------------
 net/nfc/nfc.h      |    7 ----
 net/nfc/rawsock.c  |   28 +++++++++--------
 8 files changed, 176 insertions(+), 232 deletions(-)

-- 
1.7.6.405.gc1be0

^ permalink raw reply

* [PATCH 1/4] nfc: Use standard logging styles
From: Joe Perches @ 2011-11-29 19:37 UTC (permalink / raw)
  To: Lauro Ramos Venancio, Aloisio Almeida Jr, Samuel Ortiz
  Cc: David S. Miller, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1322595343.git.joe@perches.com>

Using the normal logging styles is preferred over
subsystem specific styles when the subsystem does
not take a specific struct.

Convert nfc_<level> specific messages to pr_<level>
Add newlines to uses.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/nfc/core.c     |    4 +++-
 net/nfc/nci/core.c |   28 +++++++++++++++-------------
 net/nfc/nci/data.c |    8 +++++---
 net/nfc/nci/ntf.c  |   16 +++++++++-------
 net/nfc/nci/rsp.c  |    4 +++-
 net/nfc/rawsock.c  |    4 +++-
 6 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/net/nfc/core.c b/net/nfc/core.c
index 47e02c1..03e4571 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -21,6 +21,8 @@
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -500,7 +502,7 @@ static int __init nfc_init(void)
 {
 	int rc;
 
-	nfc_info("NFC Core ver %s", VERSION);
+	pr_info("NFC Core ver %s\n", VERSION);
 
 	rc = class_register(&nfc_class);
 	if (rc)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index fe5ca89..30032b2 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -25,6 +25,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/workqueue.h>
 #include <linux/completion.h>
@@ -96,8 +98,8 @@ static int __nci_request(struct nci_dev *ndev,
 			break;
 		}
 	} else {
-		nfc_err("wait_for_completion_interruptible_timeout failed %ld",
-			completion_rc);
+		pr_err("wait_for_completion_interruptible_timeout failed %ld\n",
+		       completion_rc);
 
 		rc = ((completion_rc == 0) ? (-ETIMEDOUT) : (completion_rc));
 	}
@@ -355,12 +357,12 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
 	nfc_dbg("entry");
 
 	if (test_bit(NCI_DISCOVERY, &ndev->flags)) {
-		nfc_err("unable to start poll, since poll is already active");
+		pr_err("unable to start poll, since poll is already active\n");
 		return -EBUSY;
 	}
 
 	if (ndev->target_active_prot) {
-		nfc_err("there is an active target");
+		pr_err("there is an active target\n");
 		return -EBUSY;
 	}
 
@@ -389,7 +391,7 @@ static void nci_stop_poll(struct nfc_dev *nfc_dev)
 	nfc_dbg("entry");
 
 	if (!test_bit(NCI_DISCOVERY, &ndev->flags)) {
-		nfc_err("unable to stop poll, since poll is not active");
+		pr_err("unable to stop poll, since poll is not active\n");
 		return;
 	}
 
@@ -405,18 +407,18 @@ static int nci_activate_target(struct nfc_dev *nfc_dev, __u32 target_idx,
 	nfc_dbg("entry, target_idx %d, protocol 0x%x", target_idx, protocol);
 
 	if (!test_bit(NCI_POLL_ACTIVE, &ndev->flags)) {
-		nfc_err("there is no available target to activate");
+		pr_err("there is no available target to activate\n");
 		return -EINVAL;
 	}
 
 	if (ndev->target_active_prot) {
-		nfc_err("there is already an active target");
+		pr_err("there is already an active target\n");
 		return -EBUSY;
 	}
 
 	if (!(ndev->target_available_prots & (1 << protocol))) {
-		nfc_err("target does not support the requested protocol 0x%x",
-			protocol);
+		pr_err("target does not support the requested protocol 0x%x\n",
+		       protocol);
 		return -EINVAL;
 	}
 
@@ -433,7 +435,7 @@ static void nci_deactivate_target(struct nfc_dev *nfc_dev, __u32 target_idx)
 	nfc_dbg("entry, target_idx %d", target_idx);
 
 	if (!ndev->target_active_prot) {
-		nfc_err("unable to deactivate target, no active target");
+		pr_err("unable to deactivate target, no active target\n");
 		return;
 	}
 
@@ -456,7 +458,7 @@ static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx,
 	nfc_dbg("entry, target_idx %d, len %d", target_idx, skb->len);
 
 	if (!ndev->target_active_prot) {
-		nfc_err("unable to exchange data, no active target");
+		pr_err("unable to exchange data, no active target\n");
 		return -EINVAL;
 	}
 
@@ -685,7 +687,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload)
 
 	skb = nci_skb_alloc(ndev, (NCI_CTRL_HDR_SIZE + plen), GFP_KERNEL);
 	if (!skb) {
-		nfc_err("no memory for command");
+		pr_err("no memory for command\n");
 		return -ENOMEM;
 	}
 
@@ -760,7 +762,7 @@ static void nci_rx_work(struct work_struct *work)
 			break;
 
 		default:
-			nfc_err("unknown MT 0x%x", nci_mt(skb->data));
+			pr_err("unknown MT 0x%x\n", nci_mt(skb->data));
 			kfree_skb(skb);
 			break;
 		}
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 511fb96..7d8a125 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -21,6 +21,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
@@ -49,7 +51,7 @@ void nci_data_exchange_complete(struct nci_dev *ndev,
 		/* forward skb to nfc core */
 		cb(cb_context, skb, err);
 	} else if (skb) {
-		nfc_err("no rx callback, dropping rx data...");
+		pr_err("no rx callback, dropping rx data...\n");
 
 		/* no waiting callback, free skb */
 		kfree_skb(skb);
@@ -161,7 +163,7 @@ int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb)
 		/* fragment packet and queue the fragments */
 		rc = nci_queue_tx_data_frags(ndev, conn_id, skb);
 		if (rc) {
-			nfc_err("failed to fragment tx data packet");
+			pr_err("failed to fragment tx data packet\n");
 			goto free_exit;
 		}
 	}
@@ -191,7 +193,7 @@ static void nci_add_rx_data_frag(struct nci_dev *ndev,
 
 		/* first, make enough room for the already accumulated data */
 		if (skb_cow_head(skb, reassembly_len)) {
-			nfc_err("error adding room for accumulated rx data");
+			pr_err("error adding room for accumulated rx data\n");
 
 			kfree_skb(skb);
 			skb = 0;
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index c1bf541..c704350 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -25,6 +25,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
@@ -114,8 +116,8 @@ static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
 		break;
 
 	default:
-		nfc_err("unsupported activation_rf_tech_and_mode 0x%x",
-			ntf->activation_rf_tech_and_mode);
+		pr_err("unsupported activation_rf_tech_and_mode 0x%x\n",
+		       ntf->activation_rf_tech_and_mode);
 		return -EPROTO;
 	}
 
@@ -182,8 +184,8 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
 			break;
 
 		default:
-			nfc_err("unsupported activation_rf_tech_and_mode 0x%x",
-				ntf.activation_rf_tech_and_mode);
+			pr_err("unsupported activation_rf_tech_and_mode 0x%x\n",
+			       ntf.activation_rf_tech_and_mode);
 			return;
 		}
 	}
@@ -214,8 +216,8 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
 			break;
 
 		default:
-			nfc_err("unsupported rf_interface_type 0x%x",
-				ntf.rf_interface_type);
+			pr_err("unsupported rf_interface_type 0x%x\n",
+			       ntf.rf_interface_type);
 			return;
 		}
 	}
@@ -278,7 +280,7 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
 		break;
 
 	default:
-		nfc_err("unknown ntf opcode 0x%x", ntf_opcode);
+		pr_err("unknown ntf opcode 0x%x\n", ntf_opcode);
 		break;
 	}
 
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index 0591f5a..6f51a28 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -25,6 +25,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
@@ -200,7 +202,7 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 		break;
 
 	default:
-		nfc_err("unknown rsp opcode 0x%x", rsp_opcode);
+		pr_err("unknown rsp opcode 0x%x\n", rsp_opcode);
 		break;
 	}
 
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index ee7b2b3..feb235b 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -21,6 +21,8 @@
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <net/tcp_states.h>
 #include <linux/nfc.h>
 #include <linux/export.h>
@@ -294,7 +296,7 @@ static void rawsock_destruct(struct sock *sk)
 	skb_queue_purge(&sk->sk_receive_queue);
 
 	if (!sock_flag(sk, SOCK_DEAD)) {
-		nfc_err("Freeing alive NFC raw socket %p", sk);
+		pr_err("Freeing alive NFC raw socket %p\n", sk);
 		return;
 	}
 }
-- 
1.7.6.405.gc1be0

^ permalink raw reply related

* [PATCH 2/4] nfc: Convert nfc_dbg to pr_debug
From: Joe Perches @ 2011-11-29 19:37 UTC (permalink / raw)
  To: Lauro Ramos Venancio, Aloisio Almeida Jr, Samuel Ortiz
  Cc: David S. Miller, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1322595343.git.joe@perches.com>

Using the standard debugging mechanisms is better than
subsystem specific ones when the subsystem doesn't use
a specific struct.

Coalesce long formats.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/nfc/core.c     |   37 ++++++++++++-----------
 net/nfc/nci/core.c |   56 ++++++++++++++++++------------------
 net/nfc/nci/data.c |   22 +++++++-------
 net/nfc/nci/ntf.c  |   67 +++++++++++++++++++++----------------------
 net/nfc/nci/rsp.c  |   80 ++++++++++++++++++++++++++--------------------------
 net/nfc/netlink.c  |   32 +++++++++++----------
 net/nfc/rawsock.c  |   24 ++++++++--------
 7 files changed, 160 insertions(+), 158 deletions(-)

diff --git a/net/nfc/core.c b/net/nfc/core.c
index 03e4571..c922adb 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -65,7 +65,7 @@ int nfc_dev_up(struct nfc_dev *dev)
 {
 	int rc = 0;
 
-	nfc_dbg("dev_name=%s", dev_name(&dev->dev));
+	pr_debug("dev_name=%s\n", dev_name(&dev->dev));
 
 	device_lock(&dev->dev);
 
@@ -99,7 +99,7 @@ int nfc_dev_down(struct nfc_dev *dev)
 {
 	int rc = 0;
 
-	nfc_dbg("dev_name=%s", dev_name(&dev->dev));
+	pr_debug("dev_name=%s\n", dev_name(&dev->dev));
 
 	device_lock(&dev->dev);
 
@@ -141,7 +141,8 @@ int nfc_start_poll(struct nfc_dev *dev, u32 protocols)
 {
 	int rc;
 
-	nfc_dbg("dev_name=%s protocols=0x%x", dev_name(&dev->dev), protocols);
+	pr_debug("dev_name=%s protocols=0x%x\n",
+		 dev_name(&dev->dev), protocols);
 
 	if (!protocols)
 		return -EINVAL;
@@ -176,7 +177,7 @@ int nfc_stop_poll(struct nfc_dev *dev)
 {
 	int rc = 0;
 
-	nfc_dbg("dev_name=%s", dev_name(&dev->dev));
+	pr_debug("dev_name=%s\n", dev_name(&dev->dev));
 
 	device_lock(&dev->dev);
 
@@ -209,8 +210,8 @@ int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol)
 {
 	int rc;
 
-	nfc_dbg("dev_name=%s target_idx=%u protocol=%u", dev_name(&dev->dev),
-							target_idx, protocol);
+	pr_debug("dev_name=%s target_idx=%u protocol=%u\n",
+		 dev_name(&dev->dev), target_idx, protocol);
 
 	device_lock(&dev->dev);
 
@@ -238,7 +239,8 @@ int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx)
 {
 	int rc = 0;
 
-	nfc_dbg("dev_name=%s target_idx=%u", dev_name(&dev->dev), target_idx);
+	pr_debug("dev_name=%s target_idx=%u\n",
+		 dev_name(&dev->dev), target_idx);
 
 	device_lock(&dev->dev);
 
@@ -273,8 +275,8 @@ int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx,
 {
 	int rc;
 
-	nfc_dbg("dev_name=%s target_idx=%u skb->len=%u", dev_name(&dev->dev),
-							target_idx, skb->len);
+	pr_debug("dev_name=%s target_idx=%u skb->len=%u\n",
+		 dev_name(&dev->dev), target_idx, skb->len);
 
 	device_lock(&dev->dev);
 
@@ -328,7 +330,7 @@ int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
 {
 	int i;
 
-	nfc_dbg("dev_name=%s n_targets=%d", dev_name(&dev->dev), n_targets);
+	pr_debug("dev_name=%s n_targets=%d\n", dev_name(&dev->dev), n_targets);
 
 	dev->polling = false;
 
@@ -362,7 +364,7 @@ static void nfc_release(struct device *d)
 {
 	struct nfc_dev *dev = to_nfc_dev(d);
 
-	nfc_dbg("dev_name=%s", dev_name(&dev->dev));
+	pr_debug("dev_name=%s\n", dev_name(&dev->dev));
 
 	nfc_genl_data_exit(&dev->genl_data);
 	kfree(dev->targets);
@@ -448,7 +450,7 @@ int nfc_register_device(struct nfc_dev *dev)
 {
 	int rc;
 
-	nfc_dbg("dev_name=%s", dev_name(&dev->dev));
+	pr_debug("dev_name=%s\n", dev_name(&dev->dev));
 
 	mutex_lock(&nfc_devlist_mutex);
 	nfc_devlist_generation++;
@@ -460,9 +462,8 @@ int nfc_register_device(struct nfc_dev *dev)
 
 	rc = nfc_genl_device_added(dev);
 	if (rc)
-		nfc_dbg("The userspace won't be notified that the device %s was"
-						" added", dev_name(&dev->dev));
-
+		pr_debug("The userspace won't be notified that the device %s was added\n",
+			 dev_name(&dev->dev));
 
 	return 0;
 }
@@ -477,7 +478,7 @@ void nfc_unregister_device(struct nfc_dev *dev)
 {
 	int rc;
 
-	nfc_dbg("dev_name=%s", dev_name(&dev->dev));
+	pr_debug("dev_name=%s\n", dev_name(&dev->dev));
 
 	mutex_lock(&nfc_devlist_mutex);
 	nfc_devlist_generation++;
@@ -492,8 +493,8 @@ void nfc_unregister_device(struct nfc_dev *dev)
 
 	rc = nfc_genl_device_removed(dev);
 	if (rc)
-		nfc_dbg("The userspace won't be notified that the device %s"
-					" was removed", dev_name(&dev->dev));
+		pr_debug("The userspace won't be notified that the device %s was removed\n",
+			 dev_name(&dev->dev));
 
 }
 EXPORT_SYMBOL(nfc_unregister_device);
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 30032b2..3faceb0 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -81,7 +81,7 @@ static int __nci_request(struct nci_dev *ndev,
 							&ndev->req_completion,
 							timeout);
 
-	nfc_dbg("wait_for_completion return %ld", completion_rc);
+	pr_debug("wait_for_completion return %ld\n", completion_rc);
 
 	if (completion_rc > 0) {
 		switch (ndev->req_status) {
@@ -325,7 +325,7 @@ static void nci_cmd_timer(unsigned long arg)
 {
 	struct nci_dev *ndev = (void *) arg;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	atomic_set(&ndev->cmd_cnt, 1);
 	queue_work(ndev->cmd_wq, &ndev->cmd_work);
@@ -335,7 +335,7 @@ static int nci_dev_up(struct nfc_dev *nfc_dev)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	return nci_open_device(ndev);
 }
@@ -344,7 +344,7 @@ static int nci_dev_down(struct nfc_dev *nfc_dev)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	return nci_close_device(ndev);
 }
@@ -354,7 +354,7 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 	int rc;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (test_bit(NCI_DISCOVERY, &ndev->flags)) {
 		pr_err("unable to start poll, since poll is already active\n");
@@ -367,7 +367,7 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
 	}
 
 	if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) {
-		nfc_dbg("target is active, implicitly deactivate...");
+		pr_debug("target is active, implicitly deactivate...\n");
 
 		rc = nci_request(ndev, nci_rf_deactivate_req, 0,
 			msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));
@@ -388,7 +388,7 @@ static void nci_stop_poll(struct nfc_dev *nfc_dev)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!test_bit(NCI_DISCOVERY, &ndev->flags)) {
 		pr_err("unable to stop poll, since poll is not active\n");
@@ -404,7 +404,7 @@ static int nci_activate_target(struct nfc_dev *nfc_dev, __u32 target_idx,
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	nfc_dbg("entry, target_idx %d, protocol 0x%x", target_idx, protocol);
+	pr_debug("entry, target_idx %d, protocol 0x%x\n", target_idx, protocol);
 
 	if (!test_bit(NCI_POLL_ACTIVE, &ndev->flags)) {
 		pr_err("there is no available target to activate\n");
@@ -432,7 +432,7 @@ static void nci_deactivate_target(struct nfc_dev *nfc_dev, __u32 target_idx)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	nfc_dbg("entry, target_idx %d", target_idx);
+	pr_debug("entry, target_idx %d\n", target_idx);
 
 	if (!ndev->target_active_prot) {
 		pr_err("unable to deactivate target, no active target\n");
@@ -455,7 +455,7 @@ static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx,
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 	int rc;
 
-	nfc_dbg("entry, target_idx %d, len %d", target_idx, skb->len);
+	pr_debug("entry, target_idx %d, len %d\n", target_idx, skb->len);
 
 	if (!ndev->target_active_prot) {
 		pr_err("unable to exchange data, no active target\n");
@@ -501,7 +501,7 @@ struct nci_dev *nci_allocate_device(struct nci_ops *ops,
 {
 	struct nci_dev *ndev;
 
-	nfc_dbg("entry, supported_protocols 0x%x", supported_protocols);
+	pr_debug("entry, supported_protocols 0x%x\n", supported_protocols);
 
 	if (!ops->open || !ops->close || !ops->send)
 		return NULL;
@@ -541,7 +541,7 @@ EXPORT_SYMBOL(nci_allocate_device);
  */
 void nci_free_device(struct nci_dev *ndev)
 {
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	nfc_free_device(ndev->nfc_dev);
 	kfree(ndev);
@@ -559,7 +559,7 @@ int nci_register_device(struct nci_dev *ndev)
 	struct device *dev = &ndev->nfc_dev->dev;
 	char name[32];
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	rc = nfc_register_device(ndev->nfc_dev);
 	if (rc)
@@ -623,7 +623,7 @@ EXPORT_SYMBOL(nci_register_device);
  */
 void nci_unregister_device(struct nci_dev *ndev)
 {
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	nci_close_device(ndev);
 
@@ -644,7 +644,7 @@ int nci_recv_frame(struct sk_buff *skb)
 {
 	struct nci_dev *ndev = (struct nci_dev *) skb->dev;
 
-	nfc_dbg("entry, len %d", skb->len);
+	pr_debug("entry, len %d\n", skb->len);
 
 	if (!ndev || (!test_bit(NCI_UP, &ndev->flags)
 		&& !test_bit(NCI_INIT, &ndev->flags))) {
@@ -664,7 +664,7 @@ static int nci_send_frame(struct sk_buff *skb)
 {
 	struct nci_dev *ndev = (struct nci_dev *) skb->dev;
 
-	nfc_dbg("entry, len %d", skb->len);
+	pr_debug("entry, len %d\n", skb->len);
 
 	if (!ndev) {
 		kfree_skb(skb);
@@ -683,7 +683,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload)
 	struct nci_ctrl_hdr *hdr;
 	struct sk_buff *skb;
 
-	nfc_dbg("entry, opcode 0x%x, plen %d", opcode, plen);
+	pr_debug("entry, opcode 0x%x, plen %d\n", opcode, plen);
 
 	skb = nci_skb_alloc(ndev, (NCI_CTRL_HDR_SIZE + plen), GFP_KERNEL);
 	if (!skb) {
@@ -717,7 +717,7 @@ static void nci_tx_work(struct work_struct *work)
 	struct nci_dev *ndev = container_of(work, struct nci_dev, tx_work);
 	struct sk_buff *skb;
 
-	nfc_dbg("entry, credits_cnt %d", atomic_read(&ndev->credits_cnt));
+	pr_debug("entry, credits_cnt %d\n", atomic_read(&ndev->credits_cnt));
 
 	/* Send queued tx data */
 	while (atomic_read(&ndev->credits_cnt)) {
@@ -730,10 +730,10 @@ static void nci_tx_work(struct work_struct *work)
 				NCI_DATA_FLOW_CONTROL_NOT_USED)
 			atomic_dec(&ndev->credits_cnt);
 
-		nfc_dbg("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d",
-				nci_pbf(skb->data),
-				nci_conn_id(skb->data),
-				nci_plen(skb->data));
+		pr_debug("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d\n",
+			 nci_pbf(skb->data),
+			 nci_conn_id(skb->data),
+			 nci_plen(skb->data));
 
 		nci_send_frame(skb);
 	}
@@ -776,7 +776,7 @@ static void nci_cmd_work(struct work_struct *work)
 	struct nci_dev *ndev = container_of(work, struct nci_dev, cmd_work);
 	struct sk_buff *skb;
 
-	nfc_dbg("entry, cmd_cnt %d", atomic_read(&ndev->cmd_cnt));
+	pr_debug("entry, cmd_cnt %d\n", atomic_read(&ndev->cmd_cnt));
 
 	/* Send queued command */
 	if (atomic_read(&ndev->cmd_cnt)) {
@@ -786,11 +786,11 @@ static void nci_cmd_work(struct work_struct *work)
 
 		atomic_dec(&ndev->cmd_cnt);
 
-		nfc_dbg("NCI TX: MT=cmd, PBF=%d, GID=0x%x, OID=0x%x, plen=%d",
-				nci_pbf(skb->data),
-				nci_opcode_gid(nci_opcode(skb->data)),
-				nci_opcode_oid(nci_opcode(skb->data)),
-				nci_plen(skb->data));
+		pr_debug("NCI TX: MT=cmd, PBF=%d, GID=0x%x, OID=0x%x, plen=%d\n",
+			 nci_pbf(skb->data),
+			 nci_opcode_gid(nci_opcode(skb->data)),
+			 nci_opcode_oid(nci_opcode(skb->data)),
+			 nci_plen(skb->data));
 
 		nci_send_frame(skb);
 
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 7d8a125..3c5db09 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -42,7 +42,7 @@ void nci_data_exchange_complete(struct nci_dev *ndev,
 	data_exchange_cb_t cb = ndev->data_exchange_cb;
 	void *cb_context = ndev->data_exchange_cb_context;
 
-	nfc_dbg("entry, len %d, err %d", ((skb) ? (skb->len) : (0)), err);
+	pr_debug("entry, len %d, err %d\n", skb ? skb->len : 0, err);
 
 	if (cb) {
 		ndev->data_exchange_cb = NULL;
@@ -92,7 +92,7 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
 	int frag_len;
 	int rc = 0;
 
-	nfc_dbg("entry, conn_id 0x%x, total_len %d", conn_id, total_len);
+	pr_debug("entry, conn_id 0x%x, total_len %d\n", conn_id, total_len);
 
 	__skb_queue_head_init(&frags_q);
 
@@ -121,8 +121,8 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
 		data += frag_len;
 		total_len -= frag_len;
 
-		nfc_dbg("frag_len %d, remaining total_len %d",
-			frag_len, total_len);
+		pr_debug("frag_len %d, remaining total_len %d\n",
+			 frag_len, total_len);
 	}
 
 	/* queue all fragments atomically */
@@ -151,7 +151,7 @@ int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb)
 {
 	int rc = 0;
 
-	nfc_dbg("entry, conn_id 0x%x, plen %d", conn_id, skb->len);
+	pr_debug("entry, conn_id 0x%x, plen %d\n", conn_id, skb->len);
 
 	/* check if the packet need to be fragmented */
 	if (skb->len <= ndev->max_data_pkt_payload_size) {
@@ -230,19 +230,19 @@ void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	__u8 pbf = nci_pbf(skb->data);
 
-	nfc_dbg("entry, len %d", skb->len);
+	pr_debug("entry, len %d\n", skb->len);
 
-	nfc_dbg("NCI RX: MT=data, PBF=%d, conn_id=%d, plen=%d",
-			nci_pbf(skb->data),
-			nci_conn_id(skb->data),
-			nci_plen(skb->data));
+	pr_debug("NCI RX: MT=data, PBF=%d, conn_id=%d, plen=%d\n",
+		 nci_pbf(skb->data),
+		 nci_conn_id(skb->data),
+		 nci_plen(skb->data));
 
 	/* strip the nci data header */
 	skb_pull(skb, NCI_DATA_HDR_SIZE);
 
 	if (ndev->target_active_prot == NFC_PROTO_MIFARE) {
 		/* frame I/F => remove the status byte */
-		nfc_dbg("NFC_PROTO_MIFARE => remove the status byte");
+		pr_debug("NFC_PROTO_MIFARE => remove the status byte\n");
 		skb_trim(skb, (skb->len - 1));
 	}
 
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index c704350..f26edc0 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -45,16 +45,16 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
 	struct nci_core_conn_credit_ntf *ntf = (void *) skb->data;
 	int i;
 
-	nfc_dbg("entry, num_entries %d", ntf->num_entries);
+	pr_debug("entry, num_entries %d\n", ntf->num_entries);
 
 	if (ntf->num_entries > NCI_MAX_NUM_CONN)
 		ntf->num_entries = NCI_MAX_NUM_CONN;
 
 	/* update the credits */
 	for (i = 0; i < ntf->num_entries; i++) {
-		nfc_dbg("entry[%d]: conn_id %d, credits %d", i,
-			ntf->conn_entries[i].conn_id,
-			ntf->conn_entries[i].credits);
+		pr_debug("entry[%d]: conn_id %d, credits %d\n",
+			 i, ntf->conn_entries[i].conn_id,
+			 ntf->conn_entries[i].credits);
 
 		if (ntf->conn_entries[i].conn_id == NCI_STATIC_RF_CONN_ID) {
 			/* found static rf connection */
@@ -80,9 +80,8 @@ static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
 
 	nfca_poll->nfcid1_len = *data++;
 
-	nfc_dbg("sens_res 0x%x, nfcid1_len %d",
-		nfca_poll->sens_res,
-		nfca_poll->nfcid1_len);
+	pr_debug("sens_res 0x%x, nfcid1_len %d\n",
+		 nfca_poll->sens_res, nfca_poll->nfcid1_len);
 
 	memcpy(nfca_poll->nfcid1, data, nfca_poll->nfcid1_len);
 	data += nfca_poll->nfcid1_len;
@@ -92,9 +91,9 @@ static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
 	if (nfca_poll->sel_res_len != 0)
 		nfca_poll->sel_res = *data++;
 
-	nfc_dbg("sel_res_len %d, sel_res 0x%x",
-		nfca_poll->sel_res_len,
-		nfca_poll->sel_res);
+	pr_debug("sel_res_len %d, sel_res 0x%x\n",
+		 nfca_poll->sel_res_len,
+		 nfca_poll->sel_res);
 
 	return data;
 }
@@ -140,12 +139,12 @@ static void nci_target_found(struct nci_dev *ndev,
 	nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res;
 
 	if (!(nfc_tgt.supported_protocols & ndev->poll_prots)) {
-		nfc_dbg("the target found does not have the desired protocol");
+		pr_debug("the target found does not have the desired protocol\n");
 		return;
 	}
 
-	nfc_dbg("new target found,  supported_protocols 0x%x",
-		nfc_tgt.supported_protocols);
+	pr_debug("new target found,  supported_protocols 0x%x\n",
+		 nfc_tgt.supported_protocols);
 
 	ndev->target_available_prots = nfc_tgt.supported_protocols;
 
@@ -168,13 +167,13 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
 	ntf.activation_rf_tech_and_mode = *data++;
 	ntf.rf_tech_specific_params_len = *data++;
 
-	nfc_dbg("rf_discovery_id %d", ntf.rf_discovery_id);
-	nfc_dbg("rf_interface_type 0x%x", ntf.rf_interface_type);
-	nfc_dbg("rf_protocol 0x%x", ntf.rf_protocol);
-	nfc_dbg("activation_rf_tech_and_mode 0x%x",
-		ntf.activation_rf_tech_and_mode);
-	nfc_dbg("rf_tech_specific_params_len %d",
-		ntf.rf_tech_specific_params_len);
+	pr_debug("rf_discovery_id %d\n", ntf.rf_discovery_id);
+	pr_debug("rf_interface_type 0x%x\n", ntf.rf_interface_type);
+	pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol);
+	pr_debug("activation_rf_tech_and_mode 0x%x\n",
+		 ntf.activation_rf_tech_and_mode);
+	pr_debug("rf_tech_specific_params_len %d\n",
+		 ntf.rf_tech_specific_params_len);
 
 	if (ntf.rf_tech_specific_params_len > 0) {
 		switch (ntf.activation_rf_tech_and_mode) {
@@ -195,14 +194,14 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
 	ntf.data_exch_rx_bit_rate = *data++;
 	ntf.activation_params_len = *data++;
 
-	nfc_dbg("data_exch_rf_tech_and_mode 0x%x",
-		ntf.data_exch_rf_tech_and_mode);
-	nfc_dbg("data_exch_tx_bit_rate 0x%x",
-		ntf.data_exch_tx_bit_rate);
-	nfc_dbg("data_exch_rx_bit_rate 0x%x",
-		ntf.data_exch_rx_bit_rate);
-	nfc_dbg("activation_params_len %d",
-		ntf.activation_params_len);
+	pr_debug("data_exch_rf_tech_and_mode 0x%x\n",
+		 ntf.data_exch_rf_tech_and_mode);
+	pr_debug("data_exch_tx_bit_rate 0x%x\n",
+		 ntf.data_exch_tx_bit_rate);
+	pr_debug("data_exch_rx_bit_rate 0x%x\n",
+		 ntf.data_exch_rx_bit_rate);
+	pr_debug("activation_params_len %d\n",
+		 ntf.activation_params_len);
 
 	if (ntf.activation_params_len > 0) {
 		switch (ntf.rf_interface_type) {
@@ -231,7 +230,7 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
 {
 	struct nci_rf_deactivate_ntf *ntf = (void *) skb->data;
 
-	nfc_dbg("entry, type 0x%x, reason 0x%x", ntf->type, ntf->reason);
+	pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason);
 
 	clear_bit(NCI_POLL_ACTIVE, &ndev->flags);
 	ndev->target_active_prot = 0;
@@ -257,11 +256,11 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	__u16 ntf_opcode = nci_opcode(skb->data);
 
-	nfc_dbg("NCI RX: MT=ntf, PBF=%d, GID=0x%x, OID=0x%x, plen=%d",
-			nci_pbf(skb->data),
-			nci_opcode_gid(ntf_opcode),
-			nci_opcode_oid(ntf_opcode),
-			nci_plen(skb->data));
+	pr_debug("NCI RX: MT=ntf, PBF=%d, GID=0x%x, OID=0x%x, plen=%d\n",
+		 nci_pbf(skb->data),
+		 nci_opcode_gid(ntf_opcode),
+		 nci_opcode_oid(ntf_opcode),
+		 nci_plen(skb->data));
 
 	/* strip the nci control header */
 	skb_pull(skb, NCI_CTRL_HDR_SIZE);
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index 6f51a28..f00c2ab 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -42,12 +42,12 @@ static void nci_core_reset_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	struct nci_core_reset_rsp *rsp = (void *) skb->data;
 
-	nfc_dbg("entry, status 0x%x", rsp->status);
+	pr_debug("entry, status 0x%x\n", rsp->status);
 
 	if (rsp->status == NCI_STATUS_OK) {
 		ndev->nci_ver = rsp->nci_ver;
-		nfc_dbg("nci_ver 0x%x, config_status 0x%x",
-			rsp->nci_ver, rsp->config_status);
+		pr_debug("nci_ver 0x%x, config_status 0x%x\n",
+			 rsp->nci_ver, rsp->config_status);
 	}
 
 	nci_req_complete(ndev, rsp->status);
@@ -58,7 +58,7 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 	struct nci_core_init_rsp_1 *rsp_1 = (void *) skb->data;
 	struct nci_core_init_rsp_2 *rsp_2;
 
-	nfc_dbg("entry, status 0x%x", rsp_1->status);
+	pr_debug("entry, status 0x%x\n", rsp_1->status);
 
 	if (rsp_1->status != NCI_STATUS_OK)
 		goto exit;
@@ -97,34 +97,34 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 
 	atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
 
-	nfc_dbg("nfcc_features 0x%x",
-		ndev->nfcc_features);
-	nfc_dbg("num_supported_rf_interfaces %d",
-		ndev->num_supported_rf_interfaces);
-	nfc_dbg("supported_rf_interfaces[0] 0x%x",
-		ndev->supported_rf_interfaces[0]);
-	nfc_dbg("supported_rf_interfaces[1] 0x%x",
-		ndev->supported_rf_interfaces[1]);
-	nfc_dbg("supported_rf_interfaces[2] 0x%x",
-		ndev->supported_rf_interfaces[2]);
-	nfc_dbg("supported_rf_interfaces[3] 0x%x",
-		ndev->supported_rf_interfaces[3]);
-	nfc_dbg("max_logical_connections %d",
-		ndev->max_logical_connections);
-	nfc_dbg("max_routing_table_size %d",
-		ndev->max_routing_table_size);
-	nfc_dbg("max_ctrl_pkt_payload_len %d",
-		ndev->max_ctrl_pkt_payload_len);
-	nfc_dbg("max_size_for_large_params %d",
-		ndev->max_size_for_large_params);
-	nfc_dbg("max_data_pkt_payload_size %d",
-		ndev->max_data_pkt_payload_size);
-	nfc_dbg("initial_num_credits %d",
-		ndev->initial_num_credits);
-	nfc_dbg("manufact_id 0x%x",
-		ndev->manufact_id);
-	nfc_dbg("manufact_specific_info 0x%x",
-		ndev->manufact_specific_info);
+	pr_debug("nfcc_features 0x%x\n",
+		 ndev->nfcc_features);
+	pr_debug("num_supported_rf_interfaces %d\n",
+		 ndev->num_supported_rf_interfaces);
+	pr_debug("supported_rf_interfaces[0] 0x%x\n",
+		 ndev->supported_rf_interfaces[0]);
+	pr_debug("supported_rf_interfaces[1] 0x%x\n",
+		 ndev->supported_rf_interfaces[1]);
+	pr_debug("supported_rf_interfaces[2] 0x%x\n",
+		 ndev->supported_rf_interfaces[2]);
+	pr_debug("supported_rf_interfaces[3] 0x%x\n",
+		 ndev->supported_rf_interfaces[3]);
+	pr_debug("max_logical_connections %d\n",
+		 ndev->max_logical_connections);
+	pr_debug("max_routing_table_size %d\n",
+		 ndev->max_routing_table_size);
+	pr_debug("max_ctrl_pkt_payload_len %d\n",
+		 ndev->max_ctrl_pkt_payload_len);
+	pr_debug("max_size_for_large_params %d\n",
+		 ndev->max_size_for_large_params);
+	pr_debug("max_data_pkt_payload_size %d\n",
+		 ndev->max_data_pkt_payload_size);
+	pr_debug("initial_num_credits %d\n",
+		 ndev->initial_num_credits);
+	pr_debug("manufact_id 0x%x\n",
+		 ndev->manufact_id);
+	pr_debug("manufact_specific_info 0x%x\n",
+		 ndev->manufact_specific_info);
 
 exit:
 	nci_req_complete(ndev, rsp_1->status);
@@ -135,7 +135,7 @@ static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev,
 {
 	__u8 status = skb->data[0];
 
-	nfc_dbg("entry, status 0x%x", status);
+	pr_debug("entry, status 0x%x\n", status);
 
 	nci_req_complete(ndev, status);
 }
@@ -144,7 +144,7 @@ static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	__u8 status = skb->data[0];
 
-	nfc_dbg("entry, status 0x%x", status);
+	pr_debug("entry, status 0x%x\n", status);
 
 	if (status == NCI_STATUS_OK)
 		set_bit(NCI_DISCOVERY, &ndev->flags);
@@ -157,7 +157,7 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev,
 {
 	__u8 status = skb->data[0];
 
-	nfc_dbg("entry, status 0x%x", status);
+	pr_debug("entry, status 0x%x\n", status);
 
 	clear_bit(NCI_DISCOVERY, &ndev->flags);
 
@@ -171,11 +171,11 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 	/* we got a rsp, stop the cmd timer */
 	del_timer(&ndev->cmd_timer);
 
-	nfc_dbg("NCI RX: MT=rsp, PBF=%d, GID=0x%x, OID=0x%x, plen=%d",
-			nci_pbf(skb->data),
-			nci_opcode_gid(rsp_opcode),
-			nci_opcode_oid(rsp_opcode),
-			nci_plen(skb->data));
+	pr_debug("NCI RX: MT=rsp, PBF=%d, GID=0x%x, OID=0x%x, plen=%d\n",
+		 nci_pbf(skb->data),
+		 nci_opcode_gid(rsp_opcode),
+		 nci_opcode_oid(rsp_opcode),
+		 nci_plen(skb->data));
 
 	/* strip the nci control header */
 	skb_pull(skb, NCI_CTRL_HDR_SIZE);
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 03f8818..5aef1a5 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -21,6 +21,8 @@
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <net/genetlink.h>
 #include <linux/nfc.h>
 #include <linux/slab.h>
@@ -51,7 +53,7 @@ static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target,
 {
 	void *hdr;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq,
 				&nfc_genl_family, flags, NFC_CMD_GET_TARGET);
@@ -105,7 +107,7 @@ static int nfc_genl_dump_targets(struct sk_buff *skb,
 	struct nfc_dev *dev = (struct nfc_dev *) cb->args[1];
 	int rc;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!dev) {
 		dev = __get_device_from_cb(cb);
@@ -139,7 +141,7 @@ static int nfc_genl_dump_targets_done(struct netlink_callback *cb)
 {
 	struct nfc_dev *dev = (struct nfc_dev *) cb->args[1];
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (dev)
 		nfc_put_device(dev);
@@ -152,7 +154,7 @@ int nfc_genl_targets_found(struct nfc_dev *dev)
 	struct sk_buff *msg;
 	void *hdr;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	dev->genl_data.poll_req_pid = 0;
 
@@ -183,7 +185,7 @@ int nfc_genl_device_added(struct nfc_dev *dev)
 	struct sk_buff *msg;
 	void *hdr;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!msg)
@@ -216,7 +218,7 @@ int nfc_genl_device_removed(struct nfc_dev *dev)
 	struct sk_buff *msg;
 	void *hdr;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!msg)
@@ -249,7 +251,7 @@ static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev,
 {
 	void *hdr;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	hdr = genlmsg_put(msg, pid, seq, &nfc_genl_family, flags,
 							NFC_CMD_GET_DEVICE);
@@ -277,7 +279,7 @@ static int nfc_genl_dump_devices(struct sk_buff *skb,
 	struct nfc_dev *dev = (struct nfc_dev *) cb->args[1];
 	bool first_call = false;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!iter) {
 		first_call = true;
@@ -319,7 +321,7 @@ static int nfc_genl_dump_devices_done(struct netlink_callback *cb)
 {
 	struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0];
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	nfc_device_iter_exit(iter);
 	kfree(iter);
@@ -334,7 +336,7 @@ static int nfc_genl_get_device(struct sk_buff *skb, struct genl_info *info)
 	u32 idx;
 	int rc = -ENOBUFS;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
@@ -373,7 +375,7 @@ static int nfc_genl_dev_up(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
@@ -396,7 +398,7 @@ static int nfc_genl_dev_down(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
@@ -420,7 +422,7 @@ static int nfc_genl_start_poll(struct sk_buff *skb, struct genl_info *info)
 	u32 idx;
 	u32 protocols;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
 		!info->attrs[NFC_ATTR_PROTOCOLS])
@@ -451,7 +453,7 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	nfc_dbg("entry");
+	pr_debug("entry\n");
 
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
@@ -524,7 +526,7 @@ static int nfc_genl_rcv_nl_event(struct notifier_block *this,
 	if (event != NETLINK_URELEASE || n->protocol != NETLINK_GENERIC)
 		goto out;
 
-	nfc_dbg("NETLINK_URELEASE event from id %d", n->pid);
+	pr_debug("NETLINK_URELEASE event from id %d\n", n->pid);
 
 	nfc_device_iter_init(&iter);
 	dev = nfc_device_iter_next(&iter);
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index feb235b..68ecf3f 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -31,7 +31,7 @@
 
 static void rawsock_write_queue_purge(struct sock *sk)
 {
-	nfc_dbg("sk=%p", sk);
+	pr_debug("sk=%p\n", sk);
 
 	spin_lock_bh(&sk->sk_write_queue.lock);
 	__skb_queue_purge(&sk->sk_write_queue);
@@ -41,7 +41,7 @@ static void rawsock_write_queue_purge(struct sock *sk)
 
 static void rawsock_report_error(struct sock *sk, int err)
 {
-	nfc_dbg("sk=%p err=%d", sk, err);
+	pr_debug("sk=%p err=%d\n", sk, err);
 
 	sk->sk_shutdown = SHUTDOWN_MASK;
 	sk->sk_err = -err;
@@ -54,7 +54,7 @@ static int rawsock_release(struct socket *sock)
 {
 	struct sock *sk = sock->sk;
 
-	nfc_dbg("sock=%p", sock);
+	pr_debug("sock=%p\n", sock);
 
 	sock_orphan(sk);
 	sock_put(sk);
@@ -70,14 +70,14 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr,
 	struct nfc_dev *dev;
 	int rc = 0;
 
-	nfc_dbg("sock=%p sk=%p flags=%d", sock, sk, flags);
+	pr_debug("sock=%p sk=%p flags=%d\n", sock, sk, flags);
 
 	if (!addr || len < sizeof(struct sockaddr_nfc) ||
 		addr->sa_family != AF_NFC)
 		return -EINVAL;
 
-	nfc_dbg("addr dev_idx=%u target_idx=%u protocol=%u", addr->dev_idx,
-					addr->target_idx, addr->nfc_protocol);
+	pr_debug("addr dev_idx=%u target_idx=%u protocol=%u\n",
+		 addr->dev_idx, addr->target_idx, addr->nfc_protocol);
 
 	lock_sock(sk);
 
@@ -138,7 +138,7 @@ static void rawsock_data_exchange_complete(void *context, struct sk_buff *skb,
 
 	BUG_ON(in_irq());
 
-	nfc_dbg("sk=%p err=%d", sk, err);
+	pr_debug("sk=%p err=%d\n", sk, err);
 
 	if (err)
 		goto error;
@@ -174,7 +174,7 @@ static void rawsock_tx_work(struct work_struct *work)
 	struct sk_buff *skb;
 	int rc;
 
-	nfc_dbg("sk=%p target_idx=%u", sk, target_idx);
+	pr_debug("sk=%p target_idx=%u\n", sk, target_idx);
 
 	if (sk->sk_shutdown & SEND_SHUTDOWN) {
 		rawsock_write_queue_purge(sk);
@@ -200,7 +200,7 @@ static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock,
 	struct sk_buff *skb;
 	int rc;
 
-	nfc_dbg("sock=%p sk=%p len=%zu", sock, sk, len);
+	pr_debug("sock=%p sk=%p len=%zu\n", sock, sk, len);
 
 	if (msg->msg_namelen)
 		return -EOPNOTSUPP;
@@ -241,7 +241,7 @@ static int rawsock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	int copied;
 	int rc;
 
-	nfc_dbg("sock=%p sk=%p len=%zu flags=%d", sock, sk, len, flags);
+	pr_debug("sock=%p sk=%p len=%zu flags=%d\n", sock, sk, len, flags);
 
 	skb = skb_recv_datagram(sk, flags, noblock, &rc);
 	if (!skb)
@@ -285,7 +285,7 @@ static const struct proto_ops rawsock_ops = {
 
 static void rawsock_destruct(struct sock *sk)
 {
-	nfc_dbg("sk=%p", sk);
+	pr_debug("sk=%p\n", sk);
 
 	if (sk->sk_state == TCP_ESTABLISHED) {
 		nfc_deactivate_target(nfc_rawsock(sk)->dev,
@@ -306,7 +306,7 @@ static int rawsock_create(struct net *net, struct socket *sock,
 {
 	struct sock *sk;
 
-	nfc_dbg("sock=%p", sock);
+	pr_debug("sock=%p\n", sock);
 
 	if (sock->type != SOCK_SEQPACKET)
 		return -ESOCKTNOSUPPORT;
-- 
1.7.6.405.gc1be0

^ permalink raw reply related

* [PATCH 3/4] nfc: Remove unused nfc_printk and nfc_<level> macros
From: Joe Perches @ 2011-11-29 19:37 UTC (permalink / raw)
  To: Lauro Ramos Venancio, Aloisio Almeida Jr, Samuel Ortiz
  Cc: David S. Miller, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1322595343.git.joe@perches.com>

All uses have been removed, so killing what's not necessary.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/nfc/core.c |   19 -------------------
 net/nfc/nfc.h  |    7 -------
 2 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/net/nfc/core.c b/net/nfc/core.c
index c922adb..3ebc6b3aa 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -35,25 +35,6 @@
 int nfc_devlist_generation;
 DEFINE_MUTEX(nfc_devlist_mutex);
 
-int nfc_printk(const char *level, const char *format, ...)
-{
-	struct va_format vaf;
-	va_list args;
-	int r;
-
-	va_start(args, format);
-
-	vaf.fmt = format;
-	vaf.va = &args;
-
-	r = printk("%sNFC: %pV\n", level, &vaf);
-
-	va_end(args);
-
-	return r;
-}
-EXPORT_SYMBOL(nfc_printk);
-
 /**
  * nfc_dev_up - turn on the NFC device
  *
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h
index d86583f..67d6050 100644
--- a/net/nfc/nfc.h
+++ b/net/nfc/nfc.h
@@ -27,13 +27,6 @@
 #include <net/nfc/nfc.h>
 #include <net/sock.h>
 
-__printf(2, 3)
-int nfc_printk(const char *level, const char *fmt, ...);
-
-#define nfc_info(fmt, arg...) nfc_printk(KERN_INFO, fmt, ##arg)
-#define nfc_err(fmt, arg...) nfc_printk(KERN_ERR, fmt, ##arg)
-#define nfc_dbg(fmt, arg...) pr_debug(fmt "\n", ##arg)
-
 struct nfc_protocol {
 	int id;
 	struct proto *proto;
-- 
1.7.6.405.gc1be0

^ permalink raw reply related

* [PATCH 4/4] nfc: Remove function tracer like entry messages
From: Joe Perches @ 2011-11-29 19:37 UTC (permalink / raw)
  To: Lauro Ramos Venancio, Aloisio Almeida Jr, Samuel Ortiz
  Cc: David S. Miller, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1322595343.git.joe@perches.com>

Logging messages that mimic function tracer enter/exit
aren't necessary.  Just remove them.

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/nfc/nci/core.c |   34 +++++++++-------------------------
 net/nfc/nci/data.c |    8 ++++----
 net/nfc/nci/ntf.c  |    2 +-
 net/nfc/nci/rsp.c  |   10 +++++-----
 net/nfc/netlink.c  |   28 ----------------------------
 5 files changed, 19 insertions(+), 63 deletions(-)

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 3faceb0..37de28e 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -325,8 +325,6 @@ static void nci_cmd_timer(unsigned long arg)
 {
 	struct nci_dev *ndev = (void *) arg;
 
-	pr_debug("entry\n");
-
 	atomic_set(&ndev->cmd_cnt, 1);
 	queue_work(ndev->cmd_wq, &ndev->cmd_work);
 }
@@ -335,8 +333,6 @@ static int nci_dev_up(struct nfc_dev *nfc_dev)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	pr_debug("entry\n");
-
 	return nci_open_device(ndev);
 }
 
@@ -344,8 +340,6 @@ static int nci_dev_down(struct nfc_dev *nfc_dev)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	pr_debug("entry\n");
-
 	return nci_close_device(ndev);
 }
 
@@ -354,8 +348,6 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 	int rc;
 
-	pr_debug("entry\n");
-
 	if (test_bit(NCI_DISCOVERY, &ndev->flags)) {
 		pr_err("unable to start poll, since poll is already active\n");
 		return -EBUSY;
@@ -388,8 +380,6 @@ static void nci_stop_poll(struct nfc_dev *nfc_dev)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	pr_debug("entry\n");
-
 	if (!test_bit(NCI_DISCOVERY, &ndev->flags)) {
 		pr_err("unable to stop poll, since poll is not active\n");
 		return;
@@ -404,7 +394,7 @@ static int nci_activate_target(struct nfc_dev *nfc_dev, __u32 target_idx,
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	pr_debug("entry, target_idx %d, protocol 0x%x\n", target_idx, protocol);
+	pr_debug("target_idx %d, protocol 0x%x\n", target_idx, protocol);
 
 	if (!test_bit(NCI_POLL_ACTIVE, &ndev->flags)) {
 		pr_err("there is no available target to activate\n");
@@ -432,7 +422,7 @@ static void nci_deactivate_target(struct nfc_dev *nfc_dev, __u32 target_idx)
 {
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 
-	pr_debug("entry, target_idx %d\n", target_idx);
+	pr_debug("target_idx %d\n", target_idx);
 
 	if (!ndev->target_active_prot) {
 		pr_err("unable to deactivate target, no active target\n");
@@ -455,7 +445,7 @@ static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx,
 	struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
 	int rc;
 
-	pr_debug("entry, target_idx %d, len %d\n", target_idx, skb->len);
+	pr_debug("target_idx %d, len %d\n", target_idx, skb->len);
 
 	if (!ndev->target_active_prot) {
 		pr_err("unable to exchange data, no active target\n");
@@ -501,7 +491,7 @@ struct nci_dev *nci_allocate_device(struct nci_ops *ops,
 {
 	struct nci_dev *ndev;
 
-	pr_debug("entry, supported_protocols 0x%x\n", supported_protocols);
+	pr_debug("supported_protocols 0x%x\n", supported_protocols);
 
 	if (!ops->open || !ops->close || !ops->send)
 		return NULL;
@@ -541,8 +531,6 @@ EXPORT_SYMBOL(nci_allocate_device);
  */
 void nci_free_device(struct nci_dev *ndev)
 {
-	pr_debug("entry\n");
-
 	nfc_free_device(ndev->nfc_dev);
 	kfree(ndev);
 }
@@ -559,8 +547,6 @@ int nci_register_device(struct nci_dev *ndev)
 	struct device *dev = &ndev->nfc_dev->dev;
 	char name[32];
 
-	pr_debug("entry\n");
-
 	rc = nfc_register_device(ndev->nfc_dev);
 	if (rc)
 		goto exit;
@@ -623,8 +609,6 @@ EXPORT_SYMBOL(nci_register_device);
  */
 void nci_unregister_device(struct nci_dev *ndev)
 {
-	pr_debug("entry\n");
-
 	nci_close_device(ndev);
 
 	destroy_workqueue(ndev->cmd_wq);
@@ -644,7 +628,7 @@ int nci_recv_frame(struct sk_buff *skb)
 {
 	struct nci_dev *ndev = (struct nci_dev *) skb->dev;
 
-	pr_debug("entry, len %d\n", skb->len);
+	pr_debug("len %d\n", skb->len);
 
 	if (!ndev || (!test_bit(NCI_UP, &ndev->flags)
 		&& !test_bit(NCI_INIT, &ndev->flags))) {
@@ -664,7 +648,7 @@ static int nci_send_frame(struct sk_buff *skb)
 {
 	struct nci_dev *ndev = (struct nci_dev *) skb->dev;
 
-	pr_debug("entry, len %d\n", skb->len);
+	pr_debug("len %d\n", skb->len);
 
 	if (!ndev) {
 		kfree_skb(skb);
@@ -683,7 +667,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload)
 	struct nci_ctrl_hdr *hdr;
 	struct sk_buff *skb;
 
-	pr_debug("entry, opcode 0x%x, plen %d\n", opcode, plen);
+	pr_debug("opcode 0x%x, plen %d\n", opcode, plen);
 
 	skb = nci_skb_alloc(ndev, (NCI_CTRL_HDR_SIZE + plen), GFP_KERNEL);
 	if (!skb) {
@@ -717,7 +701,7 @@ static void nci_tx_work(struct work_struct *work)
 	struct nci_dev *ndev = container_of(work, struct nci_dev, tx_work);
 	struct sk_buff *skb;
 
-	pr_debug("entry, credits_cnt %d\n", atomic_read(&ndev->credits_cnt));
+	pr_debug("credits_cnt %d\n", atomic_read(&ndev->credits_cnt));
 
 	/* Send queued tx data */
 	while (atomic_read(&ndev->credits_cnt)) {
@@ -776,7 +760,7 @@ static void nci_cmd_work(struct work_struct *work)
 	struct nci_dev *ndev = container_of(work, struct nci_dev, cmd_work);
 	struct sk_buff *skb;
 
-	pr_debug("entry, cmd_cnt %d\n", atomic_read(&ndev->cmd_cnt));
+	pr_debug("cmd_cnt %d\n", atomic_read(&ndev->cmd_cnt));
 
 	/* Send queued command */
 	if (atomic_read(&ndev->cmd_cnt)) {
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 3c5db09..1e040fe 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -42,7 +42,7 @@ void nci_data_exchange_complete(struct nci_dev *ndev,
 	data_exchange_cb_t cb = ndev->data_exchange_cb;
 	void *cb_context = ndev->data_exchange_cb_context;
 
-	pr_debug("entry, len %d, err %d\n", skb ? skb->len : 0, err);
+	pr_debug("len %d, err %d\n", skb ? skb->len : 0, err);
 
 	if (cb) {
 		ndev->data_exchange_cb = NULL;
@@ -92,7 +92,7 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
 	int frag_len;
 	int rc = 0;
 
-	pr_debug("entry, conn_id 0x%x, total_len %d\n", conn_id, total_len);
+	pr_debug("conn_id 0x%x, total_len %d\n", conn_id, total_len);
 
 	__skb_queue_head_init(&frags_q);
 
@@ -151,7 +151,7 @@ int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb)
 {
 	int rc = 0;
 
-	pr_debug("entry, conn_id 0x%x, plen %d\n", conn_id, skb->len);
+	pr_debug("conn_id 0x%x, plen %d\n", conn_id, skb->len);
 
 	/* check if the packet need to be fragmented */
 	if (skb->len <= ndev->max_data_pkt_payload_size) {
@@ -230,7 +230,7 @@ void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	__u8 pbf = nci_pbf(skb->data);
 
-	pr_debug("entry, len %d\n", skb->len);
+	pr_debug("len %d\n", skb->len);
 
 	pr_debug("NCI RX: MT=data, PBF=%d, conn_id=%d, plen=%d\n",
 		 nci_pbf(skb->data),
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index f26edc0..c36bd4a0 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -45,7 +45,7 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
 	struct nci_core_conn_credit_ntf *ntf = (void *) skb->data;
 	int i;
 
-	pr_debug("entry, num_entries %d\n", ntf->num_entries);
+	pr_debug("num_entries %d\n", ntf->num_entries);
 
 	if (ntf->num_entries > NCI_MAX_NUM_CONN)
 		ntf->num_entries = NCI_MAX_NUM_CONN;
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index f00c2ab..ca611c5 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -42,7 +42,7 @@ static void nci_core_reset_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	struct nci_core_reset_rsp *rsp = (void *) skb->data;
 
-	pr_debug("entry, status 0x%x\n", rsp->status);
+	pr_debug("status 0x%x\n", rsp->status);
 
 	if (rsp->status == NCI_STATUS_OK) {
 		ndev->nci_ver = rsp->nci_ver;
@@ -58,7 +58,7 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 	struct nci_core_init_rsp_1 *rsp_1 = (void *) skb->data;
 	struct nci_core_init_rsp_2 *rsp_2;
 
-	pr_debug("entry, status 0x%x\n", rsp_1->status);
+	pr_debug("status 0x%x\n", rsp_1->status);
 
 	if (rsp_1->status != NCI_STATUS_OK)
 		goto exit;
@@ -135,7 +135,7 @@ static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev,
 {
 	__u8 status = skb->data[0];
 
-	pr_debug("entry, status 0x%x\n", status);
+	pr_debug("status 0x%x\n", status);
 
 	nci_req_complete(ndev, status);
 }
@@ -144,7 +144,7 @@ static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	__u8 status = skb->data[0];
 
-	pr_debug("entry, status 0x%x\n", status);
+	pr_debug("status 0x%x\n", status);
 
 	if (status == NCI_STATUS_OK)
 		set_bit(NCI_DISCOVERY, &ndev->flags);
@@ -157,7 +157,7 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev,
 {
 	__u8 status = skb->data[0];
 
-	pr_debug("entry, status 0x%x\n", status);
+	pr_debug("status 0x%x\n", status);
 
 	clear_bit(NCI_DISCOVERY, &ndev->flags);
 
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 5aef1a5..c10e9b8 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -53,8 +53,6 @@ static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target,
 {
 	void *hdr;
 
-	pr_debug("entry\n");
-
 	hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq,
 				&nfc_genl_family, flags, NFC_CMD_GET_TARGET);
 	if (!hdr)
@@ -107,8 +105,6 @@ static int nfc_genl_dump_targets(struct sk_buff *skb,
 	struct nfc_dev *dev = (struct nfc_dev *) cb->args[1];
 	int rc;
 
-	pr_debug("entry\n");
-
 	if (!dev) {
 		dev = __get_device_from_cb(cb);
 		if (IS_ERR(dev))
@@ -141,8 +137,6 @@ static int nfc_genl_dump_targets_done(struct netlink_callback *cb)
 {
 	struct nfc_dev *dev = (struct nfc_dev *) cb->args[1];
 
-	pr_debug("entry\n");
-
 	if (dev)
 		nfc_put_device(dev);
 
@@ -154,8 +148,6 @@ int nfc_genl_targets_found(struct nfc_dev *dev)
 	struct sk_buff *msg;
 	void *hdr;
 
-	pr_debug("entry\n");
-
 	dev->genl_data.poll_req_pid = 0;
 
 	msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
@@ -185,8 +177,6 @@ int nfc_genl_device_added(struct nfc_dev *dev)
 	struct sk_buff *msg;
 	void *hdr;
 
-	pr_debug("entry\n");
-
 	msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!msg)
 		return -ENOMEM;
@@ -218,8 +208,6 @@ int nfc_genl_device_removed(struct nfc_dev *dev)
 	struct sk_buff *msg;
 	void *hdr;
 
-	pr_debug("entry\n");
-
 	msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
 	if (!msg)
 		return -ENOMEM;
@@ -251,8 +239,6 @@ static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev,
 {
 	void *hdr;
 
-	pr_debug("entry\n");
-
 	hdr = genlmsg_put(msg, pid, seq, &nfc_genl_family, flags,
 							NFC_CMD_GET_DEVICE);
 	if (!hdr)
@@ -279,8 +265,6 @@ static int nfc_genl_dump_devices(struct sk_buff *skb,
 	struct nfc_dev *dev = (struct nfc_dev *) cb->args[1];
 	bool first_call = false;
 
-	pr_debug("entry\n");
-
 	if (!iter) {
 		first_call = true;
 		iter = kmalloc(sizeof(struct class_dev_iter), GFP_KERNEL);
@@ -321,8 +305,6 @@ static int nfc_genl_dump_devices_done(struct netlink_callback *cb)
 {
 	struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0];
 
-	pr_debug("entry\n");
-
 	nfc_device_iter_exit(iter);
 	kfree(iter);
 
@@ -336,8 +318,6 @@ static int nfc_genl_get_device(struct sk_buff *skb, struct genl_info *info)
 	u32 idx;
 	int rc = -ENOBUFS;
 
-	pr_debug("entry\n");
-
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
 
@@ -375,8 +355,6 @@ static int nfc_genl_dev_up(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	pr_debug("entry\n");
-
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
 
@@ -398,8 +376,6 @@ static int nfc_genl_dev_down(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	pr_debug("entry\n");
-
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
 
@@ -422,8 +398,6 @@ static int nfc_genl_start_poll(struct sk_buff *skb, struct genl_info *info)
 	u32 idx;
 	u32 protocols;
 
-	pr_debug("entry\n");
-
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
 		!info->attrs[NFC_ATTR_PROTOCOLS])
 		return -EINVAL;
@@ -453,8 +427,6 @@ static int nfc_genl_stop_poll(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	pr_debug("entry\n");
-
 	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
 		return -EINVAL;
 
-- 
1.7.6.405.gc1be0

^ permalink raw reply related

* [RFCv2 9/9] caif-xshm: Add CAIF driver for Shared memory for M7400
From: Sjur Brændeland @ 2011-11-29 19:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Walleij, sjurbren, Paul Bolle, Sjur Brændeland, netdev
In-Reply-To: <1322595550-6473-1-git-send-email-sjur.brandeland@stericsson.com>

This patch introduces a caif shared memory link layer driver
for ST-Ericsson's Thor M7400 LTE modem.

M7400 uses a ring-buffer in shared memory for transporting data from the modem.
Each ring-buffer element contains an array of caif frames. caif_xshm calls
napi_schedule() when receiving notification about incoming data.
The napi-poll function copies data from the ring-buffer to SKBs until
ring-buffer is empty, or quota is exceeded.

If transmit ring-buffer is full, it also uses napi for scheduling transmission
of queued transmit buffer.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
cc: netdev@vger.kernel.org
---
 drivers/net/caif/Kconfig     |   10 +
 drivers/net/caif/Makefile    |    1 +
 drivers/net/caif/caif_xshm.c |  935 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 946 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/caif/caif_xshm.c

diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig
index abf4d7a..2861374 100644
--- a/drivers/net/caif/Kconfig
+++ b/drivers/net/caif/Kconfig
@@ -47,3 +47,13 @@ config CAIF_HSI
        The caif low level driver for CAIF over HSI.
        Be aware that if you enable this then you also need to
        enable a low-level HSI driver.
+
+config CAIF_XSHM
+	tristate "CAIF external memory protocol driver"
+	depends on XSHM && CAIF
+	default n
+	---help---
+	Say "yes" if you want to support CAIF over External Shared Memory (XSHM)
+	IPC mechanism (e.g. over Chip to Chip).
+	This will normally be built-in, loadable module is used for testing.
+	If unsure say N.
diff --git a/drivers/net/caif/Makefile b/drivers/net/caif/Makefile
index 91dff86..9310b24 100644
--- a/drivers/net/caif/Makefile
+++ b/drivers/net/caif/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_CAIF_SPI_SLAVE) += cfspi_slave.o
 # Shared memory
 caif_shm-objs := caif_shmcore.o caif_shm_u5500.o
 obj-$(CONFIG_CAIF_SHM) += caif_shm.o
+obj-$(CONFIG_CAIF_XSHM) += caif_xshm.o
 
 # HSI interface
 obj-$(CONFIG_CAIF_HSI) += caif_hsi.o
diff --git a/drivers/net/caif/caif_xshm.c b/drivers/net/caif/caif_xshm.c
new file mode 100644
index 0000000..35cff94
--- /dev/null
+++ b/drivers/net/caif/caif_xshm.c
@@ -0,0 +1,935 @@
+/*
+ * Copyright (C) ST-Ericsson AB 2010
+ * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
+ * Authors: Sjur Brendeland / sjur.brandeland@stericsson.com
+ *	   Daniel Martensson / daniel.martensson@stericsson.com
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": %s() :" fmt, __func__
+#include <linux/kernel.h>
+#include <linux/spinlock.h>
+#include <linux/sched.h>
+#include <linux/list.h>
+#include <linux/netdevice.h>
+#include <net/rtnetlink.h>
+#include <linux/if_arp.h>
+#include <net/caif/caif_device.h>
+#include <net/caif/caif_layer.h>
+#include <linux/xshm/xshm_pdev.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Daniel Martensson <daniel.martensson@stericsson.com>");
+MODULE_AUTHOR("Sjur Brendeland <sjur.brandeland@stericsson.com>");
+MODULE_DESCRIPTION("CAIF SHM driver");
+
+#define CONNECT_TIMEOUT (3 * HZ)
+#define CAIF_NEEDED_HEADROOM	32
+#define CAIF_FLOW_ON		1
+#define CAIF_FLOW_OFF		0
+
+#define LOW_XOFF_WATERMARK	50
+#define HIGH_XOFF_WATERMARK	70
+#define STUFF_MARK		30
+
+struct ringbuf {
+	__le32	*rip;
+	__le32	*wip;
+	u32	size;
+	__le32	*bufsize;
+};
+
+struct shm_pck_desc {
+	/* Offset from start of channel to CAIF frame. */
+	u32 offset;
+	u32 length;
+} __packed;
+
+struct shm_caif_frm {
+	/* Number of bytes of padding before the CAIF frame. */
+	u8 hdr_ofs;
+} __packed;
+
+#define SHM_HDR_LEN sizeof(struct shm_caif_frm)
+
+struct shmbuffer {
+/* Static part: */
+	u8 *addr;
+	u32 index;
+	u32 len;
+/* Dynamic part: */
+	u32 frames;
+	/* Offset from start of buffer to CAIF frame. */
+	u32 frm_ofs;
+};
+
+enum CFSHM_STATE {
+	CFSHM_CLOSED = 1,
+	CFSHM_OPENING,
+	CFSHM_OPEN
+};
+
+struct cfshm {
+	/* caif_dev_common must always be first in the structure*/
+	struct caif_dev_common cfdev;
+	struct xshm_dev *xshm;
+	struct napi_struct napi;
+	struct ringbuf tx;
+	struct sk_buff_head sk_qhead;
+	spinlock_t lock;
+	struct ringbuf rx;
+	u8 *rx_ringbuf;
+	u32 rx_frms_pr_buf;
+	u32 rx_alignment;
+	struct shmbuffer **rx_bufs;
+	struct net_device *ndev;
+
+	u32 tx_frms_pr_buf;
+	u32 tx_alignment;
+	struct shmbuffer **tx_bufs;
+	u8 *tx_ringbuf;
+	u32 tx_flow_on;
+	u32 high_xoff_water;
+	u32 low_xoff_water;
+	u32 stuff_mark;
+	atomic_t dbg_smp_rxactive;
+	enum CFSHM_STATE state;
+	struct platform_device *pdev;
+	struct list_head node;
+	wait_queue_head_t netmgmt_wq;
+};
+
+static LIST_HEAD(cfshm_list);
+static spinlock_t cfshm_list_lock;
+
+static unsigned int ringbuf_used(struct ringbuf *rb)
+{
+	if (le32_to_cpu(*rb->wip) >= le32_to_cpu(*rb->rip))
+		return le32_to_cpu(*rb->wip) - le32_to_cpu(*rb->rip);
+	else
+		return rb->size - le32_to_cpu(*rb->rip) + le32_to_cpu(*rb->wip);
+}
+
+static int ringbuf_get_writepos(struct ringbuf *rb)
+{
+	if ((le32_to_cpu(*rb->wip) + 1) % rb->size == le32_to_cpu(*rb->rip))
+		return -1;
+	else
+		return le32_to_cpu(*rb->wip);
+}
+
+static int ringbuf_get_readpos(struct ringbuf *rb)
+{
+
+	if (le32_to_cpu(*rb->wip) == le32_to_cpu(*rb->rip))
+		return -1;
+	else
+		return le32_to_cpu(*rb->rip);
+}
+
+static int ringbuf_upd_writeptr(struct ringbuf *rb)
+{
+	if (!WARN_ON((le32_to_cpu(*rb->wip) + 1) % rb->size == le32_to_cpu(*rb->rip))) {
+		*rb->wip = cpu_to_le32((le32_to_cpu(*rb->wip) + 1) % rb->size);
+		/* Do write barrier before updating index */
+		smp_wmb();
+	}
+	return le32_to_cpu(*rb->wip);
+}
+
+static void ringbuf_upd_readptr(struct ringbuf *rb)
+{
+	if (!WARN_ON(le32_to_cpu(*rb->wip) == le32_to_cpu(*rb->rip))) {
+		*rb->rip = cpu_to_le32((le32_to_cpu(*rb->rip) + 1) % rb->size);
+		/* Do write barrier before updating index */
+		smp_wmb();
+	}
+}
+
+
+
+static struct shmbuffer *get_rx_buf(struct cfshm *cfshm)
+{
+	struct shmbuffer *pbuf = NULL;
+	int idx = ringbuf_get_readpos(&cfshm->rx);
+
+	if (idx < 0)
+		goto out;
+	pbuf = cfshm->rx_bufs[idx];
+out:
+	return pbuf;
+}
+
+static struct shmbuffer *new_rx_buf(struct cfshm *cfshm)
+{
+	struct shmbuffer *pbuf = get_rx_buf(cfshm);
+
+	WARN_ON(!spin_is_locked(&cfshm->lock));
+	if (pbuf)
+		pbuf->frames = 0;
+
+	return pbuf;
+}
+
+static struct shmbuffer *get_tx_buf(struct cfshm *cfshm)
+{
+	int idx = ringbuf_get_writepos(&cfshm->tx);
+
+	if (idx < 0)
+		return NULL;
+	return cfshm->tx_bufs[idx];
+}
+
+inline struct shmbuffer *tx_bump_buf(struct cfshm *cfshm,
+			struct shmbuffer *pbuf)
+{
+	u32 desc_size;
+	struct shmbuffer *newpbuf = pbuf;
+
+	WARN_ON(!spin_is_locked(&cfshm->lock));
+	if (pbuf) {
+		cfshm->xshm->cfg.tx.buf_size[pbuf->index] =
+			cpu_to_le32(pbuf->frm_ofs);
+		ringbuf_upd_writeptr(&cfshm->tx);
+		newpbuf = get_tx_buf(cfshm);
+		/* Reset buffer parameters. */
+		desc_size = (cfshm->tx_frms_pr_buf + 1) *
+			sizeof(struct shm_pck_desc);
+		pbuf->frm_ofs = desc_size + (desc_size % cfshm->rx_alignment);
+		pbuf->frames = 0;
+
+	}
+	return newpbuf;
+}
+
+static struct shmbuffer *shm_rx_func(struct cfshm *cfshm, int quota)
+{
+	struct shmbuffer *pbuf;
+	struct sk_buff *skb;
+	int ret;
+	unsigned long flags;
+
+	pbuf = get_rx_buf(cfshm);
+	while (pbuf) {
+		/* Retrieve pointer to start of the packet descriptor area. */
+		struct shm_pck_desc *pck_desc =
+			((struct shm_pck_desc *) pbuf->addr) + pbuf->frames;
+		u32 offset;
+
+		/* Loop until descriptor contains zero offset */
+		while ((offset = pck_desc->offset)) {
+			unsigned int caif_len;
+			struct shm_caif_frm *frm;
+			u32 length = pck_desc->length;
+			u8 hdr_ofs;
+			frm = (struct shm_caif_frm *)(pbuf->addr + offset);
+			hdr_ofs = frm->hdr_ofs;
+			caif_len =
+				length - SHM_HDR_LEN -
+				hdr_ofs;
+
+			pr_devel("copy data buf:%d frm:%d offs:%d @%x len:%d\n",
+					pbuf->index, pbuf->frames, offset,
+					(u32) (SHM_HDR_LEN + hdr_ofs + offset +
+						pbuf->addr - cfshm->rx_ringbuf),
+					length);
+
+			/* Check whether number of frames is below limit */
+			if (pbuf->frames > cfshm->rx_frms_pr_buf) {
+				pr_warn("Too many frames in buffer.\n");
+				++cfshm->ndev->stats.rx_frame_errors;
+				goto desc_err;
+			}
+
+			/* Check whether offset is below low limits */
+			if (pbuf->addr + offset
+					<= (u8 *)(pck_desc + 1)) {
+				pr_warn("Offset in desc. below buffer area.\n");
+				++cfshm->ndev->stats.rx_frame_errors;
+				goto desc_err;
+			}
+
+			/* Check whether offset above upper limit */
+			if (offset + length > pbuf->len) {
+				pr_warn("Offset outside buffer area:\n");
+				++cfshm->ndev->stats.rx_frame_errors;
+				goto desc_err;
+			}
+
+			skb = netdev_alloc_skb(cfshm->ndev,
+							caif_len + 1);
+			if (skb == NULL) {
+				pr_debug("Couldn't allocate SKB\n");
+				++cfshm->ndev->stats.rx_dropped;
+				goto out;
+			}
+
+			memcpy(skb_put(skb, caif_len),
+					SHM_HDR_LEN + hdr_ofs +
+					offset + pbuf->addr,
+					caif_len);
+
+			skb->protocol = htons(ETH_P_CAIF);
+			skb_reset_mac_header(skb);
+			skb->dev = cfshm->ndev;
+
+			/* Push received packet up the stack. */
+			ret = netif_receive_skb(skb);
+
+			if (!ret) {
+				cfshm->ndev->stats.rx_packets++;
+				cfshm->ndev->stats.rx_bytes +=
+					length;
+			} else
+				++cfshm->ndev->stats.rx_dropped;
+			/* Move to next packet descriptor. */
+			pck_desc++;
+
+			pbuf->frames++;
+			if (--quota <= 0) {
+				pr_devel("Quota exeeded (pbuf:%p)\n", pbuf);
+				goto out;
+			}
+		}
+desc_err:
+		pbuf->frames = 0;
+
+		spin_lock_irqsave(&cfshm->lock, flags);
+		ringbuf_upd_readptr(&cfshm->rx);
+		pbuf = new_rx_buf(cfshm);
+		spin_unlock_irqrestore(&cfshm->lock, flags);
+
+	}
+	cfshm->xshm->ipc_rx_release(cfshm->xshm, false);
+out:
+	return pbuf;
+}
+
+static int insert_skb_in_buf(struct cfshm *cfshm, struct sk_buff *skb,
+					struct shmbuffer *pbuf)
+{
+	struct shm_pck_desc *pck_desc;
+	unsigned int frmlen;
+	struct shm_caif_frm *frm;
+	u8 hdr_ofs;
+	struct caif_payload_info *info = (struct caif_payload_info *)&skb->cb;
+
+	WARN_ON(!spin_is_locked(&cfshm->lock));
+
+	if (unlikely(pbuf->frames >= cfshm->tx_frms_pr_buf)) {
+		pr_devel("-ENOSPC exeeded frames: %d >= %d\n",
+				pbuf->frames, cfshm->tx_frms_pr_buf);
+		return -ENOSPC;
+	}
+
+	/*
+	 * Align the address of the entire CAIF frame (incl padding),
+	 * so the modem can do efficient DMA of this frame
+	 * FIXME: Alignment is power of to, so it could use binary ops.
+	 */
+	pbuf->frm_ofs = roundup(pbuf->frm_ofs, cfshm->tx_alignment);
+
+
+	/* Make the payload (IP packet) inside the frame aligned */
+	hdr_ofs = (unsigned long) &pbuf->frm_ofs;
+	hdr_ofs = roundup(hdr_ofs + SHM_HDR_LEN + info->hdr_len,
+			cfshm->tx_alignment);
+
+	frm = (struct shm_caif_frm *)
+		(pbuf->addr + pbuf->frm_ofs);
+
+	frmlen = SHM_HDR_LEN + hdr_ofs + skb->len;
+
+	/*
+	 * Verify that packet, header and additional padding
+	 * can fit within the buffer frame area.
+	 */
+	if (pbuf->len < pbuf->frm_ofs + frmlen) {
+		pr_devel("-ENOSPC exeeded offset %d < %d\n",
+				pbuf->len, pbuf->frm_ofs + frmlen);
+		return -ENOSPC;
+	}
+
+	/* Copy in CAIF frame. */
+	frm->hdr_ofs = hdr_ofs;
+	skb_copy_bits(skb, 0, pbuf->addr +
+			pbuf->frm_ofs + SHM_HDR_LEN +
+			hdr_ofs, skb->len);
+
+	pr_devel("copy data buf:%d frm:%d offs:%d @%d len:%d\n",
+			pbuf->index, pbuf->frames,
+			pbuf->frm_ofs,
+			(u32) (pbuf->addr + pbuf->frm_ofs +
+				SHM_HDR_LEN + hdr_ofs - cfshm->tx_ringbuf),
+			skb->len);
+
+	cfshm->ndev->stats.tx_packets++;
+	cfshm->ndev->stats.tx_bytes += frmlen;
+	/* Fill in the shared memory packet descriptor area. */
+	pck_desc = (struct shm_pck_desc *) (pbuf->addr);
+	/* Forward to current frame. */
+	pck_desc += pbuf->frames;
+	pck_desc->offset = pbuf->frm_ofs;
+	pck_desc->length = frmlen;
+	/* Terminate packet descriptor area. */
+	pck_desc++;
+	pck_desc->offset = 0;
+	pck_desc->length = 0;
+	/* Update buffer parameters. */
+	pbuf->frames++;
+	pbuf->frm_ofs += frmlen;
+
+	return 0;
+}
+
+static struct shmbuffer *queue_to_ringbuf(struct cfshm *cfshm, int *new_bufs)
+{
+	struct shmbuffer *pbuf;
+	struct sk_buff *skb;
+	int err;
+
+	WARN_ON(!spin_is_locked(&cfshm->lock));
+
+	pbuf = get_tx_buf(cfshm);
+	while (pbuf != NULL) {
+		skb = skb_peek(&cfshm->sk_qhead);
+		if (skb == NULL)
+			break;
+		err = insert_skb_in_buf(cfshm, skb, pbuf);
+		if (unlikely(err == -ENOSPC)) {
+			pr_devel("No more space in buffer\n");
+			++(*new_bufs);
+			pbuf = tx_bump_buf(cfshm, pbuf);
+			continue;
+		}
+		skb = skb_dequeue(&cfshm->sk_qhead);
+		/* We're always in NET_*_SOFTIRQ */
+		dev_kfree_skb(skb);
+	}
+	return pbuf;
+}
+
+static int shm_netdev_open(struct net_device *netdev)
+{
+	struct cfshm *cfshm = netdev_priv(netdev);
+	int ret, err = 0;
+
+	cfshm->state = CFSHM_OPENING;
+	if (cfshm->xshm != NULL && cfshm->xshm->open != NULL)
+		err = cfshm->xshm->open(cfshm->xshm);
+	if (err)
+		goto error;
+
+	rtnl_unlock();  /* Release RTNL lock during connect wait */
+	ret = wait_event_interruptible_timeout(cfshm->netmgmt_wq,
+			cfshm->state != CFSHM_OPENING,
+			CONNECT_TIMEOUT);
+	rtnl_lock();
+
+	if (ret == 0) {
+		pr_debug("connect timeout\n");
+		err = -ETIMEDOUT;
+		goto error;
+	}
+
+	if (cfshm->state !=  CFSHM_OPEN) {
+		pr_debug("connect failed\n");
+		err = -ECONNREFUSED;
+		goto error;
+	}
+
+	napi_enable(&cfshm->napi);
+	return 0;
+error:
+	if (cfshm->xshm != NULL && cfshm->xshm->close != NULL)
+		cfshm->xshm->close(cfshm->xshm);
+	return err;
+}
+
+static int shm_netdev_close(struct net_device *netdev)
+{
+	struct cfshm *cfshm = netdev_priv(netdev);
+
+	napi_disable(&cfshm->napi);
+
+	if (cfshm->xshm != NULL && cfshm->xshm->close != NULL)
+		cfshm->xshm->close(cfshm->xshm);
+
+	return 0;
+}
+
+static int open_cb(void *drv)
+{
+	struct cfshm *cfshm = drv;
+
+	cfshm->state = CFSHM_OPEN;
+	netif_carrier_on(cfshm->ndev);
+	wake_up_interruptible(&cfshm->netmgmt_wq);
+	return 0;
+}
+
+static void close_cb(void *drv)
+{
+	struct cfshm *cfshm = drv;
+
+	cfshm->state = CFSHM_CLOSED;
+	netif_carrier_off(cfshm->ndev);
+	wake_up_interruptible(&cfshm->netmgmt_wq);
+}
+
+static int caif_shmdrv_rx_cb(void *drv)
+{
+	struct cfshm *cfshm = drv;
+
+	if (unlikely(*cfshm->xshm->cfg.rx.state == cpu_to_le32(XSHM_CLOSED)))
+		return -ESHUTDOWN;
+
+	napi_schedule(&cfshm->napi);
+	return 0;
+}
+
+static int send_pending_txbufs(struct cfshm *cfshm, int usedbufs)
+{
+	unsigned long flags;
+
+	/* Send the started buffer if used buffers are low enough */
+	WARN_ON(!spin_is_locked(&cfshm->lock));
+	if (likely(usedbufs < cfshm->stuff_mark)) {
+		struct shmbuffer *pbuf = get_tx_buf(cfshm);
+		if (unlikely(pbuf->frames > 0)) {
+			if (spin_trylock_irqsave(&cfshm->lock, flags)) {
+				WARN_ON(!spin_is_locked(&cfshm->lock));
+				pbuf = get_tx_buf(cfshm);
+				tx_bump_buf(cfshm, pbuf);
+				spin_unlock_irqrestore(&cfshm->lock, flags);
+				cfshm->xshm->ipc_tx(cfshm->xshm);
+				return 0;
+			} else {
+				return -EBUSY;
+			}
+		}
+	}
+	return 0;
+}
+
+static int caif_shmdrv_tx_release_cb(void *drv)
+{
+	struct cfshm *cfshm = drv;
+	int usedbufs;
+
+	usedbufs = ringbuf_used(&cfshm->tx);
+
+	/* Send flow-on if we have sent flow-off and get below low-water */
+	if (usedbufs <= cfshm->low_xoff_water && !cfshm->tx_flow_on) {
+		pr_debug("Flow on\n");
+		cfshm->tx_flow_on = true;
+		cfshm->cfdev.flowctrl(cfshm->ndev, CAIF_FLOW_ON);
+	}
+
+	/* If ringbuf is full, schedule NAPI to start sending */
+	if (skb_peek(&cfshm->sk_qhead) != NULL) {
+		pr_debug("Schedule NAPI to empty queue\n");
+		napi_schedule(&cfshm->napi);
+		return 0;
+	}
+
+	/* Send the started buffer if used buffers are low enough */
+	if (usedbufs < cfshm->stuff_mark) {
+		struct shmbuffer *pbuf = get_tx_buf(cfshm);
+		if (pbuf != NULL && pbuf->frames > 0)
+			napi_schedule(&cfshm->napi);
+	}
+	return 0;
+}
+
+static int shm_rx_poll(struct napi_struct *napi, int quota)
+{
+	struct cfshm *cfshm = container_of(napi, struct cfshm, napi);
+	int new_bufs;
+	struct shmbuffer *pbuf;
+	int usedbufs;
+	unsigned long flags;
+
+	/* Simply return if rx_poll is already called on other CPU */
+	if (atomic_read(&cfshm->dbg_smp_rxactive) > 0)
+		return quota;
+
+	WARN_ON(atomic_inc_return(&cfshm->dbg_smp_rxactive) > 1);
+
+	pbuf = shm_rx_func(cfshm, quota);
+
+	usedbufs = ringbuf_used(&cfshm->tx);
+
+	if (spin_trylock_irqsave(&cfshm->lock, flags)) {
+
+		/* Check if we're below "Stuff" limit, and send pending data */
+		send_pending_txbufs(cfshm, usedbufs);
+
+		/* Check if we have queued packets */
+		if (unlikely(skb_peek(&cfshm->sk_qhead) != NULL)) {
+			struct shmbuffer *txbuf;
+			WARN_ON(!spin_is_locked(&cfshm->lock));
+			pr_debug("Try to empty tx-queue\n");
+			new_bufs = 0;
+			txbuf = queue_to_ringbuf(cfshm, &new_bufs);
+
+			/* Bump out if we are configured with few buffers */
+			if (txbuf && cfshm->xshm->cfg.tx.buffers < 3) {
+				tx_bump_buf(cfshm, txbuf);
+
+				spin_unlock_irqrestore(&cfshm->lock, flags);
+				cfshm->xshm->ipc_tx(cfshm->xshm);
+				goto txdone;
+			}
+		}
+		spin_unlock_irqrestore(&cfshm->lock, flags);
+	}
+txdone:
+
+	if (pbuf == NULL)
+		napi_complete(&cfshm->napi);
+
+	atomic_dec(&cfshm->dbg_smp_rxactive);
+	return 0;
+}
+
+static int shm_netdev_tx(struct sk_buff *skb, struct net_device *shm_netdev)
+{
+	struct shmbuffer *pbuf = NULL;
+	int usedbufs;
+	int new_bufs = 0;
+	struct cfshm *cfshm = netdev_priv(shm_netdev);
+	unsigned long flags;
+
+	/*
+	 * If we have packets in queue, keep queueing to avoid
+	 * out-of-order delivery
+	 */
+	spin_lock_irqsave(&cfshm->lock, flags);
+
+	skb_queue_tail(&cfshm->sk_qhead, skb);
+	pbuf = queue_to_ringbuf(cfshm, &new_bufs);
+
+	usedbufs = ringbuf_used(&cfshm->tx);
+
+	if (usedbufs > cfshm->high_xoff_water && cfshm->tx_flow_on) {
+		pr_debug("Flow off\n");
+		cfshm->tx_flow_on = false;
+		spin_unlock_irqrestore(&cfshm->lock, flags);
+		cfshm->cfdev.flowctrl(cfshm->ndev, CAIF_FLOW_OFF);
+		return 0;
+	}
+
+	/* Check if we should accumulate more packets */
+	if (new_bufs == 0 && usedbufs > cfshm->stuff_mark) {
+		spin_unlock_irqrestore(&cfshm->lock, flags);
+		return 0;
+	}
+	tx_bump_buf(cfshm, pbuf);
+	spin_unlock_irqrestore(&cfshm->lock, flags);
+	cfshm->xshm->ipc_tx(cfshm->xshm);
+	return 0;
+}
+
+static const struct net_device_ops netdev_ops = {
+	.ndo_open = shm_netdev_open,
+	.ndo_stop = shm_netdev_close,
+	.ndo_start_xmit = shm_netdev_tx,
+};
+
+static void shm_netdev_setup(struct net_device *pshm_netdev)
+{
+	struct cfshm *cfshm;
+
+	cfshm = netdev_priv(pshm_netdev);
+	pshm_netdev->netdev_ops = &netdev_ops;
+	pshm_netdev->type = ARPHRD_CAIF;
+	pshm_netdev->hard_header_len = CAIF_NEEDED_HEADROOM;
+	pshm_netdev->tx_queue_len = 0;
+	pshm_netdev->destructor = free_netdev;
+
+	/* Initialize structures in a clean state. */
+	memset(cfshm, 0, sizeof(struct cfshm));
+}
+
+static void deinit_bufs(struct cfshm *cfshm)
+{
+	int j;
+
+	if (cfshm == NULL)
+		return;
+
+	for (j = 0; j < cfshm->xshm->cfg.rx.buffers; j++)
+		kfree(cfshm->rx_bufs[j]);
+	kfree(cfshm->rx_bufs);
+
+	for (j = 0; j < cfshm->xshm->cfg.tx.buffers; j++)
+		kfree(cfshm->tx_bufs[j]);
+	kfree(cfshm->tx_bufs);
+}
+
+static int cfshm_probe(struct platform_device *pdev)
+{
+	int err, j;
+	struct xshm_dev *xshm = pdev->dev.platform_data;
+	struct cfshm *cfshm = NULL;
+	struct net_device *netdev;
+	u32 buf_size;
+	unsigned long flags;
+
+	if (xshm == NULL)
+		return -EINVAL;
+	if (xshm->cfg.tx.addr == NULL || xshm->cfg.rx.addr == NULL) {
+		pr_debug("Shared Memory are not configured\n");
+		return -EINVAL;
+	}
+
+	if (xshm->cfg.tx.ch_size / xshm->cfg.tx.buffers <
+			xshm->cfg.tx.packets * sizeof(struct shm_pck_desc) +
+				xshm->cfg.tx.mtu) {
+		pr_warn("Bad packet TX-channel size");
+		return -EINVAL;
+	}
+
+	if (xshm->cfg.rx.ch_size / xshm->cfg.rx.buffers <
+			sizeof(struct shm_pck_desc) + xshm->cfg.rx.mtu) {
+		pr_warn("Bad packet RX-channel size");
+		return -EINVAL;
+	}
+
+	if (xshm->cfg.rx.buffers < 2 || xshm->cfg.tx.buffers < 2) {
+		pr_warn("Too few buffers in channel");
+		return -EINVAL;
+	}
+
+	err = -ENOMEM;
+	netdev = alloc_netdev(sizeof(struct cfshm), xshm->cfg.name,
+			shm_netdev_setup);
+
+	if (netdev == NULL)
+		goto error;
+
+	cfshm = netdev_priv(netdev);
+	cfshm->state = CFSHM_CLOSED;
+	init_waitqueue_head(&cfshm->netmgmt_wq);
+
+	cfshm->xshm = xshm;
+	xshm->driver_data = cfshm;
+	cfshm->ndev = netdev;
+	netdev->mtu = xshm->cfg.tx.mtu;
+	cfshm->high_xoff_water =
+		(xshm->cfg.rx.buffers * HIGH_XOFF_WATERMARK) / 100;
+	cfshm->low_xoff_water =
+		(xshm->cfg.rx.buffers * LOW_XOFF_WATERMARK) / 100;
+	cfshm->stuff_mark = (xshm->cfg.rx.buffers * STUFF_MARK) / 100;
+
+	cfshm->tx_frms_pr_buf = xshm->cfg.tx.packets;
+	cfshm->rx_frms_pr_buf = xshm->cfg.rx.packets;
+	cfshm->rx_alignment = xshm->cfg.rx.alignment;
+	cfshm->tx_alignment = xshm->cfg.tx.alignment;
+
+	if (xshm->cfg.latency)
+		cfshm->cfdev.link_select = CAIF_LINK_LOW_LATENCY;
+	else
+		cfshm->cfdev.link_select = CAIF_LINK_HIGH_BANDW;
+
+	cfshm->tx.rip = xshm->cfg.tx.read;
+	cfshm->tx.wip = xshm->cfg.tx.write;
+	cfshm->tx.bufsize = xshm->cfg.tx.buf_size;
+	cfshm->tx.size = xshm->cfg.tx.buffers;
+
+	cfshm->rx.rip = xshm->cfg.rx.read;
+	cfshm->rx.wip = xshm->cfg.rx.write;
+	cfshm->rx.bufsize = xshm->cfg.rx.buf_size;
+	cfshm->rx.size = xshm->cfg.rx.buffers;
+	pr_devel("RX ri:%d wi:%d size:%d\n",
+		le32_to_cpu(*cfshm->rx.rip),
+			le32_to_cpu(*cfshm->rx.wip), cfshm->rx.size);
+	pr_devel("TX ri:%d wi:%d size:%d\n",
+		le32_to_cpu(*cfshm->tx.rip),
+			le32_to_cpu(*cfshm->tx.wip), cfshm->rx.size);
+	pr_devel("frms_pr_buf:%d %d\n", cfshm->rx_frms_pr_buf,
+			cfshm->tx_frms_pr_buf);
+
+	spin_lock_init(&cfshm->lock);
+	netif_carrier_off(netdev);
+	skb_queue_head_init(&cfshm->sk_qhead);
+
+	pr_devel("SHM DEVICE[%p] PROBED BY DRIVER, NEW SHM DRIVER"
+			" INSTANCE AT cfshm =0x%p\n",
+			cfshm->xshm, cfshm);
+
+	cfshm->tx_ringbuf = xshm->cfg.tx.addr;
+	cfshm->rx_ringbuf = xshm->cfg.rx.addr;
+
+	pr_devel("TX-BASE:%p RX-BASE:%p\n",
+			cfshm->tx_ringbuf,
+			cfshm->rx_ringbuf);
+
+	cfshm->tx_bufs = kzalloc(sizeof(struct shmbuffer *) *
+			xshm->cfg.tx.buffers, GFP_KERNEL);
+	if (cfshm->tx_bufs == NULL)
+		goto error;
+	buf_size = xshm->cfg.tx.ch_size / xshm->cfg.tx.buffers;
+
+	pr_devel("TX: buffers:%d buf_size:%d frms:%d mtu:%d\n",
+			xshm->cfg.tx.buffers, buf_size,
+			cfshm->tx_frms_pr_buf, netdev->mtu);
+
+	for (j = 0; j < xshm->cfg.tx.buffers; j++) {
+		u32 desc_size;
+		struct shmbuffer *tx_buf =
+				kzalloc(sizeof(struct shmbuffer), GFP_KERNEL);
+
+		if (tx_buf == NULL) {
+			pr_warn("ERROR, Could not"
+					" allocate dynamic mem. for tx_buf, "
+					" Bailing out ...\n");
+			goto error;
+		}
+
+		tx_buf->index = j;
+
+		tx_buf->addr = cfshm->tx_ringbuf + (buf_size * j);
+		tx_buf->len = buf_size;
+		tx_buf->frames = 0;
+		desc_size = (cfshm->tx_frms_pr_buf + 1) *
+				sizeof(struct shm_pck_desc);
+
+		tx_buf->frm_ofs = desc_size + (desc_size % cfshm->tx_alignment);
+
+		cfshm->tx_bufs[j] = tx_buf;
+
+		pr_devel("tx_buf[%d] addr:%p len:%d\n",
+				tx_buf->index,
+				tx_buf->addr,
+				tx_buf->len);
+	}
+
+	cfshm->rx_bufs = kzalloc(sizeof(struct shmbuffer *) *
+				xshm->cfg.rx.buffers, GFP_KERNEL);
+	if (cfshm->rx_bufs == NULL)
+		goto error;
+	buf_size = xshm->cfg.tx.ch_size / xshm->cfg.tx.buffers;
+	pr_devel("RX: buffers:%d buf_size:%d frms:%d mtu:%d\n",
+			xshm->cfg.rx.buffers, buf_size,
+			cfshm->rx_frms_pr_buf, netdev->mtu);
+
+	for (j = 0; j < xshm->cfg.rx.buffers; j++) {
+		struct shmbuffer *rx_buf =
+				kzalloc(sizeof(struct shmbuffer), GFP_KERNEL);
+
+		if (rx_buf == NULL) {
+			pr_warn("ERROR, Could not"
+					" allocate dynamic mem.for rx_buf, "
+					" Bailing out ...\n");
+			goto error;
+		}
+
+		rx_buf->index = j;
+
+		rx_buf->addr = cfshm->rx_ringbuf + (buf_size * j);
+		rx_buf->len = buf_size;
+		cfshm->rx_bufs[j] = rx_buf;
+		pr_devel("rx_buf[%d] addr:%p len:%d\n",
+				rx_buf->index,
+				rx_buf->addr,
+				rx_buf->len);
+	}
+
+	cfshm->tx_flow_on = 1;
+	cfshm->xshm->ipc_rx_cb = caif_shmdrv_rx_cb;
+	cfshm->xshm->ipc_tx_release_cb = caif_shmdrv_tx_release_cb;
+	cfshm->xshm->open_cb = open_cb;
+	cfshm->xshm->close_cb = close_cb;
+
+	spin_lock_irqsave(&cfshm->lock, flags);
+	get_tx_buf(cfshm);
+	new_rx_buf(cfshm);
+	spin_unlock_irqrestore(&cfshm->lock, flags);
+
+	netif_napi_add(netdev, &cfshm->napi, shm_rx_poll,
+			2 * cfshm->rx_frms_pr_buf);
+
+	err = register_netdev(netdev);
+	if (err) {
+		pr_warn("ERROR[%d], SHM could not, "
+			"register with NW FRMWK Bailing out ...\n", err);
+		goto error;
+	}
+
+	/* Add CAIF SHM device to list. */
+	spin_lock(&cfshm_list_lock);
+	list_add_tail(&cfshm->node, &cfshm_list);
+	spin_unlock(&cfshm_list_lock);
+
+	return err;
+error:
+	deinit_bufs(cfshm);
+	free_netdev(netdev);
+	return err;
+}
+
+static int cfshm_remove(struct platform_device *pdev)
+{
+	struct xshm_dev *xshm;
+	struct cfshm *cfshm;
+
+	xshm = pdev->dev.platform_data;
+
+	if (xshm == NULL || xshm->driver_data == NULL)
+		return 0;
+
+	cfshm = xshm->driver_data;
+
+	spin_lock(&cfshm_list_lock);
+	list_del(&cfshm->node);
+	spin_unlock(&cfshm_list_lock);
+
+	deinit_bufs(cfshm);
+
+	unregister_netdev(cfshm->ndev);
+
+	xshm->ipc_rx_cb = NULL;
+	xshm->ipc_tx_release_cb = NULL;
+	xshm->open_cb = NULL;
+	xshm->close_cb = NULL;
+	xshm->driver_data = NULL;
+
+	return 0;
+}
+
+static struct platform_driver cfshm_plat_drv = {
+	.probe = cfshm_probe,
+	.remove = cfshm_remove,
+	.driver = {
+		.name = "xshmp",
+		.owner = THIS_MODULE,
+	},
+};
+
+static void __exit cfshm_exit_module(void)
+{
+	platform_driver_unregister(&cfshm_plat_drv);
+}
+
+static int __init cfshm_init_module(void)
+{
+	int err;
+
+	spin_lock_init(&cfshm_list_lock);
+
+	err = platform_driver_register(&cfshm_plat_drv);
+	if (err) {
+		printk(KERN_ERR "Could not register platform SHM driver: %d.\n",
+			err);
+		goto err_dev_register;
+	}
+	return err;
+
+ err_dev_register:
+	return err;
+}
+
+module_init(cfshm_init_module);
+module_exit(cfshm_exit_module);
-- 
1.7.0.4

^ permalink raw reply related

* Re: [PATCH] sctp: integer overflow in sctp_auth_create_key()
From: David Miller @ 2011-11-29 19:39 UTC (permalink / raw)
  To: xi.wang; +Cc: linux-kernel, vladislav.yasevich, sri, linux-sctp, netdev,
	security
In-Reply-To: <BC344CCF-A50F-4E5E-A9A5-F506D8BD9DB9@gmail.com>

From: Xi Wang <xi.wang@gmail.com>
Date: Tue, 29 Nov 2011 14:31:30 -0500

> a5e5c374 --- it says "No differences found".
> 
> Can you please apply the new patch v2?  Thanks.

Sigh, probably a side effect of how your patch was corrupted
and how I tried to fix it up by hand :-/

Ok, I'll apply v2, thanks.

^ permalink raw reply

* Re: [RFCv2 9/9] caif-xshm: Add CAIF driver for Shared memory for M7400
From: David Miller @ 2011-11-29 19:47 UTC (permalink / raw)
  To: sjur.brandeland; +Cc: linux-kernel, linus.walleij, sjurbren, pebolle, netdev
In-Reply-To: <1322595550-6473-10-git-send-email-sjur.brandeland@stericsson.com>

From: Sjur Brændeland <sjur.brandeland@stericsson.com>
Date: Tue, 29 Nov 2011 20:39:10 +0100

> This patch introduces a caif shared memory link layer driver
> for ST-Ericsson's Thor M7400 LTE modem.
> 
> M7400 uses a ring-buffer in shared memory for transporting data from the modem.
> Each ring-buffer element contains an array of caif frames. caif_xshm calls
> napi_schedule() when receiving notification about incoming data.
> The napi-poll function copies data from the ring-buffer to SKBs until
> ring-buffer is empty, or quota is exceeded.
> 
> If transmit ring-buffer is full, it also uses napi for scheduling transmission
> of queued transmit buffer.
> 
> Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
> cc: netdev@vger.kernel.org

I'm happy for this to go into the tree where the necessary xshm infrastructure
goes first:

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* Re: [bug?] r8169: hangs under heavy load
From: booster @ 2011-11-29 19:56 UTC (permalink / raw)
  To: Francois Romieu
  Cc: hayeswang, 'Jonathan Nieder', 'Eric Dumazet',
	netdev, 'nic_swsd', linux-kernel, 'Armin Kazmi'
In-Reply-To: <20111129105440.GA2410@electric-eye.fr.zoreil.com>

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

Francois Romieu wrote:
> hayeswang <hayeswang@realtek.com> :
> [...]
>   
>> For the 8168c and the later chips, our hardware engineer says that don't enable
>> the RxFIFOOver of IntrMask and don't clear the RxFIFOOver of IntrStatus. The
>> hardware will automatically escape Rx fifo full situation. Although you try to
>> clear the RxFIFOOver of IntrStatus, maybe the bit wouldn't be cleared. Just
>> disregard it.
>>     
>
> Should "later" be understood as gigabit PCI-E only or is there a similar
> difference of behavior between older fast-ethernet PCI-E and more recent
> ones ?
>
> Gerd, can you try the patch below ? It should match Haye's description.
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 6f06aa1..97b5593 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -4885,8 +4885,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
>  	RTL_W16(IntrMitigate, 0x5151);
>  
>  	/* Work around for RxFIFO overflow. */
> -	if (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
> -	    tp->mac_version == RTL_GIGA_MAC_VER_22) {
> +	if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
>  		tp->intr_event |= RxFIFOOver | PCSTimeout;
>  		tp->intr_event &= ~RxOverflow;
>  	}
> @@ -5804,6 +5803,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
>  	 */
>  	status = RTL_R16(IntrStatus);
>  	while (status && status != 0xffff) {
> +		status &= ~tp->intr_event;
> +		if (!status)
> +			break;
> +
>  		handled = 1;
>  
>  		/* Handle all of the error cases first. These will reset
> @@ -5818,7 +5821,6 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
>  			switch (tp->mac_version) {
>  			/* Work around for rx fifo overflow */
>  			case RTL_GIGA_MAC_VER_11:
> -			case RTL_GIGA_MAC_VER_22:
>  			case RTL_GIGA_MAC_VER_26:
>  				netif_stop_queue(dev);
>  				rtl8169_tx_timeout(dev);
> @@ -5828,6 +5830,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
>  			case RTL_GIGA_MAC_VER_19:
>  			case RTL_GIGA_MAC_VER_20:
>  			case RTL_GIGA_MAC_VER_21:
> +			case RTL_GIGA_MAC_VER_22:
>  			case RTL_GIGA_MAC_VER_23:
>  			case RTL_GIGA_MAC_VER_24:
>  			case RTL_GIGA_MAC_VER_27:
>
>   
Hi Francois, now an ifconfig shows the eth0 interface is up, but no data
is transfered
and a ping is not working.
[   14.522369] r8169 0000:02:00.0: eth0: link down
[   14.522773] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   14.671742] r8169 0000:03:00.0: eth1: link down
[   14.672169] ADDRCONF(NETDEV_UP): eth1: link is not ready
An added output shows that it is really detected as RTL_GIGA_MAC_VER_22.

Any more ideas ?


[-- Attachment #2: dmesg_20111129_kernel_3.2_r8169-patch2.txt --]
[-- Type: text/plain, Size: 45194 bytes --]

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0-rc3+ (root@pokini) (gcc version 4.4.5 (Debian 4.4.5-8) ) #4 SMP Tue Nov 29 19:49:50 CET 2011
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 0000000000090000 (usable)
[    0.000000]  BIOS-e820: 0000000000090000 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000d2000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 000000007f6b0000 (usable)
[    0.000000]  BIOS-e820: 000000007f6b0000 - 000000007f6bc000 (ACPI data)
[    0.000000]  BIOS-e820: 000000007f6bc000 - 000000007f6bf000 (ACPI NVS)
[    0.000000]  BIOS-e820: 000000007f6bf000 - 0000000080000000 (reserved)
[    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
[    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
[    0.000000]  BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)
[    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
[    0.000000]  BIOS-e820: 00000000ffb80000 - 0000000100000000 (reserved)
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI present.
[    0.000000] DMI: CompuLab CM-iAM/SBC-FITPC2i/CM-iAM/SBC-FITPC2i, BIOS NAPA0001.86C.0000.D.1009141059 09/14/2010
[    0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
[    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
[    0.000000] last_pfn = 0x7f6b0 max_arch_pfn = 0x1000000
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
[    0.000000]   00000-9FFFF write-back
[    0.000000]   A0000-BFFFF uncachable
[    0.000000]   C0000-CFFFF write-protect
[    0.000000]   D0000-DFFFF uncachable
[    0.000000]   E0000-FFFFF write-protect
[    0.000000] MTRR variable ranges enabled:
[    0.000000]   0 base 000000000 mask 080000000 write-back
[    0.000000]   1 base 07F700000 mask 0FFF00000 uncachable
[    0.000000]   2 base 07F800000 mask 0FF800000 uncachable
[    0.000000]   3 disabled
[    0.000000]   4 disabled
[    0.000000]   5 disabled
[    0.000000]   6 disabled
[    0.000000]   7 disabled
[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[    0.000000] found SMP MP-table at [c00f8600] f8600
[    0.000000] initial memory mapped : 0 - 01a00000
[    0.000000] Base memory trampoline at [c008c000] 8c000 size 16384
[    0.000000] init_memory_mapping: 0000000000000000-00000000379fe000
[    0.000000]  0000000000 - 0000200000 page 4k
[    0.000000]  0000200000 - 0037800000 page 2M
[    0.000000]  0037800000 - 00379fe000 page 4k
[    0.000000] kernel direct mapping tables up to 379fe000 @ 19fa000-1a00000
[    0.000000] RAMDISK: 36355000 - 37ff0000
[    0.000000] Allocated new RAMDISK: 346ba000 - 36354835
[    0.000000] Move RAMDISK from 0000000036355000 - 0000000037fef834 to 346ba000 - 36354834
[    0.000000] ACPI: RSDP 000f85d0 00024 (v02 PTLTD )
[    0.000000] ACPI: XSDT 7f6b70db 00064 (v01 PTLTD  ? XSDT   06040000  LTP 00000000)
[    0.000000] ACPI: FACP 7f6bbdb0 000F4 (v03 INTEL  POULSBO  06040000 INTC 00000032)
[    0.000000] ACPI: DSDT 7f6b803a 03CF2 (v01 INTEL   POULSBO 06040000 INTL 20050624)
[    0.000000] ACPI: FACS 7f6befc0 00040
[    0.000000] ACPI: HPET 7f6bbea4 00038 (v01 INTEL  POULSBO  06040000 INTC 00000032)
[    0.000000] ACPI: MCFG 7f6bbedc 0003C (v01 INTEL  POULSBO  06040000 INTC 00000032)
[    0.000000] ACPI: TCPA 7f6bbf18 00032 (v01 PTLTD  CALISTGA 06040000  PTL 00000001)
[    0.000000] ACPI: TMOR 7f6bbf4a 00026 (v01 PTLTD           06040000 PTL  00000003)
[    0.000000] ACPI: APIC 7f6bbf70 00068 (v01 PTLTD  ? APIC   06040000  LTP 00000000)
[    0.000000] ACPI: BOOT 7f6bbfd8 00028 (v01 PTLTD  $SBFTBL$ 06040000  LTP 00000001)
[    0.000000] ACPI: SSDT 7f6b713f 004DC (v02  PmRef    CpuPm 00003000 INTL 20050624)
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] 1148MB HIGHMEM available.
[    0.000000] 889MB LOWMEM available.
[    0.000000]   mapped low ram: 0 - 379fe000
[    0.000000]   low ram: 0 - 379fe000
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000010 -> 0x00001000
[    0.000000]   Normal   0x00001000 -> 0x000379fe
[    0.000000]   HighMem  0x000379fe -> 0x0007f6b0
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[2] active PFN ranges
[    0.000000]     0: 0x00000010 -> 0x00000090
[    0.000000]     0: 0x00000100 -> 0x0007f6b0
[    0.000000] On node 0 totalpages: 521776
[    0.000000] free_area_init_node: node 0, pgdat c13fd980, node_mem_map f6a0d200
[    0.000000]   DMA zone: 32 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 3936 pages, LIFO batch:0
[    0.000000]   Normal zone: 1748 pages used for memmap
[    0.000000]   Normal zone: 221994 pages, LIFO batch:31
[    0.000000]   HighMem zone: 2298 pages used for memmap
[    0.000000]   HighMem zone: 291768 pages, LIFO batch:31
[    0.000000] Using APIC driver default
[    0.000000] ACPI: PM-Timer IO Port: 0x1008
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: IRQ0 used by override.
[    0.000000] ACPI: IRQ2 used by override.
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] SMP: Allowing 2 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 40
[    0.000000] PM: Registered nosave memory: 0000000000090000 - 00000000000a0000
[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000d2000
[    0.000000] PM: Registered nosave memory: 00000000000d2000 - 0000000000100000
[    0.000000] Allocating PCI resources starting at 80000000 (gap: 80000000:60000000)
[    0.000000] Booting paravirtualized kernel on bare hardware
[    0.000000] setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:2 nr_node_ids:1
[    0.000000] PERCPU: Embedded 14 pages/cpu @f6800000 s33088 r0 d24256 u1048576
[    0.000000] pcpu-alloc: s33088 r0 d24256 u1048576 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0 1 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 517698
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.2.0-rc3+ root=UUID=c8369b5c-f8fa-42d3-a640-ed1feff58e85 ro quiet
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Initializing CPU#0
[    0.000000] allocated 8350208 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] Initializing HighMem for node 0 (000379fe:0007f6b0)
[    0.000000] Memory: 2027204k/2087616k available (2852k kernel code, 59900k reserved, 1263k data, 432k init, 1176264k highmem)
[    0.000000] virtual kernel memory layout:
[    0.000000]     fixmap  : 0xffd36000 - 0xfffff000   (2852 kB)
[    0.000000]     pkmap   : 0xffa00000 - 0xffc00000   (2048 kB)
[    0.000000]     vmalloc : 0xf81fe000 - 0xff9fe000   ( 120 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xf79fe000   ( 889 MB)
[    0.000000]       .init : 0xc1406000 - 0xc1472000   ( 432 kB)
[    0.000000]       .data : 0xc12c92ed - 0xc1405200   (1263 kB)
[    0.000000]       .text : 0xc1000000 - 0xc12c92ed   (2852 kB)
[    0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000] NR_IRQS:2304 nr_irqs:512 16
[    0.000000] CPU 0 irqstacks, hard=f6406000 soft=f6408000
[    0.000000] Extended CMOS year: 2000
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [tty0] enabled
[    0.000000] hpet clockevent registered
[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 1994.944 MHz processor.
[    0.004004] Calibrating delay loop (skipped), value calculated using timer frequency.. 3989.88 BogoMIPS (lpj=7979776)
[    0.004012] pid_max: default: 32768 minimum: 301
[    0.004090] Security Framework initialized
[    0.004123] Mount-cache hash table entries: 512
[    0.004324] Initializing cgroup subsys cpuacct
[    0.004334] Initializing cgroup subsys memory
[    0.004348] Initializing cgroup subsys devices
[    0.004353] Initializing cgroup subsys freezer
[    0.004357] Initializing cgroup subsys net_cls
[    0.004362] Initializing cgroup subsys blkio
[    0.004412] CPU: Physical Processor ID: 0
[    0.004416] CPU: Processor Core ID: 0
[    0.004420] mce: CPU supports 5 MCE banks
[    0.004432] CPU0: Thermal monitoring enabled (TM1)
[    0.004439] using mwait in idle threads.
[    0.005498] ACPI: Core revision 20110623
[    0.012104] Enabling APIC mode:  Flat.  Using 1 I/O APICs
[    0.012468] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.054637] CPU0: Intel(R) Atom(TM) CPU Z550   @ 2.00GHz stepping 02
[    0.056003] Performance Events: PEBS fmt0+, Atom events, Intel PMU driver.
[    0.056003] ... version:                3
[    0.056003] ... bit width:              40
[    0.056003] ... generic registers:      2
[    0.056003] ... value mask:             000000ffffffffff
[    0.056003] ... max period:             000000007fffffff
[    0.056003] ... fixed-purpose events:   3
[    0.056003] ... event mask:             0000000700000003
[    0.056003] NMI watchdog enabled, takes one hw-pmu counter.
[    0.056003] CPU 1 irqstacks, hard=f64b4000 soft=f64b6000
[    0.056003] Booting Node   0, Processors  #1 Ok.
[    0.056003] smpboot cpu 1: start_ip = 8c000
[    0.008000] Initializing CPU#1
[    0.144064] NMI watchdog enabled, takes one hw-pmu counter.
[    0.144129] Brought up 2 CPUs
[    0.144135] Total of 2 processors activated (7979.80 BogoMIPS).
[    0.144603] devtmpfs: initialized
[    0.144603] PM: Registering ACPI NVS region at 7f6bc000 (12288 bytes)
[    0.144603] CompuLab SBC-FITPC2 series board detected. Selecting BIOS-method for reboots.
[    0.144603] print_constraints: dummy: 
[    0.144603] NET: Registered protocol family 16
[    0.144665] ACPI: bus type pci registered
[    0.144801] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xe0000000-0xefffffff] (base 0xe0000000)
[    0.144808] PCI: MMCONFIG at [mem 0xe0000000-0xefffffff] reserved in E820
[    0.144811] PCI: Using MMCONFIG for extended config space
[    0.144815] PCI: Using configuration type 1 for base access
[    0.145655] bio: create slab <bio-0> at 0
[    0.145655] ACPI: Added _OSI(Module Device)
[    0.145655] ACPI: Added _OSI(Processor Device)
[    0.145655] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.145655] ACPI: Added _OSI(Processor Aggregator Device)
[    0.148348] ACPI: EC: Look up EC in DSDT
[    0.150627] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[    0.151245] ACPI: SSDT 7f6b7cdf 00287 (v02  PmRef  Cpu0Ist 00003000 INTL 20050624)
[    0.151548] ACPI: Dynamic OEM Table Load:
[    0.151554] ACPI: SSDT   (null) 00287 (v02  PmRef  Cpu0Ist 00003000 INTL 20050624)
[    0.151846] ACPI: SSDT 7f6b761b 0063F (v02  PmRef  Cpu0Cst 00003001 INTL 20050624)
[    0.152130] ACPI: Dynamic OEM Table Load:
[    0.152136] ACPI: SSDT   (null) 0063F (v02  PmRef  Cpu0Cst 00003001 INTL 20050624)
[    0.152577] ACPI: SSDT 7f6b7f66 000D4 (v02  PmRef  Cpu1Ist 00003000 INTL 20050624)
[    0.152862] ACPI: Dynamic OEM Table Load:
[    0.152868] ACPI: SSDT   (null) 000D4 (v02  PmRef  Cpu1Ist 00003000 INTL 20050624)
[    0.153037] ACPI: SSDT 7f6b7c5a 00085 (v02  PmRef  Cpu1Cst 00003000 INTL 20050624)
[    0.153306] ACPI: Dynamic OEM Table Load:
[    0.153311] ACPI: SSDT   (null) 00085 (v02  PmRef  Cpu1Cst 00003000 INTL 20050624)
[    0.352171] ACPI: Interpreter enabled
[    0.352196] ACPI: (supports S0 S3 S4 S5)
[    0.352277] ACPI: Using IOAPIC for interrupt routing
[    0.353561] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness
[    0.360002] ACPI: EC: GPE = 0xd, I/O: command/status = 0x66, data = 0x62
[    0.360252] ACPI: No dock devices found.
[    0.360257] HEST: Table not found.
[    0.360266] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.360419] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.360715] pci_root PNP0A08:00: host bridge window [io  0x0000-0x0cf7]
[    0.360722] pci_root PNP0A08:00: host bridge window [io  0x0d00-0xffff]
[    0.360727] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
[    0.360733] pci_root PNP0A08:00: host bridge window [mem 0x000c0000-0x000dffff]
[    0.360738] pci_root PNP0A08:00: host bridge window [mem 0x000e0000-0x000effff]
[    0.360743] pci_root PNP0A08:00: host bridge window [mem 0x000f0000-0x000fffff]
[    0.360749] pci_root PNP0A08:00: host bridge window [mem 0x7f800000-0xfebfffff]
[    0.360761] pci_root PNP0A08:00: ignoring host bridge window [mem 0x000c0000-0x000dffff] (conflicts with reserved [mem 0x000d2000-0x000fffff])
[    0.360783] pci 0000:00:00.0: [8086:8100] type 0 class 0x000600
[    0.360863] pci 0000:00:02.0: [8086:8108] type 0 class 0x000300
[    0.360885] pci 0000:00:02.0: reg 10: [mem 0xd8080000-0xd80fffff]
[    0.360898] pci 0000:00:02.0: reg 14: [io  0x1800-0x1807]
[    0.360910] pci 0000:00:02.0: reg 18: [mem 0xd0000000-0xd7ffffff]
[    0.360922] pci 0000:00:02.0: reg 1c: [mem 0xd8020000-0xd803ffff]
[    0.361020] pci 0000:00:1b.0: [8086:811b] type 0 class 0x000403
[    0.361039] pci 0000:00:1b.0: reg 10: [mem 0xd8010000-0xd8013fff 64bit]
[    0.361098] pci 0000:00:1b.0: PME# supported from D0 D3hot
[    0.361105] pci 0000:00:1b.0: PME# disabled
[    0.361132] pci 0000:00:1c.0: [8086:8110] type 1 class 0x000604
[    0.361189] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[    0.361195] pci 0000:00:1c.0: PME# disabled
[    0.361225] pci 0000:00:1c.1: [8086:8112] type 1 class 0x000604
[    0.361282] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
[    0.361288] pci 0000:00:1c.1: PME# disabled
[    0.361319] pci 0000:00:1d.0: [8086:8114] type 0 class 0x000c03
[    0.361359] pci 0000:00:1d.0: reg 20: [io  0x1820-0x183f]
[    0.361394] pci 0000:00:1d.1: [8086:8115] type 0 class 0x000c03
[    0.361434] pci 0000:00:1d.1: reg 20: [io  0x1840-0x185f]
[    0.361471] pci 0000:00:1d.2: [8086:8116] type 0 class 0x000c03
[    0.361512] pci 0000:00:1d.2: reg 20: [io  0x1860-0x187f]
[    0.361562] pci 0000:00:1d.7: [8086:8117] type 0 class 0x000c03
[    0.361591] pci 0000:00:1d.7: reg 10: [mem 0xd8014000-0xd80143ff]
[    0.361692] pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold
[    0.361700] pci 0000:00:1d.7: PME# disabled
[    0.361725] pci 0000:00:1e.0: [8086:811c] type 0 class 0x000805
[    0.361741] pci 0000:00:1e.0: reg 10: [mem 0xd8014400-0xd80144ff]
[    0.361805] pci 0000:00:1e.1: [8086:811d] type 0 class 0x000805
[    0.361821] pci 0000:00:1e.1: reg 10: [mem 0xd8014800-0xd80148ff]
[    0.361886] pci 0000:00:1e.2: [8086:811e] type 0 class 0x000805
[    0.361902] pci 0000:00:1e.2: reg 10: [mem 0xd8014c00-0xd8014cff]
[    0.361973] pci 0000:00:1f.0: [8086:8119] type 0 class 0x000601
[    0.362047] pci 0000:00:1f.1: [8086:811a] type 0 class 0x000101
[    0.362090] pci 0000:00:1f.1: reg 20: [io  0x1810-0x181f]
[    0.362186] pci 0000:02:00.0: [10ec:8168] type 0 class 0x000200
[    0.362208] pci 0000:02:00.0: reg 10: [io  0x2000-0x20ff]
[    0.362242] pci 0000:02:00.0: reg 18: [mem 0xd8100000-0xd8100fff 64bit]
[    0.362265] pci 0000:02:00.0: reg 20: [mem 0xd8500000-0xd850ffff 64bit pref]
[    0.362282] pci 0000:02:00.0: reg 30: [mem 0x00000000-0x0001ffff pref]
[    0.362327] pci 0000:02:00.0: supports D1 D2
[    0.362332] pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.362340] pci 0000:02:00.0: PME# disabled
[    0.368069] pci 0000:00:1c.0: PCI bridge to [bus 02-02]
[    0.368086] pci 0000:00:1c.0:   bridge window [io  0x2000-0x2fff]
[    0.368113] pci 0000:00:1c.0:   bridge window [mem 0xd8100000-0xd81fffff]
[    0.368129] pci 0000:00:1c.0:   bridge window [mem 0xd8500000-0xd85fffff pref]
[    0.368249] pci 0000:03:00.0: [10ec:8168] type 0 class 0x000200
[    0.368286] pci 0000:03:00.0: reg 10: [io  0x3000-0x30ff]
[    0.368342] pci 0000:03:00.0: reg 18: [mem 0xd8200000-0xd8200fff 64bit]
[    0.368365] pci 0000:03:00.0: reg 20: [mem 0xd8600000-0xd860ffff 64bit pref]
[    0.368382] pci 0000:03:00.0: reg 30: [mem 0x00000000-0x0001ffff pref]
[    0.368429] pci 0000:03:00.0: supports D1 D2
[    0.368433] pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.368441] pci 0000:03:00.0: PME# disabled
[    0.376065] pci 0000:00:1c.1: PCI bridge to [bus 03-03]
[    0.376081] pci 0000:00:1c.1:   bridge window [io  0x3000-0x3fff]
[    0.376097] pci 0000:00:1c.1:   bridge window [mem 0xd8200000-0xd82fffff]
[    0.376113] pci 0000:00:1c.1:   bridge window [mem 0xd8600000-0xd86fffff pref]
[    0.376142] pci_bus 0000:00: on NUMA node 0
[    0.376162] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
[    0.376480] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP01._PRT]
[    0.376574] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.RP02._PRT]
[    0.376727]  pci0000:00: Requesting ACPI _OSC control (0x1d)
[    0.376734]  pci0000:00: ACPI _OSC request failed (AE_NOT_FOUND), returned control mask: 0x1d
[    0.376738] ACPI _OSC control for PCIe not granted, disabling ASPM
[    0.382772] ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 *7 10 12 14 15)
[    0.382876] ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 *4 5 6 7 11 12 14 15)
[    0.382976] ACPI: PCI Interrupt Link [LNKC] (IRQs 1 *3 4 5 6 7 10 12 14 15)
[    0.383075] ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 *5 6 7 11 12 14 15)
[    0.383174] ACPI: PCI Interrupt Link [LNKE] (IRQs 1 3 4 5 6 7 10 12 14 15) *11
[    0.383276] ACPI: PCI Interrupt Link [LNKF] (IRQs 1 3 4 5 6 7 *11 12 14 15)
[    0.383375] ACPI: PCI Interrupt Link [LNKG] (IRQs 1 3 4 5 6 7 *10 12 14 15)
[    0.383475] ACPI: PCI Interrupt Link [LNKH] (IRQs 1 3 4 5 6 7 11 12 14 15) *10
[    0.383689] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[    0.383689] vgaarb: loaded
[    0.383689] vgaarb: bridge control possible 0000:00:02.0
[    0.383689] PCI: Using ACPI for IRQ routing
[    0.391026] PCI: pci_cache_line_size set to 64 bytes
[    0.391112] Expanded resource reserved due to conflict with PCI Bus 0000:00
[    0.391118] reserve RAM buffer: 000000007f6b0000 - 000000007fffffff 
[    0.391349] HPET: 3 timers in total, 0 timers will be used for per-cpu timer
[    0.391358] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.391367] hpet0: 3 comparators, 64-bit 14.318180 MHz counter
[    0.396192] Switching to clocksource hpet
[    0.399102] pnp: PnP ACPI init
[    0.399149] ACPI: bus type pnp registered
[    0.399445] pnp 00:00: [bus 00-ff]
[    0.399451] pnp 00:00: [io  0x0000-0x0cf7 window]
[    0.399457] pnp 00:00: [io  0x0cf8-0x0cff]
[    0.399461] pnp 00:00: [io  0x0d00-0xffff window]
[    0.399467] pnp 00:00: [mem 0x000a0000-0x000bffff window]
[    0.399472] pnp 00:00: [mem 0x000c0000-0x000dffff window]
[    0.399477] pnp 00:00: [mem 0x000e0000-0x000effff window]
[    0.399482] pnp 00:00: [mem 0x000f0000-0x000fffff window]
[    0.399487] pnp 00:00: [mem 0x7f800000-0xfebfffff window]
[    0.399492] pnp 00:00: [mem 0xfed40000-0xfed44fff window]
[    0.399608] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
[    0.399684] pnp 00:01: [mem 0xfd000000-0xfd003fff]
[    0.399690] pnp 00:01: [mem 0xe0000000-0xefffffff]
[    0.399695] pnp 00:01: [mem 0xfed00000-0xfed3ffff]
[    0.399700] pnp 00:01: [mem 0xfed40000-0xfed44fff]
[    0.399704] pnp 00:01: [mem 0xfed45000-0xfed4bfff]
[    0.399804] system 00:01: [mem 0xfd000000-0xfd003fff] has been reserved
[    0.399811] system 00:01: [mem 0xe0000000-0xefffffff] has been reserved
[    0.399817] system 00:01: [mem 0xfed00000-0xfed3ffff] could not be reserved
[    0.399823] system 00:01: [mem 0xfed40000-0xfed44fff] has been reserved
[    0.399830] system 00:01: [mem 0xfed45000-0xfed4bfff] has been reserved
[    0.399838] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
[    0.400184] pnp 00:02: [io  0x0000-0x001f]
[    0.400189] pnp 00:02: [io  0x0081-0x0091]
[    0.400194] pnp 00:02: [io  0x0093-0x009f]
[    0.400198] pnp 00:02: [io  0x00c0-0x00df]
[    0.400203] pnp 00:02: [dma 4]
[    0.400276] pnp 00:02: Plug and Play ACPI device, IDs PNP0200 (active)
[    0.400297] pnp 00:03: [mem 0xff000000-0xffffffff]
[    0.400366] pnp 00:03: Plug and Play ACPI device, IDs INT0800 (active)
[    0.400431] pnp 00:04: [irq 0 disabled]
[    0.400453] pnp 00:04: [irq 8]
[    0.400458] pnp 00:04: [mem 0xfed00000-0xfed003ff]
[    0.400528] pnp 00:04: Plug and Play ACPI device, IDs PNP0103 (active)
[    0.400557] pnp 00:05: [io  0x00f0]
[    0.400567] pnp 00:05: [irq 13]
[    0.400636] pnp 00:05: Plug and Play ACPI device, IDs PNP0c04 (active)
[    0.400662] pnp 00:06: [io  0x002e-0x002f]
[    0.400667] pnp 00:06: [io  0x004e-0x004f]
[    0.400671] pnp 00:06: [io  0x0061]
[    0.400675] pnp 00:06: [io  0x0063]
[    0.400680] pnp 00:06: [io  0x0065]
[    0.400684] pnp 00:06: [io  0x0067]
[    0.400691] pnp 00:06: [io  0x0070]
[    0.400695] pnp 00:06: [io  0x0080]
[    0.400699] pnp 00:06: [io  0x0092]
[    0.400703] pnp 00:06: [io  0x00b2-0x00b3]
[    0.400708] pnp 00:06: [io  0x0295-0x0296]
[    0.400712] pnp 00:06: [io  0x0680-0x069f]
[    0.400717] pnp 00:06: [io  0x8080]
[    0.400721] pnp 00:06: [io  0x1000-0x107f]
[    0.400726] pnp 00:06: [io  0x1180-0x11bf]
[    0.400730] pnp 00:06: [io  0x1640-0x164f]
[    0.400843] system 00:06: [io  0x0295-0x0296] has been reserved
[    0.400849] system 00:06: [io  0x0680-0x069f] has been reserved
[    0.400855] system 00:06: [io  0x8080] has been reserved
[    0.400861] system 00:06: [io  0x1000-0x107f] has been reserved
[    0.400867] system 00:06: [io  0x1180-0x11bf] has been reserved
[    0.400872] system 00:06: [io  0x1640-0x164f] has been reserved
[    0.400879] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
[    0.400930] pnp 00:07: [io  0x0070-0x0073]
[    0.401000] pnp 00:07: Plug and Play ACPI device, IDs PNP0b00 (active)
[    0.401167] pnp 00:08: [io  0x002e-0x002f]
[    0.401173] pnp 00:08: [io  0x0000-0xffffffffffffffff disabled]
[    0.401273] system 00:08: Plug and Play ACPI device, IDs PNP0c02 (active)
[    0.401742] pnp 00:09: [io  0x03f8-0x03ff]
[    0.401754] pnp 00:09: [irq 4]
[    0.402071] pnp 00:09: Plug and Play ACPI device, IDs PNP0501 (active)
[    0.402097] pnp: PnP ACPI: found 10 devices
[    0.402101] ACPI: ACPI bus type pnp unregistered
[    0.402108] PnPBIOS: Disabled by ACPI PNP
[    0.441970] PCI: max bus depth: 1 pci_try_num: 2
[    0.442004] pci 0000:02:00.0: BAR 6: assigned [mem 0xd8520000-0xd853ffff pref]
[    0.442010] pci 0000:00:1c.0: PCI bridge to [bus 02-02]
[    0.442016] pci 0000:00:1c.0:   bridge window [io  0x2000-0x2fff]
[    0.442025] pci 0000:00:1c.0:   bridge window [mem 0xd8100000-0xd81fffff]
[    0.442032] pci 0000:00:1c.0:   bridge window [mem 0xd8500000-0xd85fffff pref]
[    0.442044] pci 0000:03:00.0: BAR 6: assigned [mem 0xd8620000-0xd863ffff pref]
[    0.442049] pci 0000:00:1c.1: PCI bridge to [bus 03-03]
[    0.442055] pci 0000:00:1c.1:   bridge window [io  0x3000-0x3fff]
[    0.442063] pci 0000:00:1c.1:   bridge window [mem 0xd8200000-0xd82fffff]
[    0.442070] pci 0000:00:1c.1:   bridge window [mem 0xd8600000-0xd86fffff pref]
[    0.442110] pci 0000:00:1c.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    0.442118] pci 0000:00:1c.0: setting latency timer to 64
[    0.442135] pci 0000:00:1c.1: PCI INT B -> GSI 16 (level, low) -> IRQ 16
[    0.442142] pci 0000:00:1c.1: setting latency timer to 64
[    0.442150] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
[    0.442155] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
[    0.442160] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
[    0.442166] pci_bus 0000:00: resource 7 [mem 0x000e0000-0x000effff]
[    0.442171] pci_bus 0000:00: resource 8 [mem 0x000f0000-0x000fffff]
[    0.442176] pci_bus 0000:00: resource 9 [mem 0x7f800000-0xfebfffff]
[    0.442182] pci_bus 0000:02: resource 0 [io  0x2000-0x2fff]
[    0.442187] pci_bus 0000:02: resource 1 [mem 0xd8100000-0xd81fffff]
[    0.442192] pci_bus 0000:02: resource 2 [mem 0xd8500000-0xd85fffff pref]
[    0.442197] pci_bus 0000:03: resource 0 [io  0x3000-0x3fff]
[    0.442203] pci_bus 0000:03: resource 1 [mem 0xd8200000-0xd82fffff]
[    0.442208] pci_bus 0000:03: resource 2 [mem 0xd8600000-0xd86fffff pref]
[    0.442331] NET: Registered protocol family 2
[    0.442456] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.443002] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.444129] TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
[    0.444719] TCP: Hash tables configured (established 131072 bind 65536)
[    0.444726] TCP reno registered
[    0.444734] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.444760] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.445057] NET: Registered protocol family 1
[    0.445101] pci 0000:00:02.0: Boot video device
[    0.445233] PCI: CLS 64 bytes, default 64
[    0.445359] Unpacking initramfs...
[    1.710733] Freeing initrd memory: 29292k freed
[    1.749307] Simple Boot Flag at 0x36 set to 0x1
[    1.750224] audit: initializing netlink socket (disabled)
[    1.750251] type=2000 audit(1322593573.744:1): initialized
[    1.776285] highmem bounce pool size: 64 pages
[    1.776295] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    1.786376] VFS: Disk quotas dquot_6.5.2
[    1.786438] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.786564] msgmni has been set to 1719
[    1.786864] alg: No test for stdrng (krng)
[    1.786929] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    1.786935] io scheduler noop registered
[    1.786939] io scheduler deadline registered
[    1.786966] io scheduler cfq registered (default)
[    1.787418] intel_idle: MWAIT substates: 0x3020220
[    1.787431] intel_idle: v0.4 model 0x1C
[    1.787434] intel_idle: lapic_timer_reliable_states 0x2
[    1.787439] Marking TSC unstable due to TSC halts in idle states deeper than C2
[    1.787526] ERST: Table is not found!
[    1.787529] GHES: HEST is not enabled!
[    1.787557] isapnp: Scanning for PnP cards...
[    2.141677] isapnp: No Plug & Play device found
[    2.141827] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    2.162261] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    2.185012] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    2.200569] Linux agpgart interface v0.103
[    2.200981] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    2.202877] serio: i8042 KBD port at 0x60,0x64 irq 1
[    2.202891] serio: i8042 AUX port at 0x60,0x64 irq 12
[    2.203180] mousedev: PS/2 mouse device common for all mice
[    2.203267] rtc_cmos 00:07: RTC can wake from S4
[    2.203419] rtc_cmos 00:07: rtc core: registered rtc_cmos as rtc0
[    2.203448] rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
[    2.203652] cpuidle: using governor ladder
[    2.203955] cpuidle: using governor menu
[    2.204473] TCP cubic registered
[    2.204569] NET: Registered protocol family 10
[    2.205715] Mobile IPv6
[    2.205721] NET: Registered protocol family 17
[    2.205730] Registering the dns_resolver key type
[    2.205771] Using IPI No-Shortcut mode
[    2.206046] PM: Hibernation image not present or could not be loaded.
[    2.206066] registered taskstats version 1
[    2.211447] rtc_cmos 00:07: setting system clock to 2011-11-29 19:06:14 UTC (1322593574)
[    2.211553] Initializing network drop monitor service
[    2.211773] Freeing unused kernel memory: 432k freed
[    2.212234] Write protecting the kernel text: 2856k
[    2.212283] Write protecting the kernel read-only data: 1004k
[    2.212288] NX-protecting the kernel data: 3288k
[    2.241196] udev[49]: starting version 164
[    2.373132] r8169 Gigabit Ethernet driver 2.3LK-NAPI-patched loaded
[    2.373184] r8169 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    2.373233] r8169 0000:02:00.0: setting latency timer to 64
[    2.373313] r8169 0000:02:00.0: irq 40 for MSI/MSI-X
[    2.374681] r8169 0000:02:00.0: eth0: RTL8168c/8111c[21] at 0xf93d0000, 00:01:c0:08:aa:31, XID 1c4000c0 IRQ 40
[    2.374692] r8169 0000:02:00.0: eth0: jumbo features [frames: 6128 bytes, tx checksumming: ko]
[    2.399586] sdhci: Secure Digital Host Controller Interface driver
[    2.399593] sdhci: Copyright(c) Pierre Ossman
[    2.413764] sdhci-pci 0000:00:1e.0: SDHCI controller found [8086:811c] (rev 7)
[    2.413818] sdhci-pci 0000:00:1e.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[    2.413878] sdhci-pci 0000:00:1e.0: setting latency timer to 64
[    2.413926] mmc0: no vmmc regulator found
[    2.414010] Registered led device: mmc0::
[    2.415106] mmc0: SDHCI controller on PCI [0000:00:1e.0] using DMA
[    2.415282] thermal LNXTHERM:00: registered as thermal_zone0
[    2.415288] ACPI: Thermal Zone [TZ00] (0 C)
[    2.415843] ACPI: Invalid active0 threshold
[    2.422303] thermal LNXTHERM:01: registered as thermal_zone1
[    2.422311] ACPI: Thermal Zone [TZ01] (0 C)
[    2.427431] SCSI subsystem initialized
[    2.431622] r8169 Gigabit Ethernet driver 2.3LK-NAPI-patched loaded
[    2.431676] r8169 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    2.431733] r8169 0000:03:00.0: setting latency timer to 64
[    2.431811] r8169 0000:03:00.0: irq 41 for MSI/MSI-X
[    2.433956] sdhci-pci 0000:00:1e.1: SDHCI controller found [8086:811d] (rev 7)
[    2.434010] sdhci-pci 0000:00:1e.1: PCI INT B -> GSI 20 (level, low) -> IRQ 20
[    2.434073] sdhci-pci 0000:00:1e.1: setting latency timer to 64
[    2.434115] mmc1: no vmmc regulator found
[    2.434191] Registered led device: mmc1::
[    2.435277] mmc1: SDHCI controller on PCI [0000:00:1e.1] using DMA
[    2.435292] r8169 0000:03:00.0: eth1: RTL8168c/8111c[21] at 0xf838c000, 00:01:c0:08:aa:32, XID 1c4000c0 IRQ 41
[    2.435301] r8169 0000:03:00.0: eth1: jumbo features [frames: 6128 bytes, tx checksumming: ko]
[    2.435308] sdhci-pci 0000:00:1e.2: SDHCI controller found [8086:811e] (rev 7)
[    2.435341] sdhci-pci 0000:00:1e.2: PCI INT C -> GSI 18 (level, low) -> IRQ 18
[    2.435387] sdhci-pci 0000:00:1e.2: setting latency timer to 64
[    2.435424] mmc2: no vmmc regulator found
[    2.435504] Registered led device: mmc2::
[    2.437722] usbcore: registered new interface driver usbfs
[    2.437787] usbcore: registered new interface driver hub
[    2.448176] usbcore: registered new device driver usb
[    2.450507] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.454753] mmc2: SDHCI controller on PCI [0000:00:1e.2] using DMA
[    2.461198] ehci_hcd 0000:00:1d.7: PCI INT D -> GSI 21 (level, low) -> IRQ 21
[    2.461245] ehci_hcd 0000:00:1d.7: setting latency timer to 64
[    2.461255] ehci_hcd 0000:00:1d.7: EHCI Host Controller
[    2.461314] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1
[    2.461378] ehci_hcd 0000:00:1d.7: debug port 1
[    2.465282] ehci_hcd 0000:00:1d.7: cache line size of 64 is not supported
[    2.477570] ehci_hcd 0000:00:1d.7: irq 21, io mem 0xd8014000
[    2.484064] libata version 3.00 loaded.
[    2.492061] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00
[    2.492158] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    2.492167] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.492173] usb usb1: Product: EHCI Host Controller
[    2.492179] usb usb1: Manufacturer: Linux 3.2.0-rc3+ ehci_hcd
[    2.492184] usb usb1: SerialNumber: 0000:00:1d.7
[    2.492525] hub 1-0:1.0: USB hub found
[    2.492541] hub 1-0:1.0: 8 ports detected
[    2.494637] uhci_hcd: USB Universal Host Controller Interface driver
[    2.494760] uhci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[    2.494784] uhci_hcd 0000:00:1d.0: setting latency timer to 64
[    2.494794] uhci_hcd 0000:00:1d.0: UHCI Host Controller
[    2.494827] uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
[    2.494897] uhci_hcd 0000:00:1d.0: irq 23, io base 0x00001820
[    2.494993] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    2.495001] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.495008] usb usb2: Product: UHCI Host Controller
[    2.495014] usb usb2: Manufacturer: Linux 3.2.0-rc3+ uhci_hcd
[    2.495020] usb usb2: SerialNumber: 0000:00:1d.0
[    2.495346] hub 2-0:1.0: USB hub found
[    2.495357] hub 2-0:1.0: 2 ports detected
[    2.495531] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[    2.495546] uhci_hcd 0000:00:1d.1: setting latency timer to 64
[    2.495552] uhci_hcd 0000:00:1d.1: UHCI Host Controller
[    2.495569] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3
[    2.495620] uhci_hcd 0000:00:1d.1: irq 19, io base 0x00001840
[    2.495689] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    2.495694] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.495699] usb usb3: Product: UHCI Host Controller
[    2.495703] usb usb3: Manufacturer: Linux 3.2.0-rc3+ uhci_hcd
[    2.495707] usb usb3: SerialNumber: 0000:00:1d.1
[    2.495967] hub 3-0:1.0: USB hub found
[    2.495977] hub 3-0:1.0: 2 ports detected
[    2.496234] uhci_hcd 0000:00:1d.2: PCI INT C -> GSI 18 (level, low) -> IRQ 18
[    2.496254] uhci_hcd 0000:00:1d.2: setting latency timer to 64
[    2.496262] uhci_hcd 0000:00:1d.2: UHCI Host Controller
[    2.496282] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4
[    2.496323] uhci_hcd 0000:00:1d.2: irq 18, io base 0x00001860
[    2.496411] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    2.496419] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.496426] usb usb4: Product: UHCI Host Controller
[    2.496431] usb usb4: Manufacturer: Linux 3.2.0-rc3+ uhci_hcd
[    2.496437] usb usb4: SerialNumber: 0000:00:1d.2
[    2.497386] hub 4-0:1.0: USB hub found
[    2.497403] hub 4-0:1.0: 2 ports detected
[    2.498183] pata_sch 0000:00:1f.1: version 0.2
[    2.498303] pata_sch 0000:00:1f.1: setting latency timer to 64
[    2.499599] scsi0 : pata_sch
[    2.499905] scsi1 : pata_sch
[    2.500690] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x1810 irq 14
[    2.500699] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1818 irq 15
[    2.664865] ata1.00: ATA-8: Hitachi HTE545050B9A300, PB4OC64G, max UDMA/133
[    2.664875] ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 0/32)
[    2.680854] ata1.00: configured for UDMA/100
[    2.681116] scsi 0:0:0:0: Direct-Access     ATA      Hitachi HTE54505 PB4O PQ: 0 ANSI: 5
[    2.804316] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[    2.858028] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    2.858215] sd 0:0:0:0: [sda] Write Protect is off
[    2.858224] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.858304] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.888120]  sda: sda1 sda2 sda3
[    2.889272] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.937824] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[    2.937846] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.937862] usb 1-1: Product: USB2.0 Hub
[    2.938918] hub 1-1:1.0: USB hub found
[    2.939294] hub 1-1:1.0: 4 ports detected
[    3.052100] usb 1-2: new high-speed USB device number 3 using ehci_hcd
[    3.185105] usb 1-2: New USB device found, idVendor=0409, idProduct=005a
[    3.185114] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.185683] hub 1-2:1.0: USB hub found
[    3.185775] hub 1-2:1.0: 4 ports detected
[    3.296051] usb 1-7: new high-speed USB device number 4 using ehci_hcd
[    3.323755] PM: Starting manual resume from disk
[    3.323762] PM: Hibernation image partition 8:2 present
[    3.323766] PM: Looking for hibernation image.
[    3.324238] PM: Image not found (code -22)
[    3.324248] PM: Hibernation image not present or could not be loaded.
[    3.444138] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[    3.445439] usb 1-7: New USB device found, idVendor=148f, idProduct=3070
[    3.445450] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.445457] usb 1-7: Product: 802.11 n WLAN
[    3.445462] usb 1-7: Manufacturer: Ralink
[    3.445468] usb 1-7: SerialNumber: 1.0
[    3.520747] usb 1-1.1: new high-speed USB device number 5 using ehci_hcd
[    3.614733] usb 1-1.1: New USB device found, idVendor=05e3, idProduct=0608
[    3.614752] usb 1-1.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.614766] usb 1-1.1: Product: USB2.0 Hub
[    3.615643] hub 1-1.1:1.0: USB hub found
[    3.616104] hub 1-1.1:1.0: 4 ports detected
[    3.704708] usb 1-2.4: new low-speed USB device number 6 using ehci_hcd
[    3.875127] usb 1-2.4: New USB device found, idVendor=0557, idProduct=2213
[    3.875147] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.875160] usb 1-2.4: Product: CS1784
[    3.875170] usb 1-2.4: Manufacturer: ATEN
[    3.952749] usb 1-1.1.1: new full-speed USB device number 7 using ehci_hcd
[    4.046154] usb 1-1.1.1: New USB device found, idVendor=03eb, idProduct=204b
[    4.046164] usb 1-1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.046170] usb 1-1.1.1: Product: CUL868
[    4.046175] usb 1-1.1.1: Manufacturer: busware.de
[    5.494821] udev[269]: starting version 164
[    6.391381] ACPI: AC Adapter [ADP1] (on-line)
[    6.394203] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0
[    6.394219] ACPI: Power Button [PWRB]
[    6.394434] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
[    6.394448] ACPI: Power Button [PWRF]
[    6.394463] ACPI Error: Could not enable PowerButton event (20110623/evxfevnt-199)
[    6.394474] ACPI Warning: Could not enable fixed event 0x2 (20110623/evxface-198)
[    6.409361] input: PC Speaker as /devices/platform/pcspkr/input/input2
[    6.416384] button: probe of LNXPWRBN:00 failed with error -22
[    6.531189] ACPI: Battery Slot [BAT0] (battery absent)
[    6.531254] ACPI: Battery Slot [BAT1] (battery absent)
[    6.531317] ACPI: Battery Slot [BAT2] (battery absent)
[    6.709244] cdc_acm 1-1.1.1:1.0: ttyACM0: USB ACM device
[    6.710196] usbcore: registered new interface driver cdc_acm
[    6.710216] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    7.062048] cfg80211: Calling CRDA to update world regulatory domain
[    7.694749] [drm] Initialized drm 1.1.0 20060810
[    8.155838] input: ATEN CS1784 as /devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2.4/1-2.4:1.0/input/input3
[    8.156228] generic-usb 0003:0557:2213.0001: input,hidraw0: USB HID v1.00 Keyboard [ATEN CS1784] on usb-0000:00:1d.7-2.4/input0
[    8.180903] input: ATEN CS1784 as /devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2.4/1-2.4:1.1/input/input4
[    8.182032] generic-usb 0003:0557:2213.0002: input,hidraw1: USB HID v1.00 Mouse [ATEN CS1784] on usb-0000:00:1d.7-2.4/input1
[    8.182415] usbcore: registered new interface driver usbhid
[    8.182422] usbhid: USB HID core driver
[    8.185621] snd_hda_intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[    8.185692] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[    8.476755] hda_codec: ALC662 rev1: SKU not ready 0x411111f0
[    8.478960] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/input/input5
[    8.483610] input: HDA Intel MID Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input6
[    8.516422] psb_gfx: module is from the staging directory, the quality is unknown, you have been warned.
[    8.520574] gma500 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    8.520586] gma500 0000:00:02.0: setting latency timer to 64
[    8.521453] ioremap error for 0x7f6bc000-0x7f6bf000, requested 0x10, got 0x0
[    8.521677] Stolen memory information
[    8.521683]        base in RAM: 0x7f800000
[    8.521688]        size: 8060K, calculated by (GTT RAM base) - (Stolen base), seems wrong
[    8.521694]       the correct size should be: 8M(dvmt mode=3)
[    8.524340] Set up 2015 stolen pages starting at 0x7f800000, GTT offset 0K
[    8.524518] [drm] SGX core id = 0x01130000
[    8.524524] [drm] SGX core rev major = 0x01, minor = 0x02
[    8.524529] [drm] SGX core rev maintenance = 0x01, designer = 0x00
[    8.540571] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness
[    8.620705] acpi device:05: registered as cooling_device2
[    8.672686] acpi device:06: registered as cooling_device3
[    8.673081] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:00/input/input7
[    8.673371] ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[    8.673451] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[    8.673456] [drm] No driver support for vblank timestamp query.
[    8.788053] usb 1-7: reset high-speed USB device number 4 using ehci_hcd
[    9.016823] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    9.018715] Registered led device: rt2800usb-phy0::radio
[    9.018785] Registered led device: rt2800usb-phy0::assoc
[    9.018856] Registered led device: rt2800usb-phy0::quality
[    9.018941] usbcore: registered new interface driver rt2800usb
[    9.506796] Raw EDID:
[    9.506855]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.506914]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.506972]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.507030]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.507088]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.507145]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.507203]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.507261]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    9.507323] gma500 0000:00:02.0: LVDS-1: EDID block 0 invalid.
[   10.689641] Raw EDID:
[   10.689699]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.689758]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.689816]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.689874]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.689932]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.689990]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.690047]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.690105]  	00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.690186] gma500 0000:00:02.0: LVDS-1: EDID block 0 invalid.
[   10.736995] gma500 0000:00:02.0: allocated 1024x768 fb
[   10.737183] fbcon: psbfb (fb0) is primary device
[   11.150278] Console: switching to colour frame buffer device 128x48
[   11.157488] fb0: psbfb frame buffer device
[   11.157491] drm: registered panic notifier
[   11.157609] gma500 0000:00:02.0: Backlight lvds set brightness 7a120000
[   11.157619] [drm] Initialized gma500 1.0.0 2011-06-06 for 0000:00:02.0 on minor 0
[   11.639469] Adding 3906556k swap on /dev/sda2.  Priority:-1 extents:1 across:3906556k 
[   11.646926] EXT4-fs (sda3): re-mounted. Opts: (null)
[   11.934184] EXT4-fs (sda3): re-mounted. Opts: errors=remount-ro
[   12.150401] loop: module loaded
[   14.522369] r8169 0000:02:00.0: eth0: link down
[   14.522773] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   14.671742] r8169 0000:03:00.0: eth1: link down
[   14.672169] ADDRCONF(NETDEV_UP): eth1: link is not ready
[   15.905781] fuse init (API version 7.17)
[   20.739159] RPC: Registered named UNIX socket transport module.
[   20.739165] RPC: Registered udp transport module.
[   20.739169] RPC: Registered tcp transport module.
[   20.739172] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   22.696401] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   23.736879] svc: failed to register lockdv1 RPC service (errno 97).
[   23.736974] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[   23.883115] NFSD: starting 90-second grace period
[   27.350333] sshd (1622): /proc/1622/oom_adj is deprecated, please use /proc/1622/oom_score_adj instead.

^ permalink raw reply

* is non-inheritance of congestion control algorithm from the listen socket a bug or a feature?
From: Rick Jones @ 2011-11-29 20:03 UTC (permalink / raw)
  To: netdev

Dave Taht asked me if I would consider adding control/reporting of the 
congestion control algorithm to netperf.  I'm in the midst of doing that 
and have noticed that setting a valid congestion control algorithm on a 
listen endpoint does not seem to be inherited by subsequent connections. 
  Rather than rely on netperf/netserver I cobbled-together a quick test 
program to show what I mean.

raj@raj-ubuntu-guest:~$ uname -a
Linux raj-ubuntu-guest 3.2.0-rc2+ #1 SMP Mon Nov 28 16:39:21 PST 2011 
x86_64 x86_64 x86_64 GNU/Linux

raj@raj-ubuntu-guest:~$ find /proc -name "*cong*" -print -exec cat {} \; 
2>/dev/null
/proc/sys/net/ipv4/tcp_congestion_control
cubic
/proc/sys/net/ipv4/tcp_available_congestion_control
cubic reno
/proc/sys/net/ipv4/tcp_allowed_congestion_control
cubic reno


# first just report what one gets
raj@raj-ubuntu-guest:~$ ./tcp_congestion_test
Will make no request to set congestion control algorithm
active socket has '' for congestion control
passive socket has '' for congestion control
after listen() passive socket has '' for congestion control
after connect() active has 'cubic' for congestion control
after accept() accepted has 'cubic' for congestion control

# now specify a valid alternative
raj@raj-ubuntu-guest:~$ ./tcp_congestion_test  reno
Will be requesting 'reno' as the congestion control algorithm
active socket has 'reno' for congestion control
passive socket has 'reno' for congestion control
after listen() passive socket has 'reno' for congestion control
after connect() active has 'reno' for congestion control
after accept() accepted has 'cubic' for congestion control

# now specify an invalid alternative just for completeness
raj@raj-ubuntu-guest:~$ ./tcp_congestion_test  bogus
Will be requesting 'bogus' as the congestion control algorithm
active socket has '' for congestion control
passive socket has '' for congestion control
after listen() passive socket has '' for congestion control
after connect() active has 'cubic' for congestion control
after accept() accepted has 'cubic' for congestion control

Is the non-inheritance of the congestion control algorithm a bug or a 
feature?

rick jones

^ permalink raw reply

* Re: [PATCH] can: Update logging style
From: Marc Kleine-Budde @ 2011-11-29 20:06 UTC (permalink / raw)
  To: Joe Perches
  Cc: Oliver Hartkopp, Urs Thuermann, David S. Miller, linux-can,
	netdev, linux-kernel
In-Reply-To: <30551d0a6a0f7f7799a6981c81c770a528f430d2.1322592708.git.joe@perches.com>

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

On 11/29/2011 07:54 PM, Joe Perches wrote:
> Use pr_fmt, pr_<level> and pr_<level>_ratelimited.
> Coalesce format strings.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

The banners will probably looking a bit different, but I think nobody is
screen scraping that output :)

Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  net/can/af_can.c |   31 ++++++++++++++-----------------
>  net/can/bcm.c    |   14 ++++++++------
>  net/can/gw.c     |    6 ++++--
>  net/can/proc.c   |    8 ++++----
>  net/can/raw.c    |    8 +++++---
>  5 files changed, 35 insertions(+), 32 deletions(-)
> 
> diff --git a/net/can/af_can.c b/net/can/af_can.c
> index 0ce2ad0..c4f0da5 100644
> --- a/net/can/af_can.c
> +++ b/net/can/af_can.c
> @@ -40,6 +40,8 @@
>   *
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/kmod.h>
> @@ -62,8 +64,8 @@
>  
>  #include "af_can.h"
>  
> -static __initdata const char banner[] = KERN_INFO
> -	"can: controller area network core (" CAN_VERSION_STRING ")\n";
> +static __initdata const char banner[] =
> +	"controller area network core (" CAN_VERSION_STRING ")";
>  
>  MODULE_DESCRIPTION("Controller Area Network PF_CAN core");
>  MODULE_LICENSE("Dual BSD/GPL");
> @@ -161,8 +163,8 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
>  		 * return -EPROTONOSUPPORT
>  		 */
>  		if (err)
> -			printk_ratelimited(KERN_ERR "can: request_module "
> -			       "(can-proto-%d) failed.\n", protocol);
> +			pr_err_ratelimited("request_module (can-proto-%d) failed\n",
> +					   protocol);
>  
>  		cp = can_get_proto(protocol);
>  	}
> @@ -505,8 +507,7 @@ void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
>  
>  	d = find_dev_rcv_lists(dev);
>  	if (!d) {
> -		printk(KERN_ERR "BUG: receive list not found for "
> -		       "dev %s, id %03X, mask %03X\n",
> +		pr_err("BUG: receive list not found for dev %s, id %03X, mask %03X\n",
>  		       DNAME(dev), can_id, mask);
>  		goto out;
>  	}
> @@ -532,8 +533,7 @@ void can_rx_unregister(struct net_device *dev, canid_t can_id, canid_t mask,
>  	 */
>  
>  	if (!next) {
> -		printk(KERN_ERR "BUG: receive list entry not found for "
> -		       "dev %s, id %03X, mask %03X\n",
> +		pr_err("BUG: receive list entry not found for dev %s, id %03X, mask %03X\n",
>  		       DNAME(dev), can_id, mask);
>  		r = NULL;
>  		goto out;
> @@ -701,8 +701,7 @@ int can_proto_register(const struct can_proto *cp)
>  	int err = 0;
>  
>  	if (proto < 0 || proto >= CAN_NPROTO) {
> -		printk(KERN_ERR "can: protocol number %d out of range\n",
> -		       proto);
> +		pr_err("protocol number %d out of range\n", proto);
>  		return -EINVAL;
>  	}
>  
> @@ -713,8 +712,7 @@ int can_proto_register(const struct can_proto *cp)
>  	mutex_lock(&proto_tab_lock);
>  
>  	if (proto_tab[proto]) {
> -		printk(KERN_ERR "can: protocol %d already registered\n",
> -		       proto);
> +		pr_err("protocol %d already registered\n", proto);
>  		err = -EBUSY;
>  	} else
>  		RCU_INIT_POINTER(proto_tab[proto], cp);
> @@ -769,8 +767,7 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
>  		/* create new dev_rcv_lists for this device */
>  		d = kzalloc(sizeof(*d), GFP_KERNEL);
>  		if (!d) {
> -			printk(KERN_ERR
> -			       "can: allocation of receive list failed\n");
> +			pr_err("allocation of receive list failed\n");
>  			return NOTIFY_DONE;
>  		}
>  		BUG_ON(dev->ml_priv);
> @@ -790,8 +787,8 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
>  				dev->ml_priv = NULL;
>  			}
>  		} else
> -			printk(KERN_ERR "can: notifier: receive list not "
> -			       "found for dev %s\n", dev->name);
> +			pr_err("notifier: receive list not found for dev %s\n",
> +			       dev->name);
>  
>  		spin_unlock(&can_rcvlists_lock);
>  
> @@ -824,7 +821,7 @@ static struct notifier_block can_netdev_notifier __read_mostly = {
>  
>  static __init int can_init(void)
>  {
> -	printk(banner);
> +	pr_info("%s\n", banner);
>  
>  	memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list));
>  
> diff --git a/net/can/bcm.c b/net/can/bcm.c
> index 151b773..540c804 100644
> --- a/net/can/bcm.c
> +++ b/net/can/bcm.c
> @@ -39,6 +39,8 @@
>   *
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/interrupt.h>
> @@ -77,8 +79,8 @@
>  		     (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
>  
>  #define CAN_BCM_VERSION CAN_VERSION
> -static __initdata const char banner[] = KERN_INFO
> -	"can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n";
> +static __initdata const char banner[] =
> +	"broadcast manager protocol (rev " CAN_BCM_VERSION " t)";
>  
>  MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
>  MODULE_LICENSE("Dual BSD/GPL");
> @@ -729,8 +731,8 @@ static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op)
>  		/* mark as removed subscription */
>  		op->rx_reg_dev = NULL;
>  	} else
> -		printk(KERN_ERR "can-bcm: bcm_rx_unreg: registered device "
> -		       "mismatch %p %p\n", op->rx_reg_dev, dev);
> +		pr_err("%s: registered device mismatch %p %p\n",
> +		       __func__, op->rx_reg_dev, dev);
>  }
>  
>  /*
> @@ -1606,11 +1608,11 @@ static int __init bcm_module_init(void)
>  {
>  	int err;
>  
> -	printk(banner);
> +	pr_info("%s\n", banner);
>  
>  	err = can_proto_register(&bcm_can_proto);
>  	if (err < 0) {
> -		printk(KERN_ERR "can: registration of bcm protocol failed\n");
> +		pr_err("registration of bcm protocol failed\n");
>  		return err;
>  	}
>  
> diff --git a/net/can/gw.c b/net/can/gw.c
> index 3d79b12..e17253f 100644
> --- a/net/can/gw.c
> +++ b/net/can/gw.c
> @@ -39,6 +39,8 @@
>   *
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/types.h>
> @@ -59,7 +61,7 @@
>  
>  #define CAN_GW_VERSION "20101209"
>  static __initdata const char banner[] =
> -	KERN_INFO "can: netlink gateway (rev " CAN_GW_VERSION ")\n";
> +	"netlink gateway (rev " CAN_GW_VERSION ")";
>  
>  MODULE_DESCRIPTION("PF_CAN netlink gateway");
>  MODULE_LICENSE("Dual BSD/GPL");
> @@ -913,7 +915,7 @@ static int cgw_remove_job(struct sk_buff *skb,  struct nlmsghdr *nlh, void *arg)
>  
>  static __init int cgw_module_init(void)
>  {
> -	printk(banner);
> +	pr_info("%s\n", banner);
>  
>  	cgw_cache = kmem_cache_create("can_gw", sizeof(struct cgw_job),
>  				      0, 0, NULL);
> diff --git a/net/can/proc.c b/net/can/proc.c
> index ba873c3..c3aedf5 100644
> --- a/net/can/proc.c
> +++ b/net/can/proc.c
> @@ -39,6 +39,8 @@
>   *
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/proc_fs.h>
>  #include <linux/list.h>
> @@ -118,8 +120,7 @@ static unsigned long calc_rate(unsigned long oldjif, unsigned long newjif,
>  
>  	/* see can_stat_update() - this should NEVER happen! */
>  	if (count > (ULONG_MAX / HZ)) {
> -		printk(KERN_ERR "can: calc_rate: count exceeded! %ld\n",
> -		       count);
> +		pr_err("%s: count exceeded! %ld\n", __func__, count);
>  		return 99999999;
>  	}
>  
> @@ -475,8 +476,7 @@ void can_init_proc(void)
>  	can_dir = proc_mkdir("can", init_net.proc_net);
>  
>  	if (!can_dir) {
> -		printk(KERN_INFO "can: failed to create /proc/net/can . "
> -		       "CONFIG_PROC_FS missing?\n");
> +		pr_info("failed to create /proc/net/can . CONFIG_PROC_FS missing?\n");
>  		return;
>  	}
>  
> diff --git a/net/can/raw.c b/net/can/raw.c
> index cde1b4a..2875c55 100644
> --- a/net/can/raw.c
> +++ b/net/can/raw.c
> @@ -39,6 +39,8 @@
>   *
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/uio.h>
> @@ -56,7 +58,7 @@
>  
>  #define CAN_RAW_VERSION CAN_VERSION
>  static __initdata const char banner[] =
> -	KERN_INFO "can: raw protocol (rev " CAN_RAW_VERSION ")\n";
> +	"raw protocol (rev " CAN_RAW_VERSION ")";
>  
>  MODULE_DESCRIPTION("PF_CAN raw protocol");
>  MODULE_LICENSE("Dual BSD/GPL");
> @@ -783,11 +785,11 @@ static __init int raw_module_init(void)
>  {
>  	int err;
>  
> -	printk(banner);
> +	pr_info("%s\n", banner);
>  
>  	err = can_proto_register(&raw_can_proto);
>  	if (err < 0)
> -		printk(KERN_ERR "can: registration of raw protocol failed\n");
> +		pr_err("registration of raw protocol failed\n");
>  
>  	return err;
>  }


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply

* Re: 3.2-rc2+: Reported regressions from 3.0 and 3.1
From: Konrad Rzeszutek Wilk @ 2011-11-29 20:08 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Linux SCSI List, Florian Mickler, Network Development,
	Linux PM List, x86, Linux Wireless List,
	Linux Kernel Mailing List, DRI, Linux ACPI, mingo, hpa, tglx,
	Kernel Testers List, Linus Torvalds, Andrew Morton,
	Maciej Rutecki
In-Reply-To: <20111129183428.GE8200@aftab>

On Tue, Nov 29, 2011 at 07:34:28PM +0100, Borislav Petkov wrote:
> On Tue, Nov 29, 2011 at 01:04:14PM -0500, Konrad Rzeszutek Wilk wrote:
> > This patch:
> > 
> > commit d91ee5863b71e8c90eaf6035bff3078a85e2e7b5
> > Author: Len Brown <len.brown@intel.com>
> > Date:   Fri Apr 1 18:28:35 2011 -0400
> > 
> >     cpuidle: replace xen access to x86 pm_idle and default_idle
> > 
> >     ..scribble on pm_idle and access default_idle,
> >    have it simply disable_cpuidle() so acpi_idle will not load and
> >    architecture default HLT will be used.
> > 
> > idea was to have one call - disable_cpuidle() which would make
> > pm_idle not be molested by other code. It disallows cpuidle_idle_call
> > and acpi_idle_call to not set pm_idle (which is excellent). But the
> 
> what is acpi_idle_call, I can't find it anywhere.

You are right. I had "acpi_idle_enter_*" and its friend in mind. Which
are called from the cpuidle_idle_call.

Let me fix that comment up.
> 
> > amd_e400_idle and mwait_idle can still setup pm_idle which we really
> > do not want.
> 
> This is not the case: rather select_idle_routine()/idle_setup() sets
> pm_idle.

Yes. Let me fix up the comment.
> 
> [..]
> 
> > +bool set_pm_idle_to_default()
> > +{
> > +	if (!pm_idle) {
> > +		pm_idle = default_idle;
> > +		return true;
> > +	}
> > +	return false;
> > +}
> 
> I don't understand what you're trying to achieve here? Do you want
> default_idle to be always the pm_idle for xen or what is the deal here?

Yes (always want default_idle).
> 
> If yes, then simply do:
> 
> bool set_pm_idle_to_default(void)	// remember to add "void" for no function args
> {
> 	bool ret = !!pm_idle;
> 
> 	pm_idle = default_idle;

That would work too.
> 
> 	return ret;
> 
> }
> 
> ...
> 
> >  void stop_this_cpu(void *dummy) 
> >  {
> >  	local_irq_disable();
> > diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> > index 46d6d21..7506181 100644
> > --- a/arch/x86/xen/setup.c
> > +++ b/arch/x86/xen/setup.c
> > @@ -448,6 +448,6 @@ void __init xen_arch_setup(void)
> >  #endif
> >  	disable_cpuidle();
> >  	boot_option_idle_override = IDLE_HALT;
> > -
> > +	WARN_ON(!set_pm_idle_to_default());
> 
> and then do
> 
> 	WARN_ON(set_pm_idle_to_default());
> 
> instead of having arbitrary confusing logic. This way you can warn
> whether something else set pm_idle already. Or?

That would work as well.

^ permalink raw reply

* [PATCH] netlabel: Fix build problems when IPv6 is not enabled
From: Paul Moore @ 2011-11-29 20:08 UTC (permalink / raw)
  To: netdev, rdunlap; +Cc: linux-next, linux-kernel

A recent fix to the the NetLabel code caused build problem with
configurations that did not have IPv6 enabled; see below:

 netlabel_kapi.c: In function 'netlbl_cfg_unlbl_map_add':
 netlabel_kapi.c:165:4:
  error: implicit declaration of function 'netlbl_af6list_add'

This patch fixes this problem by making the IPv6 specific code conditional
on the IPv6 configuration flags as we done in the rest of NetLabel and the
network stack as a whole.  We have to move some variable declarations
around as a result so things may not be quite as pretty, but at least it
builds cleanly now.

Some additional IPv6 conditionals were added to the NetLabel code as well
for the sake of consistency.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 net/netlabel/netlabel_kapi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 3735297..e4bbe94 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -148,6 +148,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 			if (ret_val != 0)
 				goto cfg_unlbl_map_add_failure;
 			break;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 		case AF_INET6:
 			addr6 = addr;
 			mask6 = mask;
@@ -167,6 +168,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 			if (ret_val != 0)
 				goto cfg_unlbl_map_add_failure;
 			break;
+#endif /* IPv6 */
 		default:
 			goto cfg_unlbl_map_add_failure;
 			break;
@@ -225,9 +227,11 @@ int netlbl_cfg_unlbl_static_add(struct net *net,
 	case AF_INET:
 		addr_len = sizeof(struct in_addr);
 		break;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 	case AF_INET6:
 		addr_len = sizeof(struct in6_addr);
 		break;
+#endif /* IPv6 */
 	default:
 		return -EPFNOSUPPORT;
 	}
@@ -266,9 +270,11 @@ int netlbl_cfg_unlbl_static_del(struct net *net,
 	case AF_INET:
 		addr_len = sizeof(struct in_addr);
 		break;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 	case AF_INET6:
 		addr_len = sizeof(struct in6_addr);
 		break;
+#endif /* IPv6 */
 	default:
 		return -EPFNOSUPPORT;
 	}

^ permalink raw reply related

* Re: [PATCH] netlabel: Fix build problems when IPv6 is not enabled
From: Paul Moore @ 2011-11-29 20:09 UTC (permalink / raw)
  To: netdev; +Cc: rdunlap, linux-next, linux-kernel
In-Reply-To: <20111129200818.19875.72359.stgit@sifl>

On Tuesday, November 29, 2011 03:08:18 PM Paul Moore wrote:
> A recent fix to the the NetLabel code caused build problem with
> configurations that did not have IPv6 enabled; see below:
> 
>  netlabel_kapi.c: In function 'netlbl_cfg_unlbl_map_add':
>  netlabel_kapi.c:165:4:
>   error: implicit declaration of function 'netlbl_af6list_add'
> 
> This patch fixes this problem by making the IPv6 specific code conditional
> on the IPv6 configuration flags as we done in the rest of NetLabel and the
> network stack as a whole.  We have to move some variable declarations
> around as a result so things may not be quite as pretty, but at least it
> builds cleanly now.
> 
> Some additional IPv6 conditionals were added to the NetLabel code as well
> for the sake of consistency.
> 
> Reported-by: Randy Dunlap <rdunlap@xenotime.net>
> Signed-off-by: Paul Moore <pmoore@redhat.com>
> ---
>  net/netlabel/netlabel_kapi.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

Sorry, please disregard this patch; I sent the wrong version.

> diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
> index 3735297..e4bbe94 100644
> --- a/net/netlabel/netlabel_kapi.c
> +++ b/net/netlabel/netlabel_kapi.c
> @@ -148,6 +148,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
>  			if (ret_val != 0)
>  				goto cfg_unlbl_map_add_failure;
>  			break;
> +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
>  		case AF_INET6:
>  			addr6 = addr;
>  			mask6 = mask;
> @@ -167,6 +168,7 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
>  			if (ret_val != 0)
>  				goto cfg_unlbl_map_add_failure;
>  			break;
> +#endif /* IPv6 */
>  		default:
>  			goto cfg_unlbl_map_add_failure;
>  			break;
> @@ -225,9 +227,11 @@ int netlbl_cfg_unlbl_static_add(struct net *net,
>  	case AF_INET:
>  		addr_len = sizeof(struct in_addr);
>  		break;
> +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
>  	case AF_INET6:
>  		addr_len = sizeof(struct in6_addr);
>  		break;
> +#endif /* IPv6 */
>  	default:
>  		return -EPFNOSUPPORT;
>  	}
> @@ -266,9 +270,11 @@ int netlbl_cfg_unlbl_static_del(struct net *net,
>  	case AF_INET:
>  		addr_len = sizeof(struct in_addr);
>  		break;
> +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
>  	case AF_INET6:
>  		addr_len = sizeof(struct in6_addr);
>  		break;
> +#endif /* IPv6 */
>  	default:
>  		return -EPFNOSUPPORT;
>  	}
-- 
paul moore
virtualization @ redhat

^ permalink raw reply

* [PATCH v2] netlabel: Fix build problems when IPv6 is not enabled
From: Paul Moore @ 2011-11-29 20:10 UTC (permalink / raw)
  To: netdev, rdunlap; +Cc: linux-next, linux-kernel

A recent fix to the the NetLabel code caused build problem with
configurations that did not have IPv6 enabled; see below:

 netlabel_kapi.c: In function 'netlbl_cfg_unlbl_map_add':
 netlabel_kapi.c:165:4:
  error: implicit declaration of function 'netlbl_af6list_add'

This patch fixes this problem by making the IPv6 specific code conditional
on the IPv6 configuration flags as we done in the rest of NetLabel and the
network stack as a whole.  We have to move some variable declarations
around as a result so things may not be quite as pretty, but at least it
builds cleanly now.

Some additional IPv6 conditionals were added to the NetLabel code as well
for the sake of consistency.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 net/netlabel/netlabel_kapi.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 3735297..5952237 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -111,8 +111,6 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 	struct netlbl_domaddr_map *addrmap = NULL;
 	struct netlbl_domaddr4_map *map4 = NULL;
 	struct netlbl_domaddr6_map *map6 = NULL;
-	const struct in_addr *addr4, *mask4;
-	const struct in6_addr *addr6, *mask6;
 
 	entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
 	if (entry == NULL)
@@ -133,9 +131,9 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 		INIT_LIST_HEAD(&addrmap->list6);
 
 		switch (family) {
-		case AF_INET:
-			addr4 = addr;
-			mask4 = mask;
+		case AF_INET: {
+			const struct in_addr *addr4 = addr;
+			const struct in_addr *mask4 = mask;
 			map4 = kzalloc(sizeof(*map4), GFP_ATOMIC);
 			if (map4 == NULL)
 				goto cfg_unlbl_map_add_failure;
@@ -148,9 +146,11 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 			if (ret_val != 0)
 				goto cfg_unlbl_map_add_failure;
 			break;
-		case AF_INET6:
-			addr6 = addr;
-			mask6 = mask;
+			}
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+		case AF_INET6: {
+			const struct in6_addr *addr6 = addr;
+			const struct in6_addr *mask6 = mask;
 			map6 = kzalloc(sizeof(*map6), GFP_ATOMIC);
 			if (map6 == NULL)
 				goto cfg_unlbl_map_add_failure;
@@ -167,6 +167,8 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 			if (ret_val != 0)
 				goto cfg_unlbl_map_add_failure;
 			break;
+			}
+#endif /* IPv6 */
 		default:
 			goto cfg_unlbl_map_add_failure;
 			break;
@@ -225,9 +227,11 @@ int netlbl_cfg_unlbl_static_add(struct net *net,
 	case AF_INET:
 		addr_len = sizeof(struct in_addr);
 		break;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 	case AF_INET6:
 		addr_len = sizeof(struct in6_addr);
 		break;
+#endif /* IPv6 */
 	default:
 		return -EPFNOSUPPORT;
 	}
@@ -266,9 +270,11 @@ int netlbl_cfg_unlbl_static_del(struct net *net,
 	case AF_INET:
 		addr_len = sizeof(struct in_addr);
 		break;
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 	case AF_INET6:
 		addr_len = sizeof(struct in6_addr);
 		break;
+#endif /* IPv6 */
 	default:
 		return -EPFNOSUPPORT;
 	}

^ permalink raw reply related

* Re: is non-inheritance of congestion control algorithm from the listen socket a bug or a feature?
From: Dave Taht @ 2011-11-29 20:27 UTC (permalink / raw)
  To: Rick Jones; +Cc: netdev
In-Reply-To: <4ED53AA1.9090800@hp.com>

Hey, thx for trying it!

On Tue, Nov 29, 2011 at 9:03 PM, Rick Jones <rick.jones2@hp.com> wrote:

>
> Is the non-inheritance of the congestion control algorithm a bug or a
> feature?

Hmm... It's kind of both.

Recently I submitted an RFC patch to the
rsync mailing list, and it seemed nice to be able to set it on a per
socket basis based on various configuration options in the
rsync conf file and what was explicitly allowed.

That patch is here:

https://lists.samba.org/archive/rsync/2011-November/027111.html

It was also way cool to see tcp-lp in action vs other sorts of tcp.

That said we  have a range of allowable congestion algorithms
ranging from more intense than cubic to low bandwidth to wireless,
to highly specialized (data center tcp), to some that require
both sides to be running the same alg, others that are server
only...

Your question sort of involves what should a user be able
to set.

On the one hand, in the general case an app should
not be allowed to choose a more aggressive tcp.

On the other hand, an app on a wireless box,
requesting/getting, say, westwood over a default of lp or cubic sort
of makes sense.

On the gripping hand I thiink pushing this level of decison
making out to the app is just fine by me, so inherit
or not, is the app's call to setsockopt...

And in netperf's case, that would be all the algs made
available via allowable_congestion_control.

I had another idea regarding pushing alternate tcp algos out
to more apps without requiring source code changes,
which would be to create a cgroup controller, which
would be both trendy and would provide 'inherit-ability'...

But first up I think would be for more folk to see how
cool different algos can be.

>
> rick jones
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Dave Täht
SKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374
http://www.bufferbloat.net

^ permalink raw reply

* Re: [Bonding-devel] ethernet bonding + VLAN: additional VLAN tag in tcpdump
From: Nicolas de Pesloüan @ 2011-11-29 20:35 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Thomas De Schampheleire, bonding-devel, tcpdump-workers,
	Ronny Meeus, netdev@vger.kernel.org
In-Reply-To: <CAAXf6LXiONe5Kb8tdQbQs3SWg8cc6SK_md7-vOV8qN4vYmL8qw@mail.gmail.com>

Le 29/11/2011 14:38, Thomas De Schampheleire a écrit :
> Hi,
>
> I'm seeing incorrect tcpdump output in the following scenario:
>
> * ethernet bonding enabled in the kernel, and a single network
> interface (eth0) added as slave
> * bonding mode was set to broadcast, but I don't think this matters
> * VLAN added to the bond0 network interface
> * ip address set on the vlan interface (bond0.1234)
> * tcpdump capturing full packets (-xx or even -x) on the eth0 interface
>
> Then, when pinging from another machine to this ip address, the ping
> reply packets shown by tcpdump incorrectly have a double VLAN tag.
> However, what really appears on the wire is correct: a single VLAN
> tag.

Copied netdev, because bonding and vlan developers are there.

Jiri, don't you think this might be related to the work you have done to make non-hw-accel rx path 
similar to hw-accel?

	Nicolas.

>
> Here is the output from tcpdump:
> # /tmp/tcpdump  -i eth0 -xx
> tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
> listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
> 01:04:04.607880 IP 192.168.1.2>  192.168.1.1: ICMP echo request, id 26933, seq 4
> 16, length 64
>          0x0000:  0600 0000 0020 0600 0000 0020 8100 0ffe
>          0x0010:  0800 4500 0054 0000 4000 4001 b755 c0a8
>          0x0020:  0102 c0a8 0101 0800 98d7 6935 01a0 e528
>          0x0030:  0f2a 0000 0000 0000 0000 0000 0000 0000
>          0x0040:  0000 0000 0000 0000 0000 0000 0000 0000
>          0x0050:  0000 0000 0000 0000 0000 0000 0000 0000
>          0x0060:  0000 0000 0000
> 01:04:04.607889 IP 192.168.1.1>  192.168.1.2: ICMP echo reply, id 26933, seq 416
> , length 64
>          0x0000:  0600 0000 0020 0600 0000 0020 8100 0ffe
>          0x0010:  8100 0ffe 0800 4500 0054 cc07 0000 4001<--------
> extra VLAN header at 0x10
>          0x0020:  2b4e c0a8 0101 c0a8 0102 0000 a0d7 6935
>          0x0030:  01a0 e528 0f2a 0000 0000 0000 0000 0000
>          0x0040:  0000 0000 0000 0000 0000 0000 0000 0000
>          0x0050:  0000 0000 0000 0000 0000 0000 0000 0000
>          0x0060:  0000 0000 0000 0000 0000
>
>
> Initial debugging showed that the addition of the extra VLAN header
> takes place in function pcap_read_linux_mmap() of libpcap, in the
> following snippet:
>
> #ifdef HAVE_TPACKET2
>                  if (handle->md.tp_version == TPACKET_V2&&  h.h2->tp_vlan_tci&&
>                      tp_snaplen>= 2 * ETH_ALEN) {
>                          struct vlan_tag *tag;
>
>                          bp -= VLAN_TAG_LEN;
>                          memmove(bp, bp + VLAN_TAG_LEN, 2 * ETH_ALEN);
>
>                          tag = (struct vlan_tag *)(bp + 2 * ETH_ALEN);
>                          tag->vlan_tpid = htons(ETH_P_8021Q);
>                          tag->vlan_tci = htons(h.h2->tp_vlan_tci);
>
>                          pcaphdr.caplen += VLAN_TAG_LEN;
>                          pcaphdr.len += VLAN_TAG_LEN;
>                  }
> #endif
>
> Upon entry of this code, the packet in bp already contains a VLAN header.
>
> It's unclear to me where the problem lies exactly. I suspect it has
> something to do with the ethernet bonding layer indicating it has
> hardware vlan tagging support, while it does already fill in the vlan
> header, and libpcap being confused by this.
>
> As mentioned previously, the packets on the wire are correct, and this
> is purely a capturing problem.
>
> Best regards,
> Thomas
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Bonding-devel mailing list
> Bonding-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bonding-devel
>

^ permalink raw reply

* Re: RCU'ed dst_get_neighbour()
From: Eric Dumazet @ 2011-11-29 20:43 UTC (permalink / raw)
  To: Marc Aurele La France, David Miller
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Roland Dreier,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1322589661.2596.2.camel@edumazet-laptop>

Le mardi 29 novembre 2011 à 19:01 +0100, Eric Dumazet a écrit :
> Le mardi 29 novembre 2011 à 10:44 -0700, Marc Aurele La France a écrit :
> > Hi.
> > 
> > Commit (1) seems to imply that all dst_get_neighbour() references now need 
> > to be wrapped with rcu_read_lock()/rcu_read_unlock() sequences.  See (2) 
> > for one such proposed change.
> > 
> > In the case I have here (ipoib), this commit results in ...
> > 
> > ===================================================
> > [ INFO: suspicious rcu_dereference_check() usage. ]
> > ---------------------------------------------------
> > include/net/dst.h:91 invoked rcu_dereference_check() without protection!
> > 
> > other info that might help us debug this:
> > 
> > 
> > rcu_scheduler_active = 1, debug_locks = 1
> > 4 locks held by kworker/3:1/630:
> >   #0:  (ib_cm){.+.+.+}, at: [<ffffffff81055735>] 
> > process_one_work+0x1ab/0x4f9
> >   #1:  ((&(&work->work)->work)){+.+.+.}, at: [<ffffffff81055735>] 
> > process_one_work+0x1ab/0x4f9
> >   #2:  (rcu_read_lock_bh){.+....}, at: [<ffffffff81388216>] 
> > dev_queue_xmit+0x0/0x5ae
> >   #3:  (_xmit_INFINIBAND){+.-...}, at: [<ffffffff8139eecc>] 
> > sch_direct_xmit+0x4d/0x22b
> > 
> > stack backtrace:
> > Pid: 630, comm: kworker/3:1 Not tainted 3.1.3-smp #1
> > Call Trace:
> >   [<ffffffff8106c385>] lockdep_rcu_dereference+0x9b/0xa4
> >   [<ffffffff81351cda>] ipoib_start_xmit+0xf4/0x36f
> >   [<ffffffff81384215>] dev_hard_start_xmit+0x2a7/0x54f
> >   [<ffffffff8139eeef>] sch_direct_xmit+0x70/0x22b
> >   [<ffffffff8138851f>] dev_queue_xmit+0x309/0x5ae
> >   [<ffffffff81388216>] ? napi_gro_receive+0xb3/0xb3
> >   [<ffffffff813582d3>] ipoib_cm_rep_handler+0x208/0x248
> >   [<ffffffff81433e16>] ? _raw_spin_unlock_irqrestore+0x3d/0x5b
> >   [<ffffffff8135a912>] ipoib_cm_tx_handler+0x95/0x27f
> >   [<ffffffff8106d183>] ? __trace_hardirqs_on_caller+0x41/0x65
> >   [<ffffffff81327b29>] cm_process_work+0x26/0xbc
> >   [<ffffffff81328d74>] cm_rep_handler+0x274/0x2ae
> >   [<ffffffff81329582>] cm_work_handler+0x41/0x91
> >   [<ffffffff8105582c>] process_one_work+0x2a2/0x4f9
> >   [<ffffffff81055735>] ? process_one_work+0x1ab/0x4f9
> >   [<ffffffff810580c6>] ? worker_thread+0x4a/0x1ca
> >   [<ffffffff81329541>] ? cm_req_handler+0x355/0x355
> >   [<ffffffff81058175>] worker_thread+0xf9/0x1ca
> >   [<ffffffff8105807c>] ? gcwq_mayday_timeout+0x77/0x77
> >   [<ffffffff8105bfa3>] kthread+0x86/0x8e
> >   [<ffffffff81436b34>] kernel_thread_helper+0x4/0x10
> >   [<ffffffff8143425d>] ? retint_restore_args+0xe/0xe
> >   [<ffffffff8105bf1d>] ? kthread_stop+0x1cd/0x1cd
> >   [<ffffffff81436b30>] ? gs_change+0xb/0xb
> > 
> > ===================================================
> > [ INFO: suspicious rcu_dereference_check() usage. ]
> > ---------------------------------------------------
> > include/net/dst.h:91 invoked rcu_dereference_check() without protection!
> > 
> > other info that might help us debug this:
> > 
> > 
> > rcu_scheduler_active = 1, debug_locks = 1
> > 2 locks held by kworker/u:2/748:
> >   #0:  ((name)){.+.+.+}, at: [<ffffffff81055735>] 
> > process_one_work+0x1ab/0x4f9
> >   #1:  ((&port_priv->work)){+.+.+.}, at: [<ffffffff81055735>] 
> > process_one_work+0x1ab/0x4f9
> > 
> > stack backtrace:
> > Pid: 748, comm: kworker/u:2 Not tainted 3.1.3-smp #1
> > Call Trace:
> >   [<ffffffff8106c385>] lockdep_rcu_dereference+0x9b/0xa4
> >   [<ffffffff81354e68>] ipoib_mcast_join_finish+0x362/0x48a
> >   [<ffffffff81355481>] ipoib_mcast_sendonly_join_complete+0x3b/0x174
> >   [<ffffffff813246b3>] mcast_work_handler+0xba/0x182
> >   [<ffffffff813248aa>] join_handler+0xe6/0xee
> >   [<ffffffff81322af1>] ib_sa_mcmember_rec_callback+0x51/0x5c
> >   [<ffffffff8132289c>] recv_handler+0x44/0x50
> >   [<ffffffff8131efca>] ib_mad_complete_recv+0xc3/0x125
> >   [<ffffffff8131debe>] ? find_mad_agent+0x13a/0x149
> >   [<ffffffff8131f30a>] ib_mad_recv_done_handler+0x2de/0x326
> >   [<ffffffff8131f3b0>] ib_mad_completion_handler+0x5e/0x91
> >   [<ffffffff8105582c>] process_one_work+0x2a2/0x4f9
> >   [<ffffffff81055735>] ? process_one_work+0x1ab/0x4f9
> >   [<ffffffff810580c6>] ? worker_thread+0x4a/0x1ca
> >   [<ffffffff8131f352>] ? ib_mad_recv_done_handler+0x326/0x326
> >   [<ffffffff81058175>] worker_thread+0xf9/0x1ca
> >   [<ffffffff8105807c>] ? gcwq_mayday_timeout+0x77/0x77
> >   [<ffffffff8105bfa3>] kthread+0x86/0x8e
> >   [<ffffffff81436b34>] kernel_thread_helper+0x4/0x10
> >   [<ffffffff8143425d>] ? retint_restore_args+0xe/0xe
> >   [<ffffffff8105bf1d>] ? kthread_stop+0x1cd/0x1cd
> >   [<ffffffff81436b30>] ? gs_change+0xb/0xb
> > 
> > Comments/flames?
> > 
> > Thanks.
> > 
> > Marc.
> > 
> > PS:  Please reply-to-all as I am not subscribed to netdev.
> > 
> > (1) http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f2c31e32b378a6653f8de606149d963baf11d7d3
> > (2) http://www.spinics.net/lists/netdev/msg179639.html
> > 
> > +----------------------------------+----------------------------------+
> > |  Marc Aurele La France           |  work:   1-780-492-9310          |
> > |  Academic Information and        |  fax:    1-780-492-1729          |
> > |    Communications Technologies   |  email:  tsi-yfeSBMgouQgsA/PxXw9srA@public.gmane.org         |
> > |  352 General Services Building   +----------------------------------+
> > |  University of Alberta           |                                  |
> > |  Edmonton, Alberta               |    Standard disclaimers apply    |
> > |  T6G 2H1                         |                                  |
> > |  CANADA                          |                                  |
> > +----------------------------------+----------------------------------+
> 
> Thanks for the report Marc, I'll take a look asap.
> 
> 

Hi Marc

Here is the patch I cooked based on your report, thanks a lot !

Eric

[PATCH] net: infiniband/ulp/ipoib: fix lockdep splats

commit f2c31e32b37 (net: fix NULL dereferences in check_peer_redir())
forgot to take care of infiniband uses of dst neighbours.

Many thanks to Marc Aurele who provided a nice bug report.

Reported-by: Marc Aurele La France <tsi-yfeSBMgouQgsA/PxXw9srA@public.gmane.org>
Signed-off-by: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
CC: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
CC: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c      |   17 ++++++++-------
 drivers/infiniband/ulp/ipoib/ipoib_multicast.c |    6 +++--
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 7567b60..c36a2ab 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -555,6 +555,7 @@ static int path_rec_start(struct net_device *dev,
 	return 0;
 }
 
+/* called with rcu_read_lock */
 static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
 {
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
@@ -636,6 +637,7 @@ err_drop:
 	spin_unlock_irqrestore(&priv->lock, flags);
 }
 
+/* called with rcu_read_lock */
 static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev)
 {
 	struct ipoib_dev_priv *priv = netdev_priv(skb->dev);
@@ -720,13 +722,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct neighbour *n = NULL;
 	unsigned long flags;
 
+	rcu_read_lock();
 	if (likely(skb_dst(skb)))
 		n = dst_get_neighbour(skb_dst(skb));
 
 	if (likely(n)) {
 		if (unlikely(!*to_ipoib_neigh(n))) {
 			ipoib_path_lookup(skb, dev);
-			return NETDEV_TX_OK;
+			goto unlock;
 		}
 
 		neigh = *to_ipoib_neigh(n);
@@ -749,17 +752,17 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
 			ipoib_neigh_free(dev, neigh);
 			spin_unlock_irqrestore(&priv->lock, flags);
 			ipoib_path_lookup(skb, dev);
-			return NETDEV_TX_OK;
+			goto unlock;
 		}
 
 		if (ipoib_cm_get(neigh)) {
 			if (ipoib_cm_up(neigh)) {
 				ipoib_cm_send(dev, skb, ipoib_cm_get(neigh));
-				return NETDEV_TX_OK;
+				goto unlock;
 			}
 		} else if (neigh->ah) {
 			ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(n->ha));
-			return NETDEV_TX_OK;
+			goto unlock;
 		}
 
 		if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
@@ -793,13 +796,13 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
 					   phdr->hwaddr + 4);
 				dev_kfree_skb_any(skb);
 				++dev->stats.tx_dropped;
-				return NETDEV_TX_OK;
+				goto unlock;
 			}
 
 			unicast_arp_send(skb, dev, phdr);
 		}
 	}
-
+unlock:
 	return NETDEV_TX_OK;
 }
 
@@ -837,7 +840,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
 	dst = skb_dst(skb);
 	n = NULL;
 	if (dst)
-		n = dst_get_neighbour(dst);
+		n = dst_get_neighbour_raw(dst);
 	if ((!dst || !n) && daddr) {
 		struct ipoib_pseudoheader *phdr =
 			(struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 1b7a976..cad1894 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -266,7 +266,7 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
 
 		skb->dev = dev;
 		if (dst)
-			n = dst_get_neighbour(dst);
+			n = dst_get_neighbour_raw(dst);
 		if (!dst || !n) {
 			/* put pseudoheader back on for next time */
 			skb_push(skb, sizeof (struct ipoib_pseudoheader));
@@ -722,6 +722,8 @@ out:
 	if (mcast && mcast->ah) {
 		struct dst_entry *dst = skb_dst(skb);
 		struct neighbour *n = NULL;
+
+		rcu_read_lock();
 		if (dst)
 			n = dst_get_neighbour(dst);
 		if (n && !*to_ipoib_neigh(n)) {
@@ -734,7 +736,7 @@ out:
 				list_add_tail(&neigh->list, &mcast->neigh_list);
 			}
 		}
-
+		rcu_read_unlock();
 		spin_unlock_irqrestore(&priv->lock, flags);
 		ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
 		return;


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: RCU'ed dst_get_neighbour()
From: Roland Dreier @ 2011-11-29 20:47 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Marc Aurele La France, David Miller,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1322599437.2596.10.camel@edumazet-laptop>

Thanks Eric, I'll send this to Linus shortly.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply


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