Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 21/62] net: remove the second argument of k[un]map_atomic()
From: Alexander Duyck @ 2011-11-28 18:06 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Cong Wang, linux-kernel, akpm, Jeff Kirsher, Jesse Brandeburg,
	Bruce Allan, Carolyn Wyborny, Don Skidmore, Greg Rose,
	Peter P Waskiewicz Jr, John Ronciak, David S. Miller, Dean Nelson,
	Ian Campbell, Jiri Pirko, e1000-devel, netdev
In-Reply-To: <1322381248.2826.1.camel@edumazet-laptop>

On 11/27/2011 12:07 AM, Eric Dumazet wrote:
> Le dimanche 27 novembre 2011 à 13:27 +0800, Cong Wang a écrit :
>> Signed-off-by: Cong Wang <amwang@redhat.com>
>> ---
>> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
>> index cf480b5..b194beb 100644
>> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
>> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
>> @@ -3878,11 +3878,9 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
>>  				if (length <= copybreak &&
>>  				    skb_tailroom(skb) >= length) {
>>  					u8 *vaddr;
>> -					vaddr = kmap_atomic(buffer_info->page,
>> -					                    KM_SKB_DATA_SOFTIRQ);
>> +					vaddr = kmap_atomic(buffer_info->page);
>>  					memcpy(skb_tail_pointer(skb), vaddr, length);
>> -					kunmap_atomic(vaddr,
>> -					              KM_SKB_DATA_SOFTIRQ);
>> +					kunmap_atomic(vaddr);
>>  					/* re-use the page, so don't erase
>>  					 * buffer_info->page */
>>  					skb_put(skb, length);
>> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
>> index a855db1..8603c87 100644
>> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
>> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
>> @@ -1272,9 +1272,9 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
>>  			 */
>>  			dma_sync_single_for_cpu(&pdev->dev, ps_page->dma,
>>  						PAGE_SIZE, DMA_FROM_DEVICE);
>> -			vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ);
>> +			vaddr = kmap_atomic(ps_page->page);
>>  			memcpy(skb_tail_pointer(skb), vaddr, l1);
>> -			kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
>> +			kunmap_atomic(vaddr);
>>  			dma_sync_single_for_device(&pdev->dev, ps_page->dma,
>>  						   PAGE_SIZE, DMA_FROM_DEVICE);
>>  
>> @@ -1465,12 +1465,10 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
>>  				if (length <= copybreak &&
>>  				    skb_tailroom(skb) >= length) {
>>  					u8 *vaddr;
>> -					vaddr = kmap_atomic(buffer_info->page,
>> -					                   KM_SKB_DATA_SOFTIRQ);
>> +					vaddr = kmap_atomic(buffer_info->page);
>>  					memcpy(skb_tail_pointer(skb), vaddr,
>>  					       length);
>> -					kunmap_atomic(vaddr,
>> -					              KM_SKB_DATA_SOFTIRQ);
>> +					kunmap_atomic(vaddr);
>>  					/* re-use the page, so don't erase
>>  					 * buffer_info->page */
>>  					skb_put(skb, length);
> But why are these drivers using kmap_atomic() in first place, since
> their fragments are allocated in regular zone (GFP_ATOMIC or
> GFP_KERNEL) ?

I was asking the same thing myself recently when I started working on
some copy-break like code for the ixgbe driver.  I believe the main
reason is a lack of documentation.  This code is based loosely on the
skb_copy_bits code which will use kmap_skb_frag over all of the paged
portions of the sk_buff.  As such it was decided to map things via
kmap_atomic in order to guarantee the pages had a valid virtual address.

If I understand things correctly, what you are brining up is that pages
allocated with either GFP_ATOMIC or GFP_KERNEL will always be allocated
from the lowmem pool and as such page_address should always succeed.  Is
that correct?

Thanks,

Alex

^ permalink raw reply

* Re: linux-next: Tree for Nov 28 (netlabel)
From: Randy Dunlap @ 2011-11-28 18:16 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, LKML, Netdev, Paul Moore
In-Reply-To: <20111128162556.47758629406b638a99428049@canb.auug.org.au>

On 11/27/2011 09:25 PM, Stephen Rothwell wrote:
> Hi all,
> 
> Changes since 20111125:

When IPV6 is not enabled:

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


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply

* Re: sky2: hw csum failure
From: Vincent Blut @ 2011-11-28 19:20 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Debian Bug Tracking System
In-Reply-To: <20111128085030.248ebcb7@nehalam.linuxnetplumber.net>

Le 28/11/2011 16:50, Stephen Hemminger a écrit :
> On Mon, 28 Nov 2011 12:10:20 +0000
> Vincent Blut <vincent.debian@free.fr> wrote:
>
>   
>> Hi,
>>
>> [reference: http://bugs.debian.org/609994]
>>
>> I have a Marvell ethernet controller which presents some failures when
>> 'rx checksumming' is enabled,
>> here is the model:
>>
>> $ lspci -vvs 03:00.0
>> 03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E
>> Gigabit Ethernet Controller (rev 15)
>>         Subsystem: Micro-Star International Co., Ltd. Marvell 88E8053
>> Gigabit Ethernet Controller (MSI)
>>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
>> ParErr- Stepping- SERR- FastB2B- DisINTx+
>>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
>> <TAbort- <MAbort- >SERR- <PERR- INTx-
>>         Latency: 0, Cache Line Size: 32 bytes
>>         Interrupt: pin A routed to IRQ 44
>>         Region 0: Memory at fdbfc000 (64-bit, non-prefetchable) [size=16K]
>>         Region 2: I/O ports at 7c00 [size=256]
>>         [virtual] Expansion ROM at fda00000 [disabled] [size=128K]
>>         Capabilities: <access denied>
>>         Kernel driver in use: sky2
>>
>> At first I thought it was due to the MTU size, so I tested different
>> values but unfortunately without positive effect.
>> Overall this issue appears randomly when the incoming traffic is high. I
>> tested 2.6.32, 3.1.1, and 3.2-rc3, sadly
>> all are affected. Finally, the only way to avoid those failures is to
>> disabled 'rx checksumming' (ethtool -K ethX rx off).
>>
>> Here is the stack trace:
>>
>> [   14.615648] sky2 0000:03:00.0: eth1: enabling interface
>> [   14.616452] ADDRCONF(NETDEV_UP): eth1: link is not ready
>> [   17.094194] sky2 0000:03:00.0: eth1: Link is up at 1000 Mbps, full
>> duplex, flow control both
>> [   17.094887] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
>> [   28.080018] eth1: no IPv6 routers present
>> [  563.816032] sky2 0000:03:00.0: eth1: hung mac 124:22 fifo 195 (150:145)
>> [  563.816036] sky2 0000:03:00.0: eth1: receiver hang detected
>> [  567.005422] sky2 0000:03:00.0: eth1: Link is up at 1000 Mbps, full
>> duplex, flow control both
>> [ 1040.816314] sky2 0000:03:00.0: eth1: rx error, status 0x7ffc0001
>> length 1004
>> [ 2097.401616] sky2 0000:03:00.0: eth1: rx error, status 0x39a339a3 length 0
>>     
> This isn't really a hardware checksum failure.
> Your problem is deeper than that. The internal parts of the chip are not
> communicating correctly. The "hung mac" is a problem only occurs if the PCI
> is really stuck. There may be a timing issue on your motherboard, or the BIOS
> isn't setting up the device properly. The timing then gets messed up between
> the end of frame status and the PCI shared memory region. Turning checksum
> off masks the problem, but the status is probably still corrupt.
>
>   

IMO, turning checksum off does more than masking the problem because it
prevents the
connection to stop working or even freeze the system.

> In either case the problem is beyond the ability of the driver to fix or workaround.
> Your best bet is to see if there is a BIOS update, or replace the hardware.
>   

Sadly the last BIOS update was in 2006, so I don't think I can rely on
the manufacturer.
But again, deactivate the capability of checksum by NIC hardware makes
the interface stable since March.

Regards,
Vincent

^ permalink raw reply

* Re: [PATCH 21/62] net: remove the second argument of k[un]map_atomic()
From: Eric Dumazet @ 2011-11-28 18:26 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Jiri Pirko, Don, Cong Wang, David S. Miller, e1000-devel,
	Dean Nelson, Bruce Allan, Jesse Brandeburg, linux-kernel,
	John Ronciak, netdev, akpm, Ian Campbell
In-Reply-To: <4ED3CD8B.5060000@intel.com>

Le lundi 28 novembre 2011 à 10:06 -0800, Alexander Duyck a écrit :
> On 11/27/2011 12:07 AM, Eric Dumazet wrote:
> > But why are these drivers using kmap_atomic() in first place, since
> > their fragments are allocated in regular zone (GFP_ATOMIC or
> > GFP_KERNEL) ?
> 
> I was asking the same thing myself recently when I started working on
> some copy-break like code for the ixgbe driver.  I believe the main
> reason is a lack of documentation.  This code is based loosely on the
> skb_copy_bits code which will use kmap_skb_frag over all of the paged
> portions of the sk_buff.  As such it was decided to map things via
> kmap_atomic in order to guarantee the pages had a valid virtual address.
> 
> If I understand things correctly, what you are brining up is that pages
> allocated with either GFP_ATOMIC or GFP_KERNEL will always be allocated
> from the lowmem pool and as such page_address should always succeed.  Is
> that correct?
> 

Yes.

Either you could :

A) allocate high memory pages to lower pressure on LOWMEM area on 32bit
kernels.

B) avoid using kmap_atomic() & kunmap_atomic() and be faster on 32bit
kernels.

	skb_put(skb, length);
	memcpy(skb->data, page_address(buffer_info->page), length);

 




------------------------------------------------------------------------------
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
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* Re: Open vSwitch Design
From: Justin Pettit @ 2011-11-28 18:34 UTC (permalink / raw)
  To: Jamal Hadi Salim
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, Chris Wright, Herbert Xu,
	Eric Dumazet, netdev, John Fastabend, Stephen Hemminger,
	David Miller
In-Reply-To: <1322269906.7338.23.camel@mojatatu>

On Nov 25, 2011, at 5:11 PM, Jamal Hadi Salim wrote:

>> A big difficulty is finding an appropriate hardware abstraction.  I've worked on porting 
>> Open vSwitch to a few different vendors' switching ASICs, and they've all looked quite 
>> different from each other.  Even within a vendor, there can be fairly substantial differences.  
>> Packet processing is broken up into stages (e.g., VLAN preprocessing, ingress ACL processing, 
>> L2 lookup, L3 lookup, packet modification, packet queuing, packet replication, egress ACL 
>> processing, etc.)
>> and these can be done in different orders and have quite different behaviors.
> 
> Theres some discussion going on on how to get ASIC support on the
> variety of chips with different offloads (qos, L2 etc); you may wanna
> share your experiences.

Are you talking about ASICs on NICs?  I was referring to integrating Open vSwitch into top-of-rack switches.  These typically have a 48x1G or 48x10G switching ASIC and a relatively slow (~800MHz PPC-class) management CPU running an operating system like Linux.  There's no way that these systems can have a standard CPU on the fastpath.

> Having said that - in the kernel we have all the mechanisms you describe
> above with quiet a good fit. Speaking from experience of working on some
> vendors ASICs (of which i am sure at least one you are working on).
> As an example, the ACL can be applied before or after L2 or L3. We can
> support wildcard matching to user space and exact-matches in the kernel.

I understood the original question to be: Can we make the interface to the kernel look like a hardware switch?  My answer had two main parts.  First, I don't think we could define a "standard" hardware interface, since they're all very different.  Second, even if we could, I think a software fastpath's strengths and weaknesses are such that the hardware model wouldn't be ideal.

>> Also, the size of the various tables varies widely between ASICs--even within the same 
>> family.
>> 
>> Hardware typically makes use of TCAMs, which support fast lookups of wildcarded flows.
>> They're expensive, though, so they're typically limited to entries in the very low thousands.
> 
> Those are problems with most merchant silicon - small tables; but there
> are some which are easily expandable via DRAM to support a full BGP
> table for example.

The problem is that DRAM isn't going to cut it on the ACL tables--which are typically used for flow-based matching--on a 48x10G (or even 48x1G) switch.  I've seen a couple of switching ASICs that support many 10s of thousands of ACL entries, but they require expensive external TCAMs for lookup and SRAM for counters.  Most of the white box vendors that I've seen that use those ASICs don't bother adding the external TCAM and SRAM to their designs.  Even when they are added, their matching capabilities are typically limited in order to keep up with traffic.

>> In software, we can trivially store 100,000s of entries, but supporting wildcarded lookups 
>> is very slow.  If we only use exact-match flows in the kernel (and leave the wildcarding 
>> in userspace for kernel misses), we can do extremely fast lookups with hashing on what 
>> becomes the fastpath.
> 
> Justin - theres nothing new you need in the kernel to have that feature.
> Let me rephrase that, that has not been a new feature for at least a
> decade in Linux.
> Add exact match filters with higher priority. Have the lowest priority
> filter to redirect to user space. Let user space lookup some service
> rule; have it download to the kernel one or more exact matches.
> Let the packet proceed on its way down the kernel to its destination if
> thats what is defined.

My point was that a software fastpath should look different than a hardware-based one.

>> Using exact-match entries has another big advantage: we can innovate the userspace portion 
>> without requiring changes to the kernel.  For example, we recently went from supporting a 
>> single OpenFlow table to 255 without any kernel changes.  This has an added benefit that 
>> a flow requiring multiple table lookups becomes a single hash lookup in the kernel, which
>> is a huge performance gain in the fastpath.  Another example is our introduction of a number
>> of metadata "registers" between tables that are never seen in the kernel, but open up a lot 
>> of interesting applications for OpenFlow controller writers.
> 
> That bit sounds interesting - I will look at your spec.

Great!

>> If you're interested, we include a porting guide in the distribution that describes how one 
>> would go about bringing Open vSwitch to a new hardware or software platform:
>> 
>> 	http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob;f=PORTING
>> 
>> Obviously, it's not that relevant here, since there's already a port to Linux.  :-)  
> 
> Does this mean i can have a 24x10G switch sitting in hardware with Linux
> hardware support if i use your kernel switch? 

Yes, Open vSwitch has been ported to 24x10G ASICs running Linux on their management CPUs.  However, in these cases the datapath is handled by hardware and not the software forwarding plane, obviously.

> Do the vendors agree to some common interface?

Yes, if you view ofproto (as described in the porting guide) as that interface.  Every merchant silicon vendor I've seen views the interfaces to their ASICs as proprietary.  Someone (with the appropriate SDK and licenses) needs to write providers for those different hardware ports.  We've helped multiple vendors do this and know a few others that have done it on their own.

This really seems besides the point for this discussion, though.  We've written an ofproto provider for software switches called "dpif" (this is also described in the porting guide). What we're proposing be included in Linux is the kernel module that speaks to that dpif provider over a well-defined, stable, netlink-based protocol.

Here's just a quick (somewhat simplified) summary of the different layers.  At the top, there are controllers and switches that communicate using OpenFlow.  OpenFlow gives controller writers the ability to inspect and modify the switches' flow tables and interfaces.  If a flow entry doesn't match an existing entry, the packet is forwarded to the controller for further processing.  OpenFlow 1.0 was pretty basic and exposed a single flow table.  OpenFlow 1.1 introduced a number of new features including multiple table support.  The forthcoming OpenFlow 1.2 will include support for extensible matches, which means that new fields may be added without requiring a full revision of the specification.  OpenFlow is defined by the Open Networking Foundation and is not directly related to Open vSwitc
 h.

The userspace in Open vSwitch has an OpenFlow library that interacts with the controllers.  Userspace has its own classifier that supports wildcard entries and multiple tables.  Many of the changes to the OpenFlow protocol only require modifying that library and perhaps some of the glue code with the classifier.  (In theory, other software-defined networking protocols could be plugged in as well.)  The classifier interacts with the ofproto layer below it, which implements a fastpath.  On a hardware switch, since it supports wildcarding, it essentially becomes a passthrough that just calls the appropriate APIs for the ASIC.  On software, as we've discussed, exact-match flows work better.

For that reason, we've defined the dpif layer, which is an ofproto provider.  It's primary purpose is to take high-level concepts like "treat this group of interfaces as a LACP bond" or "support this set of wildcard flow entries" and explode them into exact-match entries on-demand.  We've then implemented a Linux dpif provider that takes the exact match entries created by the dpif layer and converts them into netlink messages that the kernel module understands.  These messages are well-defined and not specific to Open vSwitch or OpenFlow.

This layering has allowed us to introduce new OpenFlow-like features such as multiple tables and non-OpenFlow features such as port mirroring, STP, CCM, and new bonding modes without changes to the kernel module.  In fact, the only changes that should necessitate a kernel interface change are new matches or actions, such as would be required for handling MPLS.

>> But we've 
>> iterated over a few different designs and worked on other ports, and we've found this 
>> hardware/software abstraction layer to work pretty well.  In fact, multiple ports of 
>> Open vSwitch have been done by name-brand third party vendors (this is the avenue most
>> vendors use to get their OpenFlow support) and are now shipping.
>> 
>> We're always open to discussing ways that we can improve this interfaces, too, of course!
> 
> Make these vendor switches work with plain Linux. The Intel folks are
> producing interfaces with L2, ACLs, VIs and are putting some effort to
> integrate them into plain Linux. I should be able to set the qos rules
> with tc on an intel chip.
> You guys can still take advantage of all that and still have your nice
> control plane.

Once again, I think we are talking about different things.  I believe you are discussing interfacing with NICs, which is quite different from a high fanout switching ASIC.  As I previously mentioned, the point of my original post was that I think it would be best not to model a high fanout switch in the interface to the kernel.

--Justin

^ permalink raw reply

* [PATCH V2] 9p: Reduce object size with CONFIG_NET_9P_DEBUG
From: Joe Perches @ 2011-11-28 18:40 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: Ron Minnich, Latchesar Ionkov, David S. Miller, v9fs-developer,
	linux-kernel, netdev
In-Reply-To: <CAFkjPTmyn9POfTjYYjjYEaPt6M6Wdu-P=SEc=ZeTsbA+1=VraA@mail.gmail.com>

Reduce object size by deduplicating formats.

Use vsprintf extension %pV.
Rename P9_DPRINTK uses to p9_debug, align arguments.
Add function for _p9_debug and macro to add __func__.
Add missing "\n"s to p9_debug uses.
Remove embedded function names as p9_debug adds it.
Remove P9_EPRINTK macro and convert use to pr_<level>.
Add and use pr_fmt and pr_<level>.

$ size fs/9p/built-in.o*
   text	   data	    bss	    dec	    hex	filename
  62133	    984	  16000	  79117	  1350d	fs/9p/built-in.o.new
  67342	    984	  16928	  85254	  14d06	fs/9p/built-in.o.old
$ size net/9p/built-in.o*
   text	   data	    bss	    dec	    hex	filename
  88792	   4148	  22024	 114964	  1c114	net/9p/built-in.o.new
  94072	   4148	  23232	 121452	  1da6c	net/9p/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
---
V2: Add net/9p/ files

 fs/9p/cache.c          |   64 +++++++-------
 fs/9p/fid.c            |    8 +-
 fs/9p/v9fs.c           |   83 +++++++++++------
 fs/9p/vfs_addr.c       |   13 +--
 fs/9p/vfs_dentry.c     |   12 +-
 fs/9p/vfs_dir.c        |   13 +--
 fs/9p/vfs_file.c       |   31 +++---
 fs/9p/vfs_inode.c      |   86 +++++++++---------
 fs/9p/vfs_inode_dotl.c |   85 ++++++++---------
 fs/9p/vfs_super.c      |   12 +-
 fs/9p/xattr.c          |   16 ++--
 include/net/9p/9p.h    |   28 ++----
 net/9p/client.c        |  242 ++++++++++++++++++++++++------------------------
 net/9p/error.c         |    6 +-
 net/9p/mod.c           |    6 +-
 net/9p/protocol.c      |    8 +-
 net/9p/trans_fd.c      |  113 ++++++++++++-----------
 net/9p/trans_rdma.c    |   26 +++---
 net/9p/trans_virtio.c  |   34 ++++----
 net/9p/util.c          |    4 +-
 20 files changed, 451 insertions(+), 439 deletions(-)

diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index 945aa5f..a9ea73d 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -62,8 +62,8 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
 	uint16_t klen = 0;
 
 	v9ses = (struct v9fs_session_info *)cookie_netfs_data;
-	P9_DPRINTK(P9_DEBUG_FSC, "session %p buf %p size %u", v9ses,
-		   buffer, bufmax);
+	p9_debug(P9_DEBUG_FSC, "session %p buf %p size %u\n",
+		 v9ses, buffer, bufmax);
 
 	if (v9ses->cachetag)
 		klen = strlen(v9ses->cachetag);
@@ -72,7 +72,7 @@ static uint16_t v9fs_cache_session_get_key(const void *cookie_netfs_data,
 		return 0;
 
 	memcpy(buffer, v9ses->cachetag, klen);
-	P9_DPRINTK(P9_DEBUG_FSC, "cache session tag %s", v9ses->cachetag);
+	p9_debug(P9_DEBUG_FSC, "cache session tag %s\n", v9ses->cachetag);
 	return klen;
 }
 
@@ -91,14 +91,14 @@ void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses)
 	v9ses->fscache = fscache_acquire_cookie(v9fs_cache_netfs.primary_index,
 						&v9fs_cache_session_index_def,
 						v9ses);
-	P9_DPRINTK(P9_DEBUG_FSC, "session %p get cookie %p", v9ses,
-		   v9ses->fscache);
+	p9_debug(P9_DEBUG_FSC, "session %p get cookie %p\n",
+		 v9ses, v9ses->fscache);
 }
 
 void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses)
 {
-	P9_DPRINTK(P9_DEBUG_FSC, "session %p put cookie %p", v9ses,
-		   v9ses->fscache);
+	p9_debug(P9_DEBUG_FSC, "session %p put cookie %p\n",
+		 v9ses, v9ses->fscache);
 	fscache_relinquish_cookie(v9ses->fscache, 0);
 	v9ses->fscache = NULL;
 }
@@ -109,8 +109,8 @@ static uint16_t v9fs_cache_inode_get_key(const void *cookie_netfs_data,
 {
 	const struct v9fs_inode *v9inode = cookie_netfs_data;
 	memcpy(buffer, &v9inode->qid.path, sizeof(v9inode->qid.path));
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p get key %llu", &v9inode->vfs_inode,
-		   v9inode->qid.path);
+	p9_debug(P9_DEBUG_FSC, "inode %p get key %llu\n",
+		 &v9inode->vfs_inode, v9inode->qid.path);
 	return sizeof(v9inode->qid.path);
 }
 
@@ -120,8 +120,8 @@ static void v9fs_cache_inode_get_attr(const void *cookie_netfs_data,
 	const struct v9fs_inode *v9inode = cookie_netfs_data;
 	*size = i_size_read(&v9inode->vfs_inode);
 
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p get attr %llu", &v9inode->vfs_inode,
-		   *size);
+	p9_debug(P9_DEBUG_FSC, "inode %p get attr %llu\n",
+		 &v9inode->vfs_inode, *size);
 }
 
 static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
@@ -129,8 +129,8 @@ static uint16_t v9fs_cache_inode_get_aux(const void *cookie_netfs_data,
 {
 	const struct v9fs_inode *v9inode = cookie_netfs_data;
 	memcpy(buffer, &v9inode->qid.version, sizeof(v9inode->qid.version));
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p get aux %u", &v9inode->vfs_inode,
-		   v9inode->qid.version);
+	p9_debug(P9_DEBUG_FSC, "inode %p get aux %u\n",
+		 &v9inode->vfs_inode, v9inode->qid.version);
 	return sizeof(v9inode->qid.version);
 }
 
@@ -206,8 +206,8 @@ void v9fs_cache_inode_get_cookie(struct inode *inode)
 						  &v9fs_cache_inode_index_def,
 						  v9inode);
 
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p get cookie %p", inode,
-		   v9inode->fscache);
+	p9_debug(P9_DEBUG_FSC, "inode %p get cookie %p\n",
+		 inode, v9inode->fscache);
 }
 
 void v9fs_cache_inode_put_cookie(struct inode *inode)
@@ -216,8 +216,8 @@ void v9fs_cache_inode_put_cookie(struct inode *inode)
 
 	if (!v9inode->fscache)
 		return;
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p put cookie %p", inode,
-		   v9inode->fscache);
+	p9_debug(P9_DEBUG_FSC, "inode %p put cookie %p\n",
+		 inode, v9inode->fscache);
 
 	fscache_relinquish_cookie(v9inode->fscache, 0);
 	v9inode->fscache = NULL;
@@ -229,8 +229,8 @@ void v9fs_cache_inode_flush_cookie(struct inode *inode)
 
 	if (!v9inode->fscache)
 		return;
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p flush cookie %p", inode,
-		   v9inode->fscache);
+	p9_debug(P9_DEBUG_FSC, "inode %p flush cookie %p\n",
+		 inode, v9inode->fscache);
 
 	fscache_relinquish_cookie(v9inode->fscache, 1);
 	v9inode->fscache = NULL;
@@ -272,8 +272,8 @@ void v9fs_cache_inode_reset_cookie(struct inode *inode)
 	v9inode->fscache = fscache_acquire_cookie(v9ses->fscache,
 						  &v9fs_cache_inode_index_def,
 						  v9inode);
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p",
-		   inode, old, v9inode->fscache);
+	p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n",
+		 inode, old, v9inode->fscache);
 
 	spin_unlock(&v9inode->fscache_lock);
 }
@@ -323,7 +323,7 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
 	int ret;
 	const struct v9fs_inode *v9inode = V9FS_I(inode);
 
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
+	p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
 	if (!v9inode->fscache)
 		return -ENOBUFS;
 
@@ -335,13 +335,13 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page)
 	switch (ret) {
 	case -ENOBUFS:
 	case -ENODATA:
-		P9_DPRINTK(P9_DEBUG_FSC, "page/inode not in cache %d", ret);
+		p9_debug(P9_DEBUG_FSC, "page/inode not in cache %d\n", ret);
 		return 1;
 	case 0:
-		P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted");
+		p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
 		return ret;
 	default:
-		P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret);
+		p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
 		return ret;
 	}
 }
@@ -361,7 +361,7 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
 	int ret;
 	const struct v9fs_inode *v9inode = V9FS_I(inode);
 
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p pages %u", inode, *nr_pages);
+	p9_debug(P9_DEBUG_FSC, "inode %p pages %u\n", inode, *nr_pages);
 	if (!v9inode->fscache)
 		return -ENOBUFS;
 
@@ -373,15 +373,15 @@ int __v9fs_readpages_from_fscache(struct inode *inode,
 	switch (ret) {
 	case -ENOBUFS:
 	case -ENODATA:
-		P9_DPRINTK(P9_DEBUG_FSC, "pages/inodes not in cache %d", ret);
+		p9_debug(P9_DEBUG_FSC, "pages/inodes not in cache %d\n", ret);
 		return 1;
 	case 0:
 		BUG_ON(!list_empty(pages));
 		BUG_ON(*nr_pages != 0);
-		P9_DPRINTK(P9_DEBUG_FSC, "BIO submitted");
+		p9_debug(P9_DEBUG_FSC, "BIO submitted\n");
 		return ret;
 	default:
-		P9_DPRINTK(P9_DEBUG_FSC, "ret %d", ret);
+		p9_debug(P9_DEBUG_FSC, "ret %d\n", ret);
 		return ret;
 	}
 }
@@ -396,9 +396,9 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
 	int ret;
 	const struct v9fs_inode *v9inode = V9FS_I(inode);
 
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
+	p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
 	ret = fscache_write_page(v9inode->fscache, page, GFP_KERNEL);
-	P9_DPRINTK(P9_DEBUG_FSC, "ret =  %d", ret);
+	p9_debug(P9_DEBUG_FSC, "ret =  %d\n", ret);
 	if (ret != 0)
 		v9fs_uncache_page(inode, page);
 }
@@ -409,7 +409,7 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
 void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page)
 {
 	const struct v9fs_inode *v9inode = V9FS_I(inode);
-	P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
+	p9_debug(P9_DEBUG_FSC, "inode %p page %p\n", inode, page);
 	if (PageFsCache(page))
 		fscache_wait_on_page_write(v9inode->fscache, page);
 }
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 85b67ff..da8eefb 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -45,8 +45,8 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
 {
 	struct v9fs_dentry *dent;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "fid %d dentry %s\n",
-					fid->fid, dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "fid %d dentry %s\n",
+		 fid->fid, dentry->d_name.name);
 
 	dent = dentry->d_fsdata;
 	if (!dent) {
@@ -79,8 +79,8 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, u32 uid, int any)
 	struct v9fs_dentry *dent;
 	struct p9_fid *fid, *ret;
 
-	P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
-		dentry->d_name.name, dentry, uid, any);
+	p9_debug(P9_DEBUG_VFS, " dentry: %s (%p) uid %d any %d\n",
+		 dentry->d_name.name, dentry, uid, any);
 	dent = (struct v9fs_dentry *) dentry->d_fsdata;
 	ret = NULL;
 	if (dent) {
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 2b78014..4afc182 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -85,15 +87,15 @@ static int get_cache_mode(char *s)
 
 	if (!strcmp(s, "loose")) {
 		version = CACHE_LOOSE;
-		P9_DPRINTK(P9_DEBUG_9P, "Cache mode: loose\n");
+		p9_debug(P9_DEBUG_9P, "Cache mode: loose\n");
 	} else if (!strcmp(s, "fscache")) {
 		version = CACHE_FSCACHE;
-		P9_DPRINTK(P9_DEBUG_9P, "Cache mode: fscache\n");
+		p9_debug(P9_DEBUG_9P, "Cache mode: fscache\n");
 	} else if (!strcmp(s, "none")) {
 		version = CACHE_NONE;
-		P9_DPRINTK(P9_DEBUG_9P, "Cache mode: none\n");
+		p9_debug(P9_DEBUG_9P, "Cache mode: none\n");
 	} else
-		printk(KERN_INFO "9p: Unknown Cache mode %s.\n", s);
+		pr_info("Unknown Cache mode %s\n", s);
 	return version;
 }
 
@@ -140,8 +142,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 		case Opt_debug:
 			r = match_int(&args[0], &option);
 			if (r < 0) {
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					   "integer field, but no integer?\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "integer field, but no integer?\n");
 				ret = r;
 				continue;
 			}
@@ -154,8 +156,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 		case Opt_dfltuid:
 			r = match_int(&args[0], &option);
 			if (r < 0) {
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					   "integer field, but no integer?\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "integer field, but no integer?\n");
 				ret = r;
 				continue;
 			}
@@ -164,8 +166,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 		case Opt_dfltgid:
 			r = match_int(&args[0], &option);
 			if (r < 0) {
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					   "integer field, but no integer?\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "integer field, but no integer?\n");
 				ret = r;
 				continue;
 			}
@@ -174,8 +176,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 		case Opt_afid:
 			r = match_int(&args[0], &option);
 			if (r < 0) {
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					   "integer field, but no integer?\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "integer field, but no integer?\n");
 				ret = r;
 				continue;
 			}
@@ -205,8 +207,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 			s = match_strdup(&args[0]);
 			if (!s) {
 				ret = -ENOMEM;
-				P9_DPRINTK(P9_DEBUG_ERROR,
-				  "problem allocating copy of cache arg\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "problem allocating copy of cache arg\n");
 				goto free_and_return;
 			}
 			ret = get_cache_mode(s);
@@ -223,8 +225,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 			s = match_strdup(&args[0]);
 			if (!s) {
 				ret = -ENOMEM;
-				P9_DPRINTK(P9_DEBUG_ERROR,
-				  "problem allocating copy of access arg\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "problem allocating copy of access arg\n");
 				goto free_and_return;
 			}
 
@@ -240,8 +242,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 				v9ses->uid = simple_strtoul(s, &e, 10);
 				if (*e != '\0') {
 					ret = -EINVAL;
-					printk(KERN_INFO "9p: Unknown access "
-							"argument %s.\n", s);
+					pr_info("Unknown access argument %s\n",
+						s);
 					kfree(s);
 					goto free_and_return;
 				}
@@ -254,9 +256,8 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
 #ifdef CONFIG_9P_FS_POSIX_ACL
 			v9ses->flags |= V9FS_POSIX_ACL;
 #else
-			P9_DPRINTK(P9_DEBUG_ERROR,
-					"Not defined CONFIG_9P_FS_POSIX_ACL. "
-					"Ignoring posixacl option\n");
+			p9_debug(P9_DEBUG_ERROR,
+				 "Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n");
 #endif
 			break;
 
@@ -318,7 +319,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
 	if (IS_ERR(v9ses->clnt)) {
 		retval = PTR_ERR(v9ses->clnt);
 		v9ses->clnt = NULL;
-		P9_DPRINTK(P9_DEBUG_ERROR, "problem initializing 9p client\n");
+		p9_debug(P9_DEBUG_ERROR, "problem initializing 9p client\n");
 		goto error;
 	}
 
@@ -371,7 +372,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
 	if (IS_ERR(fid)) {
 		retval = PTR_ERR(fid);
 		fid = NULL;
-		P9_DPRINTK(P9_DEBUG_ERROR, "cannot attach\n");
+		p9_debug(P9_DEBUG_ERROR, "cannot attach\n");
 		goto error;
 	}
 
@@ -429,7 +430,7 @@ void v9fs_session_close(struct v9fs_session_info *v9ses)
  */
 
 void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
-	P9_DPRINTK(P9_DEBUG_ERROR, "cancel session %p\n", v9ses);
+	p9_debug(P9_DEBUG_ERROR, "cancel session %p\n", v9ses);
 	p9_client_disconnect(v9ses->clnt);
 }
 
@@ -442,7 +443,7 @@ void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
 
 void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses)
 {
-	P9_DPRINTK(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
+	p9_debug(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
 	p9_client_begin_disconnect(v9ses->clnt);
 }
 
@@ -591,23 +592,23 @@ static void v9fs_cache_unregister(void)
 static int __init init_v9fs(void)
 {
 	int err;
-	printk(KERN_INFO "Installing v9fs 9p2000 file system support\n");
+	pr_info("Installing v9fs 9p2000 file system support\n");
 	/* TODO: Setup list of registered trasnport modules */
 	err = register_filesystem(&v9fs_fs_type);
 	if (err < 0) {
-		printk(KERN_ERR "Failed to register filesystem\n");
+		pr_err("Failed to register filesystem\n");
 		return err;
 	}
 
 	err = v9fs_cache_register();
 	if (err < 0) {
-		printk(KERN_ERR "Failed to register v9fs for caching\n");
+		pr_err("Failed to register v9fs for caching\n");
 		goto out_fs_unreg;
 	}
 
 	err = v9fs_sysfs_init();
 	if (err < 0) {
-		printk(KERN_ERR "Failed to register with sysfs\n");
+		pr_err("Failed to register with sysfs\n");
 		goto out_sysfs_cleanup;
 	}
 
@@ -637,6 +638,30 @@ static void __exit exit_v9fs(void)
 module_init(init_v9fs)
 module_exit(exit_v9fs)
 
+#ifdef CONFIG_NET_9P_DEBUG
+void _p9_debug(enum p9_debug_flags level, const char *func,
+	       const char *fmt, ...)
+{
+	struct va_format vaf;
+	va_list args;
+
+	if ((p9_debug_level & level) != level)
+		return;
+
+	va_start(args, fmt);
+
+	vaf.fmt = fmt;
+	vaf.va = &args;
+
+	if (level == P9_DEBUG_9P)
+		pr_notice("(%8.8d) %pV", task_pid_nr(current), &vaf);
+	else
+		pr_notice("-- %s (%d): %pV", func, task_pid_nr(current), &vaf);
+
+	va_end(args);
+}
+#endif
+
 MODULE_AUTHOR("Latchesar Ionkov <lucho@ionkov.net>");
 MODULE_AUTHOR("Eric Van Hensbergen <ericvh@gmail.com>");
 MODULE_AUTHOR("Ron Minnich <rminnich@lanl.gov>");
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 2524e4c..0ad61c6 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -56,7 +56,7 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page)
 	struct inode *inode;
 
 	inode = page->mapping->host;
-	P9_DPRINTK(P9_DEBUG_VFS, "\n");
+	p9_debug(P9_DEBUG_VFS, "\n");
 
 	BUG_ON(!PageLocked(page));
 
@@ -116,14 +116,14 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping,
 	struct inode *inode;
 
 	inode = mapping->host;
-	P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp);
+	p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, filp);
 
 	ret = v9fs_readpages_from_fscache(inode, mapping, pages, &nr_pages);
 	if (ret == 0)
 		return ret;
 
 	ret = read_cache_pages(mapping, pages, (void *)v9fs_vfs_readpage, filp);
-	P9_DPRINTK(P9_DEBUG_VFS, "  = %d\n", ret);
+	p9_debug(P9_DEBUG_VFS, "  = %d\n", ret);
 	return ret;
 }
 
@@ -263,10 +263,9 @@ v9fs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 	 * Now that we do caching with cache mode enabled, We need
 	 * to support direct IO
 	 */
-	P9_DPRINTK(P9_DEBUG_VFS, "v9fs_direct_IO: v9fs_direct_IO (%s) "
-			"off/no(%lld/%lu) EINVAL\n",
-			iocb->ki_filp->f_path.dentry->d_name.name,
-			(long long) pos, nr_segs);
+	p9_debug(P9_DEBUG_VFS, "v9fs_direct_IO: v9fs_direct_IO (%s) off/no(%lld/%lu) EINVAL\n",
+		 iocb->ki_filp->f_path.dentry->d_name.name,
+		 (long long)pos, nr_segs);
 
 	return -EINVAL;
 }
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c
index e022890..d529437 100644
--- a/fs/9p/vfs_dentry.c
+++ b/fs/9p/vfs_dentry.c
@@ -53,8 +53,8 @@
 
 static int v9fs_dentry_delete(const struct dentry *dentry)
 {
-	P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
-									dentry);
+	p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",
+		 dentry->d_name.name, dentry);
 
 	return 1;
 }
@@ -66,8 +66,8 @@ static int v9fs_dentry_delete(const struct dentry *dentry)
  */
 static int v9fs_cached_dentry_delete(const struct dentry *dentry)
 {
-	P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n",
-		   dentry->d_name.name, dentry);
+	p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",
+		 dentry->d_name.name, dentry);
 
 	/* Don't cache negative dentries */
 	if (!dentry->d_inode)
@@ -86,8 +86,8 @@ static void v9fs_dentry_release(struct dentry *dentry)
 	struct v9fs_dentry *dent;
 	struct p9_fid *temp, *current_fid;
 
-	P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
-									dentry);
+	p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n",
+		 dentry->d_name.name, dentry);
 	dent = dentry->d_fsdata;
 	if (dent) {
 		list_for_each_entry_safe(current_fid, temp, &dent->fidlist,
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 598fff1..ff911e7 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -140,7 +140,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
 	int reclen = 0;
 	struct p9_rdir *rdir;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
 	fid = filp->private_data;
 
 	buflen = fid->clnt->msize - P9_IOHDRSZ;
@@ -168,7 +168,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
 			err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
 					  rdir->tail - rdir->head, &st);
 			if (err) {
-				P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);
+				p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
 				err = -EIO;
 				p9stat_free(&st);
 				goto unlock_and_exit;
@@ -213,7 +213,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
 	struct p9_dirent curdirent;
 	u64 oldoffset = 0;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
 	fid = filp->private_data;
 
 	buflen = fid->clnt->msize - P9_READDIRHDRSZ;
@@ -244,7 +244,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
 					    rdir->tail - rdir->head,
 					    &curdirent);
 			if (err < 0) {
-				P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);
+				p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
 				err = -EIO;
 				goto unlock_and_exit;
 			}
@@ -290,9 +290,8 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
 	struct p9_fid *fid;
 
 	fid = filp->private_data;
-	P9_DPRINTK(P9_DEBUG_VFS,
-			"v9fs_dir_release: inode: %p filp: %p fid: %d\n",
-			inode, filp, fid ? fid->fid : -1);
+	p9_debug(P9_DEBUG_VFS, "inode: %p filp: %p fid: %d\n",
+		 inode, filp, fid ? fid->fid : -1);
 	if (fid)
 		p9_client_clunk(fid);
 	return 0;
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 62857a8..8947f9f 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -61,7 +61,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
 	struct p9_fid *fid;
 	int omode;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file);
+	p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file);
 	v9inode = V9FS_I(inode);
 	v9ses = v9fs_inode2v9ses(inode);
 	if (v9fs_proto_dotl(v9ses))
@@ -135,7 +135,7 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl)
 	int res = 0;
 	struct inode *inode = filp->f_path.dentry->d_inode;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
+	p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl);
 
 	/* No mandatory locks */
 	if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
@@ -304,8 +304,8 @@ static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl)
 	struct inode *inode = filp->f_path.dentry->d_inode;
 	int ret = -ENOLCK;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", filp,
-				cmd, fl, filp->f_path.dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n",
+		 filp, cmd, fl, filp->f_path.dentry->d_name.name);
 
 	/* No mandatory locks */
 	if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
@@ -340,8 +340,8 @@ static int v9fs_file_flock_dotl(struct file *filp, int cmd,
 	struct inode *inode = filp->f_path.dentry->d_inode;
 	int ret = -ENOLCK;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", filp,
-				cmd, fl, filp->f_path.dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n",
+		 filp, cmd, fl, filp->f_path.dentry->d_name.name);
 
 	/* No mandatory locks */
 	if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK)
@@ -384,8 +384,8 @@ v9fs_fid_readn(struct p9_fid *fid, char *data, char __user *udata, u32 count,
 {
 	int n, total, size;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "fid %d offset %llu count %d\n", fid->fid,
-		   (long long unsigned) offset, count);
+	p9_debug(P9_DEBUG_VFS, "fid %d offset %llu count %d\n",
+		 fid->fid, (long long unsigned)offset, count);
 	n = 0;
 	total = 0;
 	size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ;
@@ -443,7 +443,7 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count,
 	struct p9_fid *fid;
 	size_t size;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset);
+	p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset);
 	fid = filp->private_data;
 
 	size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ;
@@ -470,8 +470,8 @@ v9fs_file_write_internal(struct inode *inode, struct p9_fid *fid,
 	loff_t origin = *offset;
 	unsigned long pg_start, pg_end;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data,
-		(int)count, (int)*offset);
+	p9_debug(P9_DEBUG_VFS, "data %p count %d offset %x\n",
+		 data, (int)count, (int)*offset);
 
 	clnt = fid->clnt;
 	do {
@@ -552,7 +552,7 @@ static int v9fs_file_fsync(struct file *filp, loff_t start, loff_t end,
 		return retval;
 
 	mutex_lock(&inode->i_mutex);
-	P9_DPRINTK(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync);
+	p9_debug(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync);
 
 	fid = filp->private_data;
 	v9fs_blank_wstat(&wstat);
@@ -575,8 +575,7 @@ int v9fs_file_fsync_dotl(struct file *filp, loff_t start, loff_t end,
 		return retval;
 
 	mutex_lock(&inode->i_mutex);
-	P9_DPRINTK(P9_DEBUG_VFS, "v9fs_file_fsync_dotl: filp %p datasync %x\n",
-			filp, datasync);
+	p9_debug(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync);
 
 	fid = filp->private_data;
 
@@ -607,8 +606,8 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 	struct inode *inode = filp->f_path.dentry->d_inode;
 
 
-	P9_DPRINTK(P9_DEBUG_VFS, "page %p fid %lx\n",
-		   page, (unsigned long)filp->private_data);
+	p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n",
+		 page, (unsigned long)filp->private_data);
 
 	v9inode = V9FS_I(inode);
 	/* make sure the cache has finished storing the page */
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 879ed88..85c2973 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -133,9 +135,8 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses,
 			res |= S_IFBLK;
 			break;
 		default:
-			P9_DPRINTK(P9_DEBUG_ERROR,
-				"Unknown special type %c %s\n", type,
-				stat->extension);
+			p9_debug(P9_DEBUG_ERROR, "Unknown special type %c %s\n",
+				 type, stat->extension);
 		};
 		*rdev = MKDEV(major, minor);
 	} else
@@ -281,8 +282,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
 		} else if (v9fs_proto_dotu(v9ses)) {
 			inode->i_op = &v9fs_file_inode_operations;
 		} else {
-			P9_DPRINTK(P9_DEBUG_ERROR,
-				   "special files without extended mode\n");
+			p9_debug(P9_DEBUG_ERROR,
+				 "special files without extended mode\n");
 			err = -EINVAL;
 			goto error;
 		}
@@ -307,8 +308,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
 		break;
 	case S_IFLNK:
 		if (!v9fs_proto_dotu(v9ses) && !v9fs_proto_dotl(v9ses)) {
-			P9_DPRINTK(P9_DEBUG_ERROR, "extended modes used with "
-						"legacy protocol.\n");
+			p9_debug(P9_DEBUG_ERROR,
+				 "extended modes used with legacy protocol\n");
 			err = -EINVAL;
 			goto error;
 		}
@@ -335,8 +336,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
 
 		break;
 	default:
-		P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n",
-			   mode, mode & S_IFMT);
+		p9_debug(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n",
+			 mode, mode & S_IFMT);
 		err = -EINVAL;
 		goto error;
 	}
@@ -358,11 +359,12 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t rdev)
 	struct inode *inode;
 	struct v9fs_session_info *v9ses = sb->s_fs_info;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode);
+	p9_debug(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode);
 
 	inode = new_inode(sb);
 	if (!inode) {
-		P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n");
+		pr_warn("%s (%d): Problem allocating inode\n",
+			__func__, task_pid_nr(current));
 		return ERR_PTR(-ENOMEM);
 	}
 	err = v9fs_init_inode(v9ses, inode, mode, rdev);
@@ -578,15 +580,15 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags)
 	struct p9_fid *v9fid, *dfid;
 	struct v9fs_session_info *v9ses;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: %x\n",
-		   dir, dentry, flags);
+	p9_debug(P9_DEBUG_VFS, "inode: %p dentry: %p rmdir: %x\n",
+		 dir, dentry, flags);
 
 	v9ses = v9fs_inode2v9ses(dir);
 	inode = dentry->d_inode;
 	dfid = v9fs_fid_lookup(dentry->d_parent);
 	if (IS_ERR(dfid)) {
 		retval = PTR_ERR(dfid);
-		P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", retval);
+		p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", retval);
 		return retval;
 	}
 	if (v9fs_proto_dotl(v9ses))
@@ -635,7 +637,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 	struct p9_fid *dfid, *ofid, *fid;
 	struct inode *inode;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
 
 	err = 0;
 	ofid = NULL;
@@ -644,7 +646,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 	dfid = v9fs_fid_lookup(dentry->d_parent);
 	if (IS_ERR(dfid)) {
 		err = PTR_ERR(dfid);
-		P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
 		return ERR_PTR(err);
 	}
 
@@ -652,13 +654,13 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 	ofid = p9_client_walk(dfid, 0, NULL, 1);
 	if (IS_ERR(ofid)) {
 		err = PTR_ERR(ofid);
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
 		return ERR_PTR(err);
 	}
 
 	err = p9_client_fcreate(ofid, name, perm, mode, extension);
 	if (err < 0) {
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_fcreate failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_fcreate failed %d\n", err);
 		goto error;
 	}
 
@@ -666,7 +668,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 	fid = p9_client_walk(dfid, 1, &name, 1);
 	if (IS_ERR(fid)) {
 		err = PTR_ERR(fid);
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
 		fid = NULL;
 		goto error;
 	}
@@ -675,7 +677,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 	inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
 	if (IS_ERR(inode)) {
 		err = PTR_ERR(inode);
-		P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", err);
 		goto error;
 	}
 	err = v9fs_fid_add(dentry, fid);
@@ -793,7 +795,7 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 	struct p9_fid *fid;
 	struct v9fs_session_info *v9ses;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
 	err = 0;
 	v9ses = v9fs_inode2v9ses(dir);
 	perm = unixmode2p9mode(v9ses, mode | S_IFDIR);
@@ -831,8 +833,8 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
 	char *name;
 	int result = 0;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
-		dir, dentry->d_name.name, dentry, nameidata);
+	p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
+		 dir, dentry->d_name.name, dentry, nameidata);
 
 	if (dentry->d_name.len > NAME_MAX)
 		return ERR_PTR(-ENAMETOOLONG);
@@ -938,7 +940,7 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	struct p9_fid *newdirfid;
 	struct p9_wstat wstat;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "\n");
+	p9_debug(P9_DEBUG_VFS, "\n");
 	retval = 0;
 	old_inode = old_dentry->d_inode;
 	new_inode = new_dentry->d_inode;
@@ -974,8 +976,7 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 		 * 9P .u can only handle file rename in the same directory
 		 */
 
-		P9_DPRINTK(P9_DEBUG_ERROR,
-				"old dir and new dir are different\n");
+		p9_debug(P9_DEBUG_ERROR, "old dir and new dir are different\n");
 		retval = -EXDEV;
 		goto clunk_newdir;
 	}
@@ -1031,7 +1032,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
 	struct p9_fid *fid;
 	struct p9_wstat *st;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
+	p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
 	err = -EPERM;
 	v9ses = v9fs_dentry2v9ses(dentry);
 	if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
@@ -1068,7 +1069,7 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
 	struct p9_fid *fid;
 	struct p9_wstat wstat;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "\n");
+	p9_debug(P9_DEBUG_VFS, "\n");
 	retval = inode_change_ok(dentry->d_inode, iattr);
 	if (retval)
 		return retval;
@@ -1213,7 +1214,7 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
 	struct p9_fid *fid;
 	struct p9_wstat *st;
 
-	P9_DPRINTK(P9_DEBUG_VFS, " %s\n", dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, " %s\n", dentry->d_name.name);
 	retval = -EPERM;
 	v9ses = v9fs_dentry2v9ses(dentry);
 	fid = v9fs_fid_lookup(dentry);
@@ -1235,8 +1236,8 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
 	/* copy extension buffer into buffer */
 	strncpy(buffer, st->extension, buflen);
 
-	P9_DPRINTK(P9_DEBUG_VFS,
-		"%s -> %s (%s)\n", dentry->d_name.name, st->extension, buffer);
+	p9_debug(P9_DEBUG_VFS, "%s -> %s (%s)\n",
+		 dentry->d_name.name, st->extension, buffer);
 
 	retval = strnlen(buffer, buflen);
 done:
@@ -1257,7 +1258,7 @@ static void *v9fs_vfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 	int len = 0;
 	char *link = __getname();
 
-	P9_DPRINTK(P9_DEBUG_VFS, "%s n", dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "%s\n", dentry->d_name.name);
 
 	if (!link)
 		link = ERR_PTR(-ENOMEM);
@@ -1288,8 +1289,8 @@ v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
 {
 	char *s = nd_get_link(nd);
 
-	P9_DPRINTK(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name,
-		IS_ERR(s) ? "<error>" : s);
+	p9_debug(P9_DEBUG_VFS, " %s %s\n",
+		 dentry->d_name.name, IS_ERR(s) ? "<error>" : s);
 	if (!IS_ERR(s))
 		__putname(s);
 }
@@ -1312,7 +1313,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
 
 	v9ses = v9fs_inode2v9ses(dir);
 	if (!v9fs_proto_dotu(v9ses)) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "not extended\n");
+		p9_debug(P9_DEBUG_ERROR, "not extended\n");
 		return -EPERM;
 	}
 
@@ -1340,8 +1341,8 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,
 static int
 v9fs_vfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
 {
-	P9_DPRINTK(P9_DEBUG_VFS, " %lu,%s,%s\n", dir->i_ino,
-					dentry->d_name.name, symname);
+	p9_debug(P9_DEBUG_VFS, " %lu,%s,%s\n",
+		 dir->i_ino, dentry->d_name.name, symname);
 
 	return v9fs_vfs_mkspecial(dir, dentry, S_IFLNK, symname);
 }
@@ -1362,9 +1363,8 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,
 	char *name;
 	struct p9_fid *oldfid;
 
-	P9_DPRINTK(P9_DEBUG_VFS,
-		" %lu,%s,%s\n", dir->i_ino, dentry->d_name.name,
-		old_dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, " %lu,%s,%s\n",
+		 dir->i_ino, dentry->d_name.name, old_dentry->d_name.name);
 
 	oldfid = v9fs_fid_clone(old_dentry);
 	if (IS_ERR(oldfid))
@@ -1403,9 +1403,9 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
 	int retval;
 	char *name;
 
-	P9_DPRINTK(P9_DEBUG_VFS,
-		" %lu,%s mode: %x MAJOR: %u MINOR: %u\n", dir->i_ino,
-		dentry->d_name.name, mode, MAJOR(rdev), MINOR(rdev));
+	p9_debug(P9_DEBUG_VFS, " %lu,%s mode: %x MAJOR: %u MINOR: %u\n",
+		 dir->i_ino, dentry->d_name.name, mode,
+		 MAJOR(rdev), MINOR(rdev));
 
 	if (!new_valid_dev(rdev))
 		return -EINVAL;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 0b5745e..73488fb 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -283,13 +283,13 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	}
 
 	name = (char *) dentry->d_name.name;
-	P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_create_dotl: name:%s flags:0x%x "
-			"mode:0x%x\n", name, flags, omode);
+	p9_debug(P9_DEBUG_VFS, "name:%s flags:0x%x mode:0x%x\n",
+		 name, flags, omode);
 
 	dfid = v9fs_fid_lookup(dentry->d_parent);
 	if (IS_ERR(dfid)) {
 		err = PTR_ERR(dfid);
-		P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
 		return err;
 	}
 
@@ -297,7 +297,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	ofid = p9_client_walk(dfid, 0, NULL, 1);
 	if (IS_ERR(ofid)) {
 		err = PTR_ERR(ofid);
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
 		return err;
 	}
 
@@ -307,16 +307,15 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	/* Update mode based on ACL value */
 	err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
 	if (err) {
-		P9_DPRINTK(P9_DEBUG_VFS,
-			   "Failed to get acl values in creat %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
+			 err);
 		goto error;
 	}
 	err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),
 				    mode, gid, &qid);
 	if (err < 0) {
-		P9_DPRINTK(P9_DEBUG_VFS,
-				"p9_client_open_dotl failed in creat %d\n",
-				err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
+			 err);
 		goto error;
 	}
 	v9fs_invalidate_inode_attr(dir);
@@ -325,14 +324,14 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	fid = p9_client_walk(dfid, 1, &name, 1);
 	if (IS_ERR(fid)) {
 		err = PTR_ERR(fid);
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
 		fid = NULL;
 		goto error;
 	}
 	inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
 	if (IS_ERR(inode)) {
 		err = PTR_ERR(inode);
-		P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", err);
 		goto error;
 	}
 	err = v9fs_fid_add(dentry, fid);
@@ -408,7 +407,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
 	struct dentry *dir_dentry;
 	struct posix_acl *dacl = NULL, *pacl = NULL;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
 	err = 0;
 	v9ses = v9fs_inode2v9ses(dir);
 
@@ -420,7 +419,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
 	dfid = v9fs_fid_lookup(dir_dentry);
 	if (IS_ERR(dfid)) {
 		err = PTR_ERR(dfid);
-		P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
 		dfid = NULL;
 		goto error;
 	}
@@ -430,8 +429,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
 	/* Update mode based on ACL value */
 	err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
 	if (err) {
-		P9_DPRINTK(P9_DEBUG_VFS,
-			   "Failed to get acl values in mkdir %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "Failed to get acl values in mkdir %d\n",
+			 err);
 		goto error;
 	}
 	name = (char *) dentry->d_name.name;
@@ -444,8 +443,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
 		fid = p9_client_walk(dfid, 1, &name, 1);
 		if (IS_ERR(fid)) {
 			err = PTR_ERR(fid);
-			P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
-				err);
+			p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
+				 err);
 			fid = NULL;
 			goto error;
 		}
@@ -453,8 +452,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
 		inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
 		if (IS_ERR(inode)) {
 			err = PTR_ERR(inode);
-			P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n",
-				err);
+			p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
+				 err);
 			goto error;
 		}
 		err = v9fs_fid_add(dentry, fid);
@@ -495,7 +494,7 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,
 	struct p9_fid *fid;
 	struct p9_stat_dotl *st;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry);
+	p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
 	err = -EPERM;
 	v9ses = v9fs_dentry2v9ses(dentry);
 	if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
@@ -537,7 +536,7 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
 	struct p9_fid *fid;
 	struct p9_iattr_dotl p9attr;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "\n");
+	p9_debug(P9_DEBUG_VFS, "\n");
 
 	retval = inode_change_ok(dentry->d_inode, iattr);
 	if (retval)
@@ -670,14 +669,13 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
 	struct v9fs_session_info *v9ses;
 
 	name = (char *) dentry->d_name.name;
-	P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_symlink_dotl : %lu,%s,%s\n",
-			dir->i_ino, name, symname);
+	p9_debug(P9_DEBUG_VFS, "%lu,%s,%s\n", dir->i_ino, name, symname);
 	v9ses = v9fs_inode2v9ses(dir);
 
 	dfid = v9fs_fid_lookup(dentry->d_parent);
 	if (IS_ERR(dfid)) {
 		err = PTR_ERR(dfid);
-		P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
 		return err;
 	}
 
@@ -687,7 +685,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
 	err = p9_client_symlink(dfid, name, (char *)symname, gid, &qid);
 
 	if (err < 0) {
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err);
 		goto error;
 	}
 
@@ -697,8 +695,8 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
 		fid = p9_client_walk(dfid, 1, &name, 1);
 		if (IS_ERR(fid)) {
 			err = PTR_ERR(fid);
-			P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
-					err);
+			p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
+				 err);
 			fid = NULL;
 			goto error;
 		}
@@ -707,8 +705,8 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
 		inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
 		if (IS_ERR(inode)) {
 			err = PTR_ERR(inode);
-			P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n",
-					err);
+			p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
+				 err);
 			goto error;
 		}
 		err = v9fs_fid_add(dentry, fid);
@@ -751,9 +749,8 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
 	struct p9_fid *dfid, *oldfid;
 	struct v9fs_session_info *v9ses;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: %s\n",
-			dir->i_ino, old_dentry->d_name.name,
-			dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: %s\n",
+		 dir->i_ino, old_dentry->d_name.name, dentry->d_name.name);
 
 	v9ses = v9fs_inode2v9ses(dir);
 	dir_dentry = v9fs_dentry_from_dir_inode(dir);
@@ -770,7 +767,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
 	err = p9_client_link(dfid, oldfid, (char *)dentry->d_name.name);
 
 	if (err < 0) {
-		P9_DPRINTK(P9_DEBUG_VFS, "p9_client_link failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "p9_client_link failed %d\n", err);
 		return err;
 	}
 
@@ -813,9 +810,9 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	struct dentry *dir_dentry;
 	struct posix_acl *dacl = NULL, *pacl = NULL;
 
-	P9_DPRINTK(P9_DEBUG_VFS,
-		" %lu,%s mode: %x MAJOR: %u MINOR: %u\n", dir->i_ino,
-		dentry->d_name.name, omode, MAJOR(rdev), MINOR(rdev));
+	p9_debug(P9_DEBUG_VFS, " %lu,%s mode: %x MAJOR: %u MINOR: %u\n",
+		 dir->i_ino, dentry->d_name.name, omode,
+		 MAJOR(rdev), MINOR(rdev));
 
 	if (!new_valid_dev(rdev))
 		return -EINVAL;
@@ -825,7 +822,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	dfid = v9fs_fid_lookup(dir_dentry);
 	if (IS_ERR(dfid)) {
 		err = PTR_ERR(dfid);
-		P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
 		dfid = NULL;
 		goto error;
 	}
@@ -835,8 +832,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
 	/* Update mode based on ACL value */
 	err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
 	if (err) {
-		P9_DPRINTK(P9_DEBUG_VFS,
-			   "Failed to get acl values in mknod %d\n", err);
+		p9_debug(P9_DEBUG_VFS, "Failed to get acl values in mknod %d\n",
+			 err);
 		goto error;
 	}
 	name = (char *) dentry->d_name.name;
@@ -851,8 +848,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
 		fid = p9_client_walk(dfid, 1, &name, 1);
 		if (IS_ERR(fid)) {
 			err = PTR_ERR(fid);
-			P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
-				err);
+			p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
+				 err);
 			fid = NULL;
 			goto error;
 		}
@@ -860,8 +857,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
 		inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
 		if (IS_ERR(inode)) {
 			err = PTR_ERR(inode);
-			P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n",
-				err);
+			p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
+				 err);
 			goto error;
 		}
 		err = v9fs_fid_add(dentry, fid);
@@ -905,7 +902,7 @@ v9fs_vfs_follow_link_dotl(struct dentry *dentry, struct nameidata *nd)
 	char *link = __getname();
 	char *target;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "%s\n", dentry->d_name.name);
+	p9_debug(P9_DEBUG_VFS, "%s\n", dentry->d_name.name);
 
 	if (!link) {
 		link = ERR_PTR(-ENOMEM);
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index c70251d..06d19735 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -121,7 +121,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
 	struct p9_fid *fid;
 	int retval = 0;
 
-	P9_DPRINTK(P9_DEBUG_VFS, " \n");
+	p9_debug(P9_DEBUG_VFS, "\n");
 
 	v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
 	if (!v9ses)
@@ -191,7 +191,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
 		goto release_sb;
 	v9fs_fid_add(root, fid);
 
-	P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
+	p9_debug(P9_DEBUG_VFS, " simple set mount, return 0\n");
 	return dget(sb->s_root);
 
 clunk_fid:
@@ -223,7 +223,7 @@ static void v9fs_kill_super(struct super_block *s)
 {
 	struct v9fs_session_info *v9ses = s->s_fs_info;
 
-	P9_DPRINTK(P9_DEBUG_VFS, " %p\n", s);
+	p9_debug(P9_DEBUG_VFS, " %p\n", s);
 
 	kill_anon_super(s);
 
@@ -231,7 +231,7 @@ static void v9fs_kill_super(struct super_block *s)
 	v9fs_session_close(v9ses);
 	kfree(v9ses);
 	s->s_fs_info = NULL;
-	P9_DPRINTK(P9_DEBUG_VFS, "exiting kill_super\n");
+	p9_debug(P9_DEBUG_VFS, "exiting kill_super\n");
 }
 
 static void
@@ -303,7 +303,7 @@ static int v9fs_write_inode(struct inode *inode,
 	 * send an fsync request to server irrespective of
 	 * wbc->sync_mode.
 	 */
-	P9_DPRINTK(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
+	p9_debug(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
 	v9inode = V9FS_I(inode);
 	if (!v9inode->writeback_fid)
 		return 0;
@@ -326,7 +326,7 @@ static int v9fs_write_inode_dotl(struct inode *inode,
 	 * send an fsync request to server irrespective of
 	 * wbc->sync_mode.
 	 */
-	P9_DPRINTK(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
+	p9_debug(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
 	v9inode = V9FS_I(inode);
 	if (!v9inode->writeback_fid)
 		return 0;
diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c
index d288773..29653b7 100644
--- a/fs/9p/xattr.c
+++ b/fs/9p/xattr.c
@@ -32,8 +32,8 @@ ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
 	attr_fid = p9_client_xattrwalk(fid, name, &attr_size);
 	if (IS_ERR(attr_fid)) {
 		retval = PTR_ERR(attr_fid);
-		P9_DPRINTK(P9_DEBUG_VFS,
-			"p9_client_attrwalk failed %zd\n", retval);
+		p9_debug(P9_DEBUG_VFS, "p9_client_attrwalk failed %zd\n",
+			 retval);
 		attr_fid = NULL;
 		goto error;
 	}
@@ -87,8 +87,8 @@ ssize_t v9fs_xattr_get(struct dentry *dentry, const char *name,
 {
 	struct p9_fid *fid;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "%s: name = %s value_len = %zu\n",
-		__func__, name, buffer_size);
+	p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu\n",
+		 name, buffer_size);
 	fid = v9fs_fid_lookup(dentry);
 	if (IS_ERR(fid))
 		return PTR_ERR(fid);
@@ -115,8 +115,8 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name,
 	int retval, msize, write_count;
 	struct p9_fid *fid = NULL;
 
-	P9_DPRINTK(P9_DEBUG_VFS, "%s: name = %s value_len = %zu flags = %d\n",
-		__func__, name, value_len, flags);
+	p9_debug(P9_DEBUG_VFS, "name = %s value_len = %zu flags = %d\n",
+		 name, value_len, flags);
 
 	fid = v9fs_fid_clone(dentry);
 	if (IS_ERR(fid)) {
@@ -129,8 +129,8 @@ int v9fs_xattr_set(struct dentry *dentry, const char *name,
 	 */
 	retval = p9_client_xattrcreate(fid, name, value_len, flags);
 	if (retval < 0) {
-		P9_DPRINTK(P9_DEBUG_VFS,
-			"p9_client_xattrcreate failed %d\n", retval);
+		p9_debug(P9_DEBUG_VFS, "p9_client_xattrcreate failed %d\n",
+			 retval);
 		goto error;
 	}
 	msize = fid->clnt->msize;
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 2d70b95..7184853 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -63,30 +63,16 @@ enum p9_debug_flags {
 
 #ifdef CONFIG_NET_9P_DEBUG
 extern unsigned int p9_debug_level;
-
-#define P9_DPRINTK(level, format, arg...) \
-do {  \
-	if ((p9_debug_level & level) == level) {\
-		if (level == P9_DEBUG_9P) \
-			printk(KERN_NOTICE "(%8.8d) " \
-			format , task_pid_nr(current) , ## arg); \
-		else \
-			printk(KERN_NOTICE "-- %s (%d): " \
-			format , __func__, task_pid_nr(current) , ## arg); \
-	} \
-} while (0)
-
+__printf(3, 4)
+void _p9_debug(enum p9_debug_flags level, const char *func,
+	       const char *fmt, ...);
+#define p9_debug(level, fmt, ...)			\
+	_p9_debug(level, __func__, fmt, ##__VA_ARGS__)
 #else
-#define P9_DPRINTK(level, format, arg...)  do { } while (0)
+#define p9_debug(level, fmt, ...)			\
+	no_printk(fmt, ##__VA_ARGS__)
 #endif
 
-
-#define P9_EPRINTK(level, format, arg...) \
-do { \
-	printk(level "9p: %s (%d): " \
-		format , __func__, task_pid_nr(current), ## arg); \
-} while (0)
-
 /**
  * enum p9_msg_t - 9P message types
  * @P9_TLERROR: not used
diff --git a/net/9p/client.c b/net/9p/client.c
index 854ca7a..776618c 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
@@ -81,15 +83,15 @@ static int get_protocol_version(char *s)
 
 	if (!strcmp(s, "9p2000")) {
 		version = p9_proto_legacy;
-		P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");
+		p9_debug(P9_DEBUG_9P, "Protocol version: Legacy\n");
 	} else if (!strcmp(s, "9p2000.u")) {
 		version = p9_proto_2000u;
-		P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.u\n");
+		p9_debug(P9_DEBUG_9P, "Protocol version: 9P2000.u\n");
 	} else if (!strcmp(s, "9p2000.L")) {
 		version = p9_proto_2000L;
-		P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.L\n");
+		p9_debug(P9_DEBUG_9P, "Protocol version: 9P2000.L\n");
 	} else
-		printk(KERN_INFO "9p: Unknown protocol version %s.\n", s);
+		pr_info("Unknown protocol version %s\n", s);
 
 	return version;
 }
@@ -119,8 +121,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
 
 	tmp_options = kstrdup(opts, GFP_KERNEL);
 	if (!tmp_options) {
-		P9_DPRINTK(P9_DEBUG_ERROR,
-				"failed to allocate copy of option string\n");
+		p9_debug(P9_DEBUG_ERROR,
+			 "failed to allocate copy of option string\n");
 		return -ENOMEM;
 	}
 	options = tmp_options;
@@ -134,8 +136,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
 		case Opt_msize:
 			r = match_int(&args[0], &option);
 			if (r < 0) {
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					   "integer field, but no integer?\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "integer field, but no integer?\n");
 				ret = r;
 				continue;
 			}
@@ -145,15 +147,14 @@ static int parse_opts(char *opts, struct p9_client *clnt)
 			s = match_strdup(&args[0]);
 			if (!s) {
 				ret = -ENOMEM;
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					"problem allocating copy of trans arg\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "problem allocating copy of trans arg\n");
 				goto free_and_return;
 			 }
 			clnt->trans_mod = v9fs_get_trans_by_name(s);
 			if (clnt->trans_mod == NULL) {
-				printk(KERN_INFO
-					"9p: Could not find "
-					"request transport: %s\n", s);
+				pr_info("Could not find request transport: %s\n",
+					s);
 				ret = -EINVAL;
 				kfree(s);
 				goto free_and_return;
@@ -167,8 +168,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
 			s = match_strdup(&args[0]);
 			if (!s) {
 				ret = -ENOMEM;
-				P9_DPRINTK(P9_DEBUG_ERROR,
-					"problem allocating copy of version arg\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "problem allocating copy of version arg\n");
 				goto free_and_return;
 			}
 			ret = get_protocol_version(s);
@@ -225,7 +226,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
 					sizeof(struct p9_req_t), GFP_ATOMIC);
 
 			if (!c->reqs[row]) {
-				printk(KERN_ERR "Couldn't grow tag array\n");
+				pr_err("Couldn't grow tag array\n");
 				spin_unlock_irqrestore(&c->lock, flags);
 				return ERR_PTR(-ENOMEM);
 			}
@@ -244,7 +245,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
 	if (!req->tc) {
 		req->wq = kmalloc(sizeof(wait_queue_head_t), GFP_NOFS);
 		if (!req->wq) {
-			printk(KERN_ERR "Couldn't grow tag array\n");
+			pr_err("Couldn't grow tag array\n");
 			return ERR_PTR(-ENOMEM);
 		}
 		init_waitqueue_head(req->wq);
@@ -253,7 +254,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
 		req->rc = kmalloc(sizeof(struct p9_fcall) + alloc_msize,
 				  GFP_NOFS);
 		if ((!req->tc) || (!req->rc)) {
-			printk(KERN_ERR "Couldn't grow tag array\n");
+			pr_err("Couldn't grow tag array\n");
 			kfree(req->tc);
 			kfree(req->rc);
 			kfree(req->wq);
@@ -343,9 +344,9 @@ static void p9_tag_cleanup(struct p9_client *c)
 	for (row = 0; row < (c->max_tag/P9_ROW_MAXTAG); row++) {
 		for (col = 0; col < P9_ROW_MAXTAG; col++) {
 			if (c->reqs[row][col].status != REQ_STATUS_IDLE) {
-				P9_DPRINTK(P9_DEBUG_MUX,
-				  "Attempting to cleanup non-free tag %d,%d\n",
-				  row, col);
+				p9_debug(P9_DEBUG_MUX,
+					 "Attempting to cleanup non-free tag %d,%d\n",
+					 row, col);
 				/* TODO: delay execution of cleanup */
 				return;
 			}
@@ -379,7 +380,7 @@ static void p9_tag_cleanup(struct p9_client *c)
 static void p9_free_req(struct p9_client *c, struct p9_req_t *r)
 {
 	int tag = r->tc->tag;
-	P9_DPRINTK(P9_DEBUG_MUX, "clnt %p req %p tag: %d\n", c, r, tag);
+	p9_debug(P9_DEBUG_MUX, "clnt %p req %p tag: %d\n", c, r, tag);
 
 	r->status = REQ_STATUS_IDLE;
 	if (tag != P9_NOTAG && p9_idpool_check(tag, c->tagpool))
@@ -394,9 +395,9 @@ static void p9_free_req(struct p9_client *c, struct p9_req_t *r)
  */
 void p9_client_cb(struct p9_client *c, struct p9_req_t *req)
 {
-	P9_DPRINTK(P9_DEBUG_MUX, " tag %d\n", req->tc->tag);
+	p9_debug(P9_DEBUG_MUX, " tag %d\n", req->tc->tag);
 	wake_up(req->wq);
-	P9_DPRINTK(P9_DEBUG_MUX, "wakeup: %d\n", req->tc->tag);
+	p9_debug(P9_DEBUG_MUX, "wakeup: %d\n", req->tc->tag);
 }
 EXPORT_SYMBOL(p9_client_cb);
 
@@ -431,8 +432,8 @@ p9_parse_header(struct p9_fcall *pdu, int32_t *size, int8_t *type, int16_t *tag,
 	pdu->id = r_type;
 	pdu->tag = r_tag;
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< size=%d type: %d tag: %d\n", pdu->size,
-							pdu->id, pdu->tag);
+	p9_debug(P9_DEBUG_9P, "<<< size=%d type: %d tag: %d\n",
+		 pdu->size, pdu->id, pdu->tag);
 
 	if (type)
 		*type = r_type;
@@ -473,7 +474,7 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
 	 */
 	trace_9p_protocol_dump(c, req->rc);
 	if (err) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
+		p9_debug(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
 		return err;
 	}
 	if (type != P9_RERROR && type != P9_RLERROR)
@@ -492,21 +493,21 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
 		if (!err || !IS_ERR_VALUE(err)) {
 			err = p9_errstr2errno(ename, strlen(ename));
 
-			P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n",
-				   -ecode, ename);
+			p9_debug(P9_DEBUG_9P, "<<< RERROR (%d) %s\n",
+				 -ecode, ename);
 		}
 		kfree(ename);
 	} else {
 		err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode);
 		err = -ecode;
 
-		P9_DPRINTK(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
+		p9_debug(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
 	}
 
 	return err;
 
 out_err:
-	P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
+	p9_debug(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
 
 	return err;
 }
@@ -538,7 +539,7 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
 	 */
 	trace_9p_protocol_dump(c, req->rc);
 	if (err) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
+		p9_debug(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
 		return err;
 	}
 
@@ -601,22 +602,22 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
 		if (!err || !IS_ERR_VALUE(err)) {
 			err = p9_errstr2errno(ename, strlen(ename));
 
-			P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n",
-				   -ecode, ename);
+			p9_debug(P9_DEBUG_9P, "<<< RERROR (%d) %s\n",
+				 -ecode, ename);
 		}
 		kfree(ename);
 	} else {
 		err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode);
 		err = -ecode;
 
-		P9_DPRINTK(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
+		p9_debug(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
 	}
 	return err;
 
 out_free:
 	kfree(ename);
 out_err:
-	P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
+	p9_debug(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
 	return err;
 }
 
@@ -645,7 +646,7 @@ static int p9_client_flush(struct p9_client *c, struct p9_req_t *oldreq)
 	if (err)
 		return err;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TFLUSH tag %d\n", oldtag);
+	p9_debug(P9_DEBUG_9P, ">>> TFLUSH tag %d\n", oldtag);
 
 	req = p9_client_rpc(c, P9_TFLUSH, "w", oldtag);
 	if (IS_ERR(req))
@@ -670,7 +671,7 @@ static struct p9_req_t *p9_client_prepare_req(struct p9_client *c,
 	int tag, err;
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type);
+	p9_debug(P9_DEBUG_MUX, "client %p op %d\n", c, type);
 
 	/* we allow for any status other than disconnected */
 	if (c->status == Disconnected)
@@ -744,11 +745,11 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
 				       req->status >= REQ_STATUS_RCVD);
 
 	if (req->status == REQ_STATUS_ERROR) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
+		p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
 		err = req->t_err;
 	}
 	if ((err == -ERESTARTSYS) && (c->status == Connected)) {
-		P9_DPRINTK(P9_DEBUG_MUX, "flushing\n");
+		p9_debug(P9_DEBUG_MUX, "flushing\n");
 		sigpending = 1;
 		clear_thread_flag(TIF_SIGPENDING);
 
@@ -827,11 +828,11 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type,
 		goto reterr;
 	}
 	if (req->status == REQ_STATUS_ERROR) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
+		p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
 		err = req->t_err;
 	}
 	if ((err == -ERESTARTSYS) && (c->status == Connected)) {
-		P9_DPRINTK(P9_DEBUG_MUX, "flushing\n");
+		p9_debug(P9_DEBUG_MUX, "flushing\n");
 		sigpending = 1;
 		clear_thread_flag(TIF_SIGPENDING);
 
@@ -865,7 +866,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
 	struct p9_fid *fid;
 	unsigned long flags;
 
-	P9_DPRINTK(P9_DEBUG_FID, "clnt %p\n", clnt);
+	p9_debug(P9_DEBUG_FID, "clnt %p\n", clnt);
 	fid = kmalloc(sizeof(struct p9_fid), GFP_KERNEL);
 	if (!fid)
 		return ERR_PTR(-ENOMEM);
@@ -898,7 +899,7 @@ static void p9_fid_destroy(struct p9_fid *fid)
 	struct p9_client *clnt;
 	unsigned long flags;
 
-	P9_DPRINTK(P9_DEBUG_FID, "fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_FID, "fid %d\n", fid->fid);
 	clnt = fid->clnt;
 	p9_idpool_put(fid->fid, clnt->fidpool);
 	spin_lock_irqsave(&clnt->lock, flags);
@@ -915,8 +916,8 @@ static int p9_client_version(struct p9_client *c)
 	char *version;
 	int msize;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
-						c->msize, c->proto_version);
+	p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
+		 c->msize, c->proto_version);
 
 	switch (c->proto_version) {
 	case p9_proto_2000L:
@@ -941,12 +942,12 @@ static int p9_client_version(struct p9_client *c)
 
 	err = p9pdu_readf(req->rc, c->proto_version, "ds", &msize, &version);
 	if (err) {
-		P9_DPRINTK(P9_DEBUG_9P, "version error %d\n", err);
+		p9_debug(P9_DEBUG_9P, "version error %d\n", err);
 		trace_9p_protocol_dump(c, req->rc);
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version);
+	p9_debug(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version);
 	if (!strncmp(version, "9P2000.L", 8))
 		c->proto_version = p9_proto_2000L;
 	else if (!strncmp(version, "9P2000.u", 8))
@@ -996,8 +997,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
 
 	if (clnt->trans_mod == NULL) {
 		err = -EPROTONOSUPPORT;
-		P9_DPRINTK(P9_DEBUG_ERROR,
-				"No transport defined or default transport\n");
+		p9_debug(P9_DEBUG_ERROR,
+			 "No transport defined or default transport\n");
 		goto destroy_tagpool;
 	}
 
@@ -1007,8 +1008,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
 		goto put_trans;
 	}
 
-	P9_DPRINTK(P9_DEBUG_MUX, "clnt %p trans %p msize %d protocol %d\n",
-		clnt, clnt->trans_mod, clnt->msize, clnt->proto_version);
+	p9_debug(P9_DEBUG_MUX, "clnt %p trans %p msize %d protocol %d\n",
+		 clnt, clnt->trans_mod, clnt->msize, clnt->proto_version);
 
 	err = clnt->trans_mod->create(clnt, dev_name, options);
 	if (err)
@@ -1041,7 +1042,7 @@ void p9_client_destroy(struct p9_client *clnt)
 {
 	struct p9_fid *fid, *fidptr;
 
-	P9_DPRINTK(P9_DEBUG_MUX, "clnt %p\n", clnt);
+	p9_debug(P9_DEBUG_MUX, "clnt %p\n", clnt);
 
 	if (clnt->trans_mod)
 		clnt->trans_mod->close(clnt);
@@ -1049,7 +1050,7 @@ void p9_client_destroy(struct p9_client *clnt)
 	v9fs_put_trans(clnt->trans_mod);
 
 	list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) {
-		printk(KERN_INFO "Found fid %d not clunked\n", fid->fid);
+		pr_info("Found fid %d not clunked\n", fid->fid);
 		p9_fid_destroy(fid);
 	}
 
@@ -1064,14 +1065,14 @@ EXPORT_SYMBOL(p9_client_destroy);
 
 void p9_client_disconnect(struct p9_client *clnt)
 {
-	P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt);
+	p9_debug(P9_DEBUG_9P, "clnt %p\n", clnt);
 	clnt->status = Disconnected;
 }
 EXPORT_SYMBOL(p9_client_disconnect);
 
 void p9_client_begin_disconnect(struct p9_client *clnt)
 {
-	P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt);
+	p9_debug(P9_DEBUG_9P, "clnt %p\n", clnt);
 	clnt->status = BeginDisconnect;
 }
 EXPORT_SYMBOL(p9_client_begin_disconnect);
@@ -1085,8 +1086,8 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
 	struct p9_qid qid;
 
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TATTACH afid %d uname %s aname %s\n",
-		   afid ? afid->fid : -1, uname, aname);
+	p9_debug(P9_DEBUG_9P, ">>> TATTACH afid %d uname %s aname %s\n",
+		 afid ? afid->fid : -1, uname, aname);
 	fid = p9_fid_create(clnt);
 	if (IS_ERR(fid)) {
 		err = PTR_ERR(fid);
@@ -1108,10 +1109,8 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RATTACH qid %x.%llx.%x\n",
-					qid.type,
-					(unsigned long long)qid.path,
-					qid.version);
+	p9_debug(P9_DEBUG_9P, "<<< RATTACH qid %x.%llx.%x\n",
+		 qid.type, (unsigned long long)qid.path, qid.version);
 
 	memmove(&fid->qid, &qid, sizeof(struct p9_qid));
 
@@ -1151,8 +1150,8 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
 		fid = oldfid;
 
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TWALK fids %d,%d nwname %ud wname[0] %s\n",
-		oldfid->fid, fid->fid, nwname, wnames ? wnames[0] : NULL);
+	p9_debug(P9_DEBUG_9P, ">>> TWALK fids %d,%d nwname %ud wname[0] %s\n",
+		 oldfid->fid, fid->fid, nwname, wnames ? wnames[0] : NULL);
 
 	req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid,
 								nwname, wnames);
@@ -1169,7 +1168,7 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
 	}
 	p9_free_req(clnt, req);
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RWALK nwqid %d:\n", nwqids);
+	p9_debug(P9_DEBUG_9P, "<<< RWALK nwqid %d:\n", nwqids);
 
 	if (nwqids != nwname) {
 		err = -ENOENT;
@@ -1177,7 +1176,7 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
 	}
 
 	for (count = 0; count < nwqids; count++)
-		P9_DPRINTK(P9_DEBUG_9P, "<<<     [%d] %x.%llx.%x\n",
+		p9_debug(P9_DEBUG_9P, "<<<     [%d] %x.%llx.%x\n",
 			count, wqids[count].type,
 			(unsigned long long)wqids[count].path,
 			wqids[count].version);
@@ -1212,7 +1211,7 @@ int p9_client_open(struct p9_fid *fid, int mode)
 	int iounit;
 
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> %s fid %d mode %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> %s fid %d mode %d\n",
 		p9_is_proto_dotl(clnt) ? "TLOPEN" : "TOPEN", fid->fid, mode);
 	err = 0;
 
@@ -1234,7 +1233,7 @@ int p9_client_open(struct p9_fid *fid, int mode)
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< %s qid %x.%llx.%x iounit %x\n",
+	p9_debug(P9_DEBUG_9P, "<<< %s qid %x.%llx.%x iounit %x\n",
 		p9_is_proto_dotl(clnt) ? "RLOPEN" : "ROPEN",  qid.type,
 		(unsigned long long)qid.path, qid.version, iounit);
 
@@ -1256,7 +1255,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
 	struct p9_req_t *req;
 	int iounit;
 
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P,
 			">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n",
 			ofid->fid, name, flags, mode, gid);
 	clnt = ofid->clnt;
@@ -1277,7 +1276,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RLCREATE qid %x.%llx.%x iounit %x\n",
+	p9_debug(P9_DEBUG_9P, "<<< RLCREATE qid %x.%llx.%x iounit %x\n",
 			qid->type,
 			(unsigned long long)qid->path,
 			qid->version, iounit);
@@ -1301,7 +1300,7 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
 	struct p9_qid qid;
 	int iounit;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TCREATE fid %d name %s perm %d mode %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TCREATE fid %d name %s perm %d mode %d\n",
 						fid->fid, name, perm, mode);
 	err = 0;
 	clnt = fid->clnt;
@@ -1322,7 +1321,7 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n",
+	p9_debug(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n",
 				qid.type,
 				(unsigned long long)qid.path,
 				qid.version, iounit);
@@ -1344,7 +1343,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TSYMLINK dfid %d name %s  symtgt %s\n",
+	p9_debug(P9_DEBUG_9P, ">>> TSYMLINK dfid %d name %s  symtgt %s\n",
 			dfid->fid, name, symtgt);
 	clnt = dfid->clnt;
 
@@ -1361,7 +1360,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RSYMLINK qid %x.%llx.%x\n",
+	p9_debug(P9_DEBUG_9P, "<<< RSYMLINK qid %x.%llx.%x\n",
 			qid->type, (unsigned long long)qid->path, qid->version);
 
 free_and_error:
@@ -1376,7 +1375,7 @@ int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname)
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TLINK dfid %d oldfid %d newname %s\n",
+	p9_debug(P9_DEBUG_9P, ">>> TLINK dfid %d oldfid %d newname %s\n",
 			dfid->fid, oldfid->fid, newname);
 	clnt = dfid->clnt;
 	req = p9_client_rpc(clnt, P9_TLINK, "dds", dfid->fid, oldfid->fid,
@@ -1384,7 +1383,7 @@ int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname)
 	if (IS_ERR(req))
 		return PTR_ERR(req);
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RLINK\n");
+	p9_debug(P9_DEBUG_9P, "<<< RLINK\n");
 	p9_free_req(clnt, req);
 	return 0;
 }
@@ -1396,7 +1395,7 @@ int p9_client_fsync(struct p9_fid *fid, int datasync)
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TFSYNC fid %d datasync:%d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TFSYNC fid %d datasync:%d\n",
 			fid->fid, datasync);
 	err = 0;
 	clnt = fid->clnt;
@@ -1407,7 +1406,7 @@ int p9_client_fsync(struct p9_fid *fid, int datasync)
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RFSYNC fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RFSYNC fid %d\n", fid->fid);
 
 	p9_free_req(clnt, req);
 
@@ -1423,12 +1422,13 @@ int p9_client_clunk(struct p9_fid *fid)
 	struct p9_req_t *req;
 
 	if (!fid) {
-		P9_EPRINTK(KERN_WARNING, "Trying to clunk with NULL fid\n");
+		pr_warn("%s (%d): Trying to clunk with NULL fid\n",
+			__func__, task_pid_nr(current));
 		dump_stack();
 		return 0;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid);
 	err = 0;
 	clnt = fid->clnt;
 
@@ -1438,7 +1438,7 @@ int p9_client_clunk(struct p9_fid *fid)
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RCLUNK fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RCLUNK fid %d\n", fid->fid);
 
 	p9_free_req(clnt, req);
 error:
@@ -1456,7 +1456,7 @@ int p9_client_remove(struct p9_fid *fid)
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TREMOVE fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, ">>> TREMOVE fid %d\n", fid->fid);
 	err = 0;
 	clnt = fid->clnt;
 
@@ -1466,7 +1466,7 @@ int p9_client_remove(struct p9_fid *fid)
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RREMOVE fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RREMOVE fid %d\n", fid->fid);
 
 	p9_free_req(clnt, req);
 error:
@@ -1481,7 +1481,7 @@ int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags)
 	struct p9_req_t *req;
 	struct p9_client *clnt;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TUNLINKAT fid %d %s %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TUNLINKAT fid %d %s %d\n",
 		   dfid->fid, name, flags);
 
 	clnt = dfid->clnt;
@@ -1490,7 +1490,7 @@ int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags)
 		err = PTR_ERR(req);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RUNLINKAT fid %d %s\n", dfid->fid, name);
+	p9_debug(P9_DEBUG_9P, "<<< RUNLINKAT fid %d %s\n", dfid->fid, name);
 
 	p9_free_req(clnt, req);
 error:
@@ -1509,7 +1509,7 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
 	int err, rsize, non_zc = 0;
 
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TREAD fid %d offset %llu %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TREAD fid %d offset %llu %d\n",
 		   fid->fid, (long long unsigned) offset, count);
 	err = 0;
 	clnt = fid->clnt;
@@ -1552,7 +1552,7 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RREAD count %d\n", count);
+	p9_debug(P9_DEBUG_9P, "<<< RREAD count %d\n", count);
 
 	if (non_zc) {
 		if (data) {
@@ -1584,7 +1584,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %d\n",
 				fid->fid, (long long unsigned) offset, count);
 	err = 0;
 	clnt = fid->clnt;
@@ -1626,7 +1626,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RWRITE count %d\n", count);
+	p9_debug(P9_DEBUG_9P, "<<< RWRITE count %d\n", count);
 
 	p9_free_req(clnt, req);
 	return count;
@@ -1646,7 +1646,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
 	struct p9_req_t *req;
 	u16 ignored;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TSTAT fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, ">>> TSTAT fid %d\n", fid->fid);
 
 	if (!ret)
 		return ERR_PTR(-ENOMEM);
@@ -1667,7 +1667,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P,
 		"<<< RSTAT sz=%x type=%x dev=%x qid=%x.%llx.%x\n"
 		"<<<    mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n"
 		"<<<    name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
@@ -1696,7 +1696,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid,
 								GFP_KERNEL);
 	struct p9_req_t *req;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TGETATTR fid %d, request_mask %lld\n",
+	p9_debug(P9_DEBUG_9P, ">>> TGETATTR fid %d, request_mask %lld\n",
 							fid->fid, request_mask);
 
 	if (!ret)
@@ -1718,7 +1718,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid,
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P,
 		"<<< RGETATTR st_result_mask=%lld\n"
 		"<<< qid=%x.%llx.%x\n"
 		"<<< st_mode=%8.8x st_nlink=%llu\n"
@@ -1784,8 +1784,8 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst)
 	err = 0;
 	clnt = fid->clnt;
 	wst->size = p9_client_statsize(wst, clnt->proto_version);
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid);
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P,
 		"     sz=%x type=%x dev=%x qid=%x.%llx.%x\n"
 		"     mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n"
 		"     name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
@@ -1802,7 +1802,7 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst)
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RWSTAT fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RWSTAT fid %d\n", fid->fid);
 
 	p9_free_req(clnt, req);
 error:
@@ -1818,8 +1818,8 @@ int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *p9attr)
 
 	err = 0;
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TSETATTR fid %d\n", fid->fid);
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P, ">>> TSETATTR fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P,
 		"    valid=%x mode=%x uid=%d gid=%d size=%lld\n"
 		"    atime_sec=%lld atime_nsec=%lld\n"
 		"    mtime_sec=%lld mtime_nsec=%lld\n",
@@ -1833,7 +1833,7 @@ int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *p9attr)
 		err = PTR_ERR(req);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RSETATTR fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RSETATTR fid %d\n", fid->fid);
 	p9_free_req(clnt, req);
 error:
 	return err;
@@ -1849,7 +1849,7 @@ int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb)
 	err = 0;
 	clnt = fid->clnt;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TSTATFS fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, ">>> TSTATFS fid %d\n", fid->fid);
 
 	req = p9_client_rpc(clnt, P9_TSTATFS, "d", fid->fid);
 	if (IS_ERR(req)) {
@@ -1866,7 +1866,7 @@ int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb)
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RSTATFS fid %d type 0x%lx bsize %ld "
+	p9_debug(P9_DEBUG_9P, "<<< RSTATFS fid %d type 0x%lx bsize %ld "
 		"blocks %llu bfree %llu bavail %llu files %llu ffree %llu "
 		"fsid %llu namelen %ld\n",
 		fid->fid, (long unsigned int)sb->type, (long int)sb->bsize,
@@ -1889,7 +1889,7 @@ int p9_client_rename(struct p9_fid *fid,
 	err = 0;
 	clnt = fid->clnt;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAME fid %d newdirfid %d name %s\n",
+	p9_debug(P9_DEBUG_9P, ">>> TRENAME fid %d newdirfid %d name %s\n",
 			fid->fid, newdirfid->fid, name);
 
 	req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid,
@@ -1899,7 +1899,7 @@ int p9_client_rename(struct p9_fid *fid,
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAME fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RRENAME fid %d\n", fid->fid);
 
 	p9_free_req(clnt, req);
 error:
@@ -1917,7 +1917,7 @@ int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
 	err = 0;
 	clnt = olddirfid->clnt;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAMEAT olddirfid %d old name %s"
+	p9_debug(P9_DEBUG_9P, ">>> TRENAMEAT olddirfid %d old name %s"
 		   " newdirfid %d new name %s\n", olddirfid->fid, old_name,
 		   newdirfid->fid, new_name);
 
@@ -1928,7 +1928,7 @@ int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
 		goto error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAMEAT newdirfid %d new name %s\n",
+	p9_debug(P9_DEBUG_9P, "<<< RRENAMEAT newdirfid %d new name %s\n",
 		   newdirfid->fid, new_name);
 
 	p9_free_req(clnt, req);
@@ -1956,7 +1956,7 @@ struct p9_fid *p9_client_xattrwalk(struct p9_fid *file_fid,
 		attr_fid = NULL;
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P,
 		">>> TXATTRWALK file_fid %d, attr_fid %d name %s\n",
 		file_fid->fid, attr_fid->fid, attr_name);
 
@@ -1973,7 +1973,7 @@ struct p9_fid *p9_client_xattrwalk(struct p9_fid *file_fid,
 		goto clunk_fid;
 	}
 	p9_free_req(clnt, req);
-	P9_DPRINTK(P9_DEBUG_9P, "<<<  RXATTRWALK fid %d size %llu\n",
+	p9_debug(P9_DEBUG_9P, "<<<  RXATTRWALK fid %d size %llu\n",
 		attr_fid->fid, *attr_size);
 	return attr_fid;
 clunk_fid:
@@ -1994,7 +1994,7 @@ int p9_client_xattrcreate(struct p9_fid *fid, const char *name,
 	struct p9_req_t *req;
 	struct p9_client *clnt;
 
-	P9_DPRINTK(P9_DEBUG_9P,
+	p9_debug(P9_DEBUG_9P,
 		">>> TXATTRCREATE fid %d name  %s size %lld flag %d\n",
 		fid->fid, name, (long long)attr_size, flags);
 	err = 0;
@@ -2005,7 +2005,7 @@ int p9_client_xattrcreate(struct p9_fid *fid, const char *name,
 		err = PTR_ERR(req);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RXATTRCREATE fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, "<<< RXATTRCREATE fid %d\n", fid->fid);
 	p9_free_req(clnt, req);
 error:
 	return err;
@@ -2019,7 +2019,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
 	struct p9_req_t *req;
 	char *dataptr;
 
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TREADDIR fid %d offset %llu count %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TREADDIR fid %d offset %llu count %d\n",
 				fid->fid, (long long unsigned) offset, count);
 
 	err = 0;
@@ -2056,7 +2056,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
 		goto free_and_error;
 	}
 
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RREADDIR count %d\n", count);
+	p9_debug(P9_DEBUG_9P, "<<< RREADDIR count %d\n", count);
 
 	if (non_zc)
 		memmove(data, dataptr, count);
@@ -2080,7 +2080,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
 
 	err = 0;
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d "
+	p9_debug(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d "
 		"minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev));
 	req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddd", fid->fid, name, mode,
 		MAJOR(rdev), MINOR(rdev), gid);
@@ -2092,7 +2092,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
 		trace_9p_protocol_dump(clnt, req->rc);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type,
+	p9_debug(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type,
 				(unsigned long long)qid->path, qid->version);
 
 error:
@@ -2111,7 +2111,7 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
 
 	err = 0;
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n",
+	p9_debug(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n",
 		 fid->fid, name, mode, gid);
 	req = p9_client_rpc(clnt, P9_TMKDIR, "dsdd", fid->fid, name, mode,
 		gid);
@@ -2123,7 +2123,7 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
 		trace_9p_protocol_dump(clnt, req->rc);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RMKDIR qid %x.%llx.%x\n", qid->type,
+	p9_debug(P9_DEBUG_9P, "<<< RMKDIR qid %x.%llx.%x\n", qid->type,
 				(unsigned long long)qid->path, qid->version);
 
 error:
@@ -2141,7 +2141,7 @@ int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status)
 
 	err = 0;
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TLOCK fid %d type %i flags %d "
+	p9_debug(P9_DEBUG_9P, ">>> TLOCK fid %d type %i flags %d "
 			"start %lld length %lld proc_id %d client_id %s\n",
 			fid->fid, flock->type, flock->flags, flock->start,
 			flock->length, flock->proc_id, flock->client_id);
@@ -2158,7 +2158,7 @@ int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status)
 		trace_9p_protocol_dump(clnt, req->rc);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RLOCK status %i\n", *status);
+	p9_debug(P9_DEBUG_9P, "<<< RLOCK status %i\n", *status);
 error:
 	p9_free_req(clnt, req);
 	return err;
@@ -2174,7 +2174,7 @@ int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *glock)
 
 	err = 0;
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TGETLOCK fid %d, type %i start %lld "
+	p9_debug(P9_DEBUG_9P, ">>> TGETLOCK fid %d, type %i start %lld "
 		"length %lld proc_id %d client_id %s\n", fid->fid, glock->type,
 		glock->start, glock->length, glock->proc_id, glock->client_id);
 
@@ -2191,7 +2191,7 @@ int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *glock)
 		trace_9p_protocol_dump(clnt, req->rc);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RGETLOCK type %i start %lld length %lld "
+	p9_debug(P9_DEBUG_9P, "<<< RGETLOCK type %i start %lld length %lld "
 		"proc_id %d client_id %s\n", glock->type, glock->start,
 		glock->length, glock->proc_id, glock->client_id);
 error:
@@ -2208,7 +2208,7 @@ int p9_client_readlink(struct p9_fid *fid, char **target)
 
 	err = 0;
 	clnt = fid->clnt;
-	P9_DPRINTK(P9_DEBUG_9P, ">>> TREADLINK fid %d\n", fid->fid);
+	p9_debug(P9_DEBUG_9P, ">>> TREADLINK fid %d\n", fid->fid);
 
 	req = p9_client_rpc(clnt, P9_TREADLINK, "d", fid->fid);
 	if (IS_ERR(req))
@@ -2219,7 +2219,7 @@ int p9_client_readlink(struct p9_fid *fid, char **target)
 		trace_9p_protocol_dump(clnt, req->rc);
 		goto error;
 	}
-	P9_DPRINTK(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target);
+	p9_debug(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target);
 error:
 	p9_free_req(clnt, req);
 	return err;
diff --git a/net/9p/error.c b/net/9p/error.c
index 5251851..2ab2de7 100644
--- a/net/9p/error.c
+++ b/net/9p/error.c
@@ -27,6 +27,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/list.h>
 #include <linux/jhash.h>
@@ -237,8 +239,8 @@ int p9_errstr2errno(char *errstr, int len)
 	if (errno == 0) {
 		/* TODO: if error isn't found, add it dynamically */
 		errstr[len] = 0;
-		printk(KERN_ERR "%s: server reported unknown error %s\n",
-			__func__, errstr);
+		pr_err("%s: server reported unknown error %s\n",
+		       __func__, errstr);
 		errno = ESERVERFAULT;
 	}
 
diff --git a/net/9p/mod.c b/net/9p/mod.c
index 2664d12..47df3bd 100644
--- a/net/9p/mod.c
+++ b/net/9p/mod.c
@@ -24,6 +24,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <net/9p/9p.h>
@@ -147,7 +149,7 @@ static int __init init_p9(void)
 	int ret = 0;
 
 	p9_error_init();
-	printk(KERN_INFO "Installing 9P2000 support\n");
+	pr_info("Installing 9P2000 support\n");
 	p9_trans_fd_init();
 
 	return ret;
@@ -160,7 +162,7 @@ static int __init init_p9(void)
 
 static void __exit exit_p9(void)
 {
-	printk(KERN_INFO "Unloading 9P2000 support\n");
+	pr_info("Unloading 9P2000 support\n");
 
 	p9_trans_fd_exit();
 }
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 55e10a9..9ee48cb 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -534,7 +534,7 @@ int p9stat_read(struct p9_client *clnt, char *buf, int len, struct p9_wstat *st)
 
 	ret = p9pdu_readf(&fake_pdu, clnt->proto_version, "S", st);
 	if (ret) {
-		P9_DPRINTK(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
+		p9_debug(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
 		trace_9p_protocol_dump(clnt, &fake_pdu);
 	}
 
@@ -558,8 +558,8 @@ int p9pdu_finalize(struct p9_client *clnt, struct p9_fcall *pdu)
 	pdu->size = size;
 
 	trace_9p_protocol_dump(clnt, pdu);
-	P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size,
-							pdu->id, pdu->tag);
+	p9_debug(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n",
+		 pdu->size, pdu->id, pdu->tag);
 
 	return err;
 }
@@ -585,7 +585,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len,
 	ret = p9pdu_readf(&fake_pdu, clnt->proto_version, "Qqbs", &dirent->qid,
 			  &dirent->d_off, &dirent->d_type, &nameptr);
 	if (ret) {
-		P9_DPRINTK(P9_DEBUG_9P, "<<< p9dirent_read failed: %d\n", ret);
+		p9_debug(P9_DEBUG_9P, "<<< p9dirent_read failed: %d\n", ret);
 		trace_9p_protocol_dump(clnt, &fake_pdu);
 		goto out;
 	}
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index fdfdb57..fccae26 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -25,6 +25,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/in.h>
 #include <linux/module.h>
 #include <linux/net.h>
@@ -191,7 +193,7 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
 	unsigned long flags;
 	LIST_HEAD(cancel_list);
 
-	P9_DPRINTK(P9_DEBUG_ERROR, "mux %p err %d\n", m, err);
+	p9_debug(P9_DEBUG_ERROR, "mux %p err %d\n", m, err);
 
 	spin_lock_irqsave(&m->client->lock, flags);
 
@@ -217,7 +219,7 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
 	spin_unlock_irqrestore(&m->client->lock, flags);
 
 	list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "call back req %p\n", req);
+		p9_debug(P9_DEBUG_ERROR, "call back req %p\n", req);
 		list_del(&req->req_list);
 		p9_client_cb(m->client, req);
 	}
@@ -275,7 +277,7 @@ static int p9_fd_read(struct p9_client *client, void *v, int len)
 		return -EREMOTEIO;
 
 	if (!(ts->rd->f_flags & O_NONBLOCK))
-		P9_DPRINTK(P9_DEBUG_ERROR, "blocking read ...\n");
+		p9_debug(P9_DEBUG_ERROR, "blocking read ...\n");
 
 	ret = kernel_read(ts->rd, ts->rd->f_pos, v, len);
 	if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN)
@@ -299,7 +301,7 @@ static void p9_read_work(struct work_struct *work)
 	if (m->err < 0)
 		return;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "start mux %p pos %d\n", m, m->rpos);
+	p9_debug(P9_DEBUG_TRANS, "start mux %p pos %d\n", m, m->rpos);
 
 	if (!m->rbuf) {
 		m->rbuf = m->tmp_buf;
@@ -308,11 +310,11 @@ static void p9_read_work(struct work_struct *work)
 	}
 
 	clear_bit(Rpending, &m->wsched);
-	P9_DPRINTK(P9_DEBUG_TRANS, "read mux %p pos %d size: %d = %d\n", m,
-					m->rpos, m->rsize, m->rsize-m->rpos);
+	p9_debug(P9_DEBUG_TRANS, "read mux %p pos %d size: %d = %d\n",
+		 m, m->rpos, m->rsize, m->rsize-m->rpos);
 	err = p9_fd_read(m->client, m->rbuf + m->rpos,
 						m->rsize - m->rpos);
-	P9_DPRINTK(P9_DEBUG_TRANS, "mux %p got %d bytes\n", m, err);
+	p9_debug(P9_DEBUG_TRANS, "mux %p got %d bytes\n", m, err);
 	if (err == -EAGAIN) {
 		clear_bit(Rworksched, &m->wsched);
 		return;
@@ -325,25 +327,25 @@ static void p9_read_work(struct work_struct *work)
 
 	if ((!m->req) && (m->rpos == m->rsize)) { /* header read in */
 		u16 tag;
-		P9_DPRINTK(P9_DEBUG_TRANS, "got new header\n");
+		p9_debug(P9_DEBUG_TRANS, "got new header\n");
 
 		n = le32_to_cpu(*(__le32 *) m->rbuf); /* read packet size */
 		if (n >= m->client->msize) {
-			P9_DPRINTK(P9_DEBUG_ERROR,
-				"requested packet size too big: %d\n", n);
+			p9_debug(P9_DEBUG_ERROR,
+				 "requested packet size too big: %d\n", n);
 			err = -EIO;
 			goto error;
 		}
 
 		tag = le16_to_cpu(*(__le16 *) (m->rbuf+5)); /* read tag */
-		P9_DPRINTK(P9_DEBUG_TRANS,
-			"mux %p pkt: size: %d bytes tag: %d\n", m, n, tag);
+		p9_debug(P9_DEBUG_TRANS,
+			 "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag);
 
 		m->req = p9_tag_lookup(m->client, tag);
 		if (!m->req || (m->req->status != REQ_STATUS_SENT &&
 					m->req->status != REQ_STATUS_FLSH)) {
-			P9_DPRINTK(P9_DEBUG_ERROR, "Unexpected packet tag %d\n",
-								 tag);
+			p9_debug(P9_DEBUG_ERROR, "Unexpected packet tag %d\n",
+				 tag);
 			err = -EIO;
 			goto error;
 		}
@@ -364,7 +366,7 @@ static void p9_read_work(struct work_struct *work)
 
 	/* not an else because some packets (like clunk) have no payload */
 	if ((m->req) && (m->rpos == m->rsize)) { /* packet is read in */
-		P9_DPRINTK(P9_DEBUG_TRANS, "got new packet\n");
+		p9_debug(P9_DEBUG_TRANS, "got new packet\n");
 		spin_lock(&m->client->lock);
 		if (m->req->status != REQ_STATUS_ERROR)
 			m->req->status = REQ_STATUS_RCVD;
@@ -384,7 +386,7 @@ static void p9_read_work(struct work_struct *work)
 			n = p9_fd_poll(m->client, NULL);
 
 		if (n & POLLIN) {
-			P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m);
+			p9_debug(P9_DEBUG_TRANS, "sched read work %p\n", m);
 			schedule_work(&m->rq);
 		} else
 			clear_bit(Rworksched, &m->wsched);
@@ -418,7 +420,7 @@ static int p9_fd_write(struct p9_client *client, void *v, int len)
 		return -EREMOTEIO;
 
 	if (!(ts->wr->f_flags & O_NONBLOCK))
-		P9_DPRINTK(P9_DEBUG_ERROR, "blocking write ...\n");
+		p9_debug(P9_DEBUG_ERROR, "blocking write ...\n");
 
 	oldfs = get_fs();
 	set_fs(get_ds());
@@ -460,7 +462,7 @@ static void p9_write_work(struct work_struct *work)
 		req = list_entry(m->unsent_req_list.next, struct p9_req_t,
 			       req_list);
 		req->status = REQ_STATUS_SENT;
-		P9_DPRINTK(P9_DEBUG_TRANS, "move req %p\n", req);
+		p9_debug(P9_DEBUG_TRANS, "move req %p\n", req);
 		list_move_tail(&req->req_list, &m->req_list);
 
 		m->wbuf = req->tc->sdata;
@@ -469,11 +471,11 @@ static void p9_write_work(struct work_struct *work)
 		spin_unlock(&m->client->lock);
 	}
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "mux %p pos %d size %d\n", m, m->wpos,
-								m->wsize);
+	p9_debug(P9_DEBUG_TRANS, "mux %p pos %d size %d\n",
+		 m, m->wpos, m->wsize);
 	clear_bit(Wpending, &m->wsched);
 	err = p9_fd_write(m->client, m->wbuf + m->wpos, m->wsize - m->wpos);
-	P9_DPRINTK(P9_DEBUG_TRANS, "mux %p sent %d bytes\n", m, err);
+	p9_debug(P9_DEBUG_TRANS, "mux %p sent %d bytes\n", m, err);
 	if (err == -EAGAIN) {
 		clear_bit(Wworksched, &m->wsched);
 		return;
@@ -497,7 +499,7 @@ static void p9_write_work(struct work_struct *work)
 			n = p9_fd_poll(m->client, NULL);
 
 		if (n & POLLOUT) {
-			P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m);
+			p9_debug(P9_DEBUG_TRANS, "sched write work %p\n", m);
 			schedule_work(&m->wq);
 		} else
 			clear_bit(Wworksched, &m->wsched);
@@ -551,7 +553,7 @@ p9_pollwait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p)
 	}
 
 	if (!pwait) {
-		P9_DPRINTK(P9_DEBUG_ERROR, "not enough wait_address slots\n");
+		p9_debug(P9_DEBUG_ERROR, "not enough wait_address slots\n");
 		return;
 	}
 
@@ -573,8 +575,7 @@ static struct p9_conn *p9_conn_create(struct p9_client *client)
 	int n;
 	struct p9_conn *m;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "client %p msize %d\n", client,
-								client->msize);
+	p9_debug(P9_DEBUG_TRANS, "client %p msize %d\n", client, client->msize);
 	m = kzalloc(sizeof(struct p9_conn), GFP_KERNEL);
 	if (!m)
 		return ERR_PTR(-ENOMEM);
@@ -591,12 +592,12 @@ static struct p9_conn *p9_conn_create(struct p9_client *client)
 
 	n = p9_fd_poll(client, &m->pt);
 	if (n & POLLIN) {
-		P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can read\n", m);
+		p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m);
 		set_bit(Rpending, &m->wsched);
 	}
 
 	if (n & POLLOUT) {
-		P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can write\n", m);
+		p9_debug(P9_DEBUG_TRANS, "mux %p can write\n", m);
 		set_bit(Wpending, &m->wsched);
 	}
 
@@ -618,7 +619,7 @@ static void p9_poll_mux(struct p9_conn *m)
 
 	n = p9_fd_poll(m->client, NULL);
 	if (n < 0 || n & (POLLERR | POLLHUP | POLLNVAL)) {
-		P9_DPRINTK(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n);
+		p9_debug(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n);
 		if (n >= 0)
 			n = -ECONNRESET;
 		p9_conn_cancel(m, n);
@@ -626,19 +627,19 @@ static void p9_poll_mux(struct p9_conn *m)
 
 	if (n & POLLIN) {
 		set_bit(Rpending, &m->wsched);
-		P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can read\n", m);
+		p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m);
 		if (!test_and_set_bit(Rworksched, &m->wsched)) {
-			P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m);
+			p9_debug(P9_DEBUG_TRANS, "sched read work %p\n", m);
 			schedule_work(&m->rq);
 		}
 	}
 
 	if (n & POLLOUT) {
 		set_bit(Wpending, &m->wsched);
-		P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can write\n", m);
+		p9_debug(P9_DEBUG_TRANS, "mux %p can write\n", m);
 		if ((m->wsize || !list_empty(&m->unsent_req_list)) &&
 		    !test_and_set_bit(Wworksched, &m->wsched)) {
-			P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m);
+			p9_debug(P9_DEBUG_TRANS, "sched write work %p\n", m);
 			schedule_work(&m->wq);
 		}
 	}
@@ -661,8 +662,8 @@ static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
 	struct p9_trans_fd *ts = client->trans;
 	struct p9_conn *m = ts->conn;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "mux %p task %p tcall %p id %d\n", m,
-						current, req->tc, req->tc->id);
+	p9_debug(P9_DEBUG_TRANS, "mux %p task %p tcall %p id %d\n",
+		 m, current, req->tc, req->tc->id);
 	if (m->err < 0)
 		return m->err;
 
@@ -686,7 +687,7 @@ static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
 {
 	int ret = 1;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
+	p9_debug(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
 
 	spin_lock(&client->lock);
 
@@ -726,8 +727,8 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
 
 	tmp_options = kstrdup(params, GFP_KERNEL);
 	if (!tmp_options) {
-		P9_DPRINTK(P9_DEBUG_ERROR,
-				"failed to allocate copy of option string\n");
+		p9_debug(P9_DEBUG_ERROR,
+			 "failed to allocate copy of option string\n");
 		return -ENOMEM;
 	}
 	options = tmp_options;
@@ -741,8 +742,8 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
 		if (token != Opt_err) {
 			r = match_int(&args[0], &option);
 			if (r < 0) {
-				P9_DPRINTK(P9_DEBUG_ERROR,
-				"integer field, but no integer?\n");
+				p9_debug(P9_DEBUG_ERROR,
+					 "integer field, but no integer?\n");
 				continue;
 			}
 		}
@@ -801,7 +802,8 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket)
 	csocket->sk->sk_allocation = GFP_NOIO;
 	fd = sock_map_fd(csocket, 0);
 	if (fd < 0) {
-		P9_EPRINTK(KERN_ERR, "p9_socket_open: failed to map fd\n");
+		pr_err("%s (%d): failed to map fd\n",
+		       __func__, task_pid_nr(current));
 		sock_release(csocket);
 		kfree(p);
 		return fd;
@@ -837,8 +839,8 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket)
 
 static void p9_conn_destroy(struct p9_conn *m)
 {
-	P9_DPRINTK(P9_DEBUG_TRANS, "mux %p prev %p next %p\n", m,
-		m->mux_list.prev, m->mux_list.next);
+	p9_debug(P9_DEBUG_TRANS, "mux %p prev %p next %p\n",
+		 m, m->mux_list.prev, m->mux_list.next);
 
 	p9_mux_poll_stop(m);
 	cancel_work_sync(&m->rq);
@@ -919,7 +921,8 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
 	err = __sock_create(read_pnet(&current->nsproxy->net_ns), PF_INET,
 			    SOCK_STREAM, IPPROTO_TCP, &csocket, 1);
 	if (err) {
-		P9_EPRINTK(KERN_ERR, "p9_trans_tcp: problem creating socket\n");
+		pr_err("%s (%d): problem creating socket\n",
+		       __func__, task_pid_nr(current));
 		return err;
 	}
 
@@ -927,9 +930,8 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
 				    (struct sockaddr *)&sin_server,
 				    sizeof(struct sockaddr_in), 0);
 	if (err < 0) {
-		P9_EPRINTK(KERN_ERR,
-			"p9_trans_tcp: problem connecting socket to %s\n",
-			addr);
+		pr_err("%s (%d): problem connecting socket to %s\n",
+		       __func__, task_pid_nr(current), addr);
 		sock_release(csocket);
 		return err;
 	}
@@ -947,8 +949,8 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
 	csocket = NULL;
 
 	if (strlen(addr) >= UNIX_PATH_MAX) {
-		P9_EPRINTK(KERN_ERR, "p9_trans_unix: address too long: %s\n",
-			addr);
+		pr_err("%s (%d): address too long: %s\n",
+		       __func__, task_pid_nr(current), addr);
 		return -ENAMETOOLONG;
 	}
 
@@ -957,15 +959,16 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
 	err = __sock_create(read_pnet(&current->nsproxy->net_ns), PF_UNIX,
 			    SOCK_STREAM, 0, &csocket, 1);
 	if (err < 0) {
-		P9_EPRINTK(KERN_ERR, "p9_trans_unix: problem creating socket\n");
+		pr_err("%s (%d): problem creating socket\n",
+		       __func__, task_pid_nr(current));
+
 		return err;
 	}
 	err = csocket->ops->connect(csocket, (struct sockaddr *)&sun_server,
 			sizeof(struct sockaddr_un) - 1, 0);
 	if (err < 0) {
-		P9_EPRINTK(KERN_ERR,
-			"p9_trans_unix: problem connecting socket: %s: %d\n",
-			addr, err);
+		pr_err("%s (%d): problem connecting socket: %s: %d\n",
+		       __func__, task_pid_nr(current), addr, err);
 		sock_release(csocket);
 		return err;
 	}
@@ -983,7 +986,7 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args)
 	parse_opts(args, &opts);
 
 	if (opts.rfd == ~0 || opts.wfd == ~0) {
-		printk(KERN_ERR "v9fs: Insufficient options for proto=fd\n");
+		pr_err("Insufficient options for proto=fd\n");
 		return -ENOPROTOOPT;
 	}
 
@@ -1050,7 +1053,7 @@ static void p9_poll_workfn(struct work_struct *work)
 {
 	unsigned long flags;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "start %p\n", current);
+	p9_debug(P9_DEBUG_TRANS, "start %p\n", current);
 
 	spin_lock_irqsave(&p9_poll_lock, flags);
 	while (!list_empty(&p9_poll_pending_list)) {
@@ -1066,7 +1069,7 @@ static void p9_poll_workfn(struct work_struct *work)
 	}
 	spin_unlock_irqrestore(&p9_poll_lock, flags);
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "finish\n");
+	p9_debug(P9_DEBUG_TRANS, "finish\n");
 }
 
 int p9_trans_fd_init(void)
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 159c50f..2c69ddd 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -26,6 +26,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/in.h>
 #include <linux/module.h>
 #include <linux/net.h>
@@ -178,8 +180,8 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
 
 	tmp_options = kstrdup(params, GFP_KERNEL);
 	if (!tmp_options) {
-		P9_DPRINTK(P9_DEBUG_ERROR,
-			   "failed to allocate copy of option string\n");
+		p9_debug(P9_DEBUG_ERROR,
+			 "failed to allocate copy of option string\n");
 		return -ENOMEM;
 	}
 	options = tmp_options;
@@ -192,8 +194,8 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
 		token = match_token(p, tokens, args);
 		r = match_int(&args[0], &option);
 		if (r < 0) {
-			P9_DPRINTK(P9_DEBUG_ERROR,
-				   "integer field, but no integer?\n");
+			p9_debug(P9_DEBUG_ERROR,
+				 "integer field, but no integer?\n");
 			continue;
 		}
 		switch (token) {
@@ -301,8 +303,7 @@ handle_recv(struct p9_client *client, struct p9_trans_rdma *rdma,
 	return;
 
  err_out:
-	P9_DPRINTK(P9_DEBUG_ERROR, "req %p err %d status %d\n",
-		   req, err, status);
+	p9_debug(P9_DEBUG_ERROR, "req %p err %d status %d\n", req, err, status);
 	rdma->state = P9_RDMA_FLUSHING;
 	client->status = Disconnected;
 }
@@ -318,8 +319,8 @@ handle_send(struct p9_client *client, struct p9_trans_rdma *rdma,
 
 static void qp_event_handler(struct ib_event *event, void *context)
 {
-	P9_DPRINTK(P9_DEBUG_ERROR, "QP event %d context %p\n", event->event,
-								context);
+	p9_debug(P9_DEBUG_ERROR, "QP event %d context %p\n",
+		 event->event, context);
 }
 
 static void cq_comp_handler(struct ib_cq *cq, void *cq_context)
@@ -345,8 +346,7 @@ static void cq_comp_handler(struct ib_cq *cq, void *cq_context)
 			break;
 
 		default:
-			printk(KERN_ERR "9prdma: unexpected completion type, "
-			       "c->wc_op=%d, wc.opcode=%d, status=%d\n",
+			pr_err("unexpected completion type, c->wc_op=%d, wc.opcode=%d, status=%d\n",
 			       c->wc_op, wc.opcode, wc.status);
 			break;
 		}
@@ -356,7 +356,7 @@ static void cq_comp_handler(struct ib_cq *cq, void *cq_context)
 
 static void cq_event_handler(struct ib_event *e, void *v)
 {
-	P9_DPRINTK(P9_DEBUG_ERROR, "CQ event %d context %p\n", e->event, v);
+	p9_debug(P9_DEBUG_ERROR, "CQ event %d context %p\n", e->event, v);
 }
 
 static void rdma_destroy_trans(struct p9_trans_rdma *rdma)
@@ -407,7 +407,7 @@ post_recv(struct p9_client *client, struct p9_rdma_context *c)
 	return ib_post_recv(rdma->qp, &wr, &bad_wr);
 
  error:
-	P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n");
+	p9_debug(P9_DEBUG_ERROR, "EIO\n");
 	return -EIO;
 }
 
@@ -500,7 +500,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
 	kfree(c);
 	kfree(rpl_context->rc);
 	kfree(rpl_context);
-	P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n");
+	p9_debug(P9_DEBUG_ERROR, "EIO\n");
 	return -EIO;
  err_free1:
 	kfree(rpl_context->rc);
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 177a9ff..3d43206 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -26,6 +26,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/in.h>
 #include <linux/module.h>
 #include <linux/net.h>
@@ -145,7 +147,7 @@ static void req_done(struct virtqueue *vq)
 	struct p9_req_t *req;
 	unsigned long flags;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, ": request done\n");
+	p9_debug(P9_DEBUG_TRANS, ": request done\n");
 
 	while (1) {
 		spin_lock_irqsave(&chan->lock, flags);
@@ -158,8 +160,8 @@ static void req_done(struct virtqueue *vq)
 		spin_unlock_irqrestore(&chan->lock, flags);
 		/* Wakeup if anyone waiting for VirtIO ring space. */
 		wake_up(chan->vc_wq);
-		P9_DPRINTK(P9_DEBUG_TRANS, ": rc %p\n", rc);
-		P9_DPRINTK(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag);
+		p9_debug(P9_DEBUG_TRANS, ": rc %p\n", rc);
+		p9_debug(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag);
 		req = p9_tag_lookup(chan->client, rc->tag);
 		req->status = REQ_STATUS_RCVD;
 		p9_client_cb(chan->client, req);
@@ -257,7 +259,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
 	unsigned long flags;
 	struct virtio_chan *chan = client->trans;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "9p debug: virtio request\n");
+	p9_debug(P9_DEBUG_TRANS, "9p debug: virtio request\n");
 
 	req->status = REQ_STATUS_SENT;
 req_retry:
@@ -281,20 +283,19 @@ req_retry:
 			if (err  == -ERESTARTSYS)
 				return err;
 
-			P9_DPRINTK(P9_DEBUG_TRANS, "9p:Retry virtio request\n");
+			p9_debug(P9_DEBUG_TRANS, "Retry virtio request\n");
 			goto req_retry;
 		} else {
 			spin_unlock_irqrestore(&chan->lock, flags);
-			P9_DPRINTK(P9_DEBUG_TRANS,
-					"9p debug: "
-					"virtio rpc add_buf returned failure");
+			p9_debug(P9_DEBUG_TRANS,
+				 "virtio rpc add_buf returned failure\n");
 			return -EIO;
 		}
 	}
 	virtqueue_kick(chan->vq);
 	spin_unlock_irqrestore(&chan->lock, flags);
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "9p debug: virtio request kicked\n");
+	p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n");
 	return 0;
 }
 
@@ -355,7 +356,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
 	struct page **in_pages = NULL, **out_pages = NULL;
 	struct virtio_chan *chan = client->trans;
 
-	P9_DPRINTK(P9_DEBUG_TRANS, "9p debug: virtio request\n");
+	p9_debug(P9_DEBUG_TRANS, "virtio request\n");
 
 	if (uodata) {
 		out_nr_pages = p9_nr_pages(uodata, outlen);
@@ -425,20 +426,19 @@ req_retry_pinned:
 			if (err  == -ERESTARTSYS)
 				goto err_out;
 
-			P9_DPRINTK(P9_DEBUG_TRANS, "9p:Retry virtio request\n");
+			p9_debug(P9_DEBUG_TRANS, "Retry virtio request\n");
 			goto req_retry_pinned;
 		} else {
 			spin_unlock_irqrestore(&chan->lock, flags);
-			P9_DPRINTK(P9_DEBUG_TRANS,
-				   "9p debug: "
-				   "virtio rpc add_buf returned failure");
+			p9_debug(P9_DEBUG_TRANS,
+				 "virtio rpc add_buf returned failure\n");
 			err = -EIO;
 			goto err_out;
 		}
 	}
 	virtqueue_kick(chan->vq);
 	spin_unlock_irqrestore(&chan->lock, flags);
-	P9_DPRINTK(P9_DEBUG_TRANS, "9p debug: virtio request kicked\n");
+	p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n");
 	err = wait_event_interruptible(*req->wq,
 				       req->status >= REQ_STATUS_RCVD);
 	/*
@@ -493,7 +493,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
 
 	chan = kmalloc(sizeof(struct virtio_chan), GFP_KERNEL);
 	if (!chan) {
-		printk(KERN_ERR "9p: Failed to allocate virtio 9P channel\n");
+		pr_err("Failed to allocate virtio 9P channel\n");
 		err = -ENOMEM;
 		goto fail;
 	}
@@ -594,7 +594,7 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args)
 	mutex_unlock(&virtio_9p_lock);
 
 	if (!found) {
-		printk(KERN_ERR "9p: no channels available\n");
+		pr_err("no channels available\n");
 		return ret;
 	}
 
diff --git a/net/9p/util.c b/net/9p/util.c
index 9c1c934..6ceeeb3 100644
--- a/net/9p/util.c
+++ b/net/9p/util.c
@@ -106,7 +106,7 @@ retry:
 	else if (error)
 		return -1;
 
-	P9_DPRINTK(P9_DEBUG_MUX, " id %d pool %p\n", i, p);
+	p9_debug(P9_DEBUG_MUX, " id %d pool %p\n", i, p);
 	return i;
 }
 EXPORT_SYMBOL(p9_idpool_get);
@@ -124,7 +124,7 @@ void p9_idpool_put(int id, struct p9_idpool *p)
 {
 	unsigned long flags;
 
-	P9_DPRINTK(P9_DEBUG_MUX, " id %d pool %p\n", id, p);
+	p9_debug(P9_DEBUG_MUX, " id %d pool %p\n", id, p);
 
 	spin_lock_irqsave(&p->lock, flags);
 	idr_remove(&p->pool, id);
-- 
1.7.6.405.gc1be0

^ permalink raw reply related

* Subject: [PATCH 1/2] atm: br2684: Make headroom and hard_header_len depend on the payload type
From: chas williams - CONTRACTOR @ 2011-11-28 18:40 UTC (permalink / raw)
  To: netdev, linux-atm-general


From: Pascal Hambourg <pascal@plouf.fr.eu.org>
Date: Wed, 17 Aug 2011 08:37:18 +0200
Subject: [PATCH 1/2] atm: br2684: Make headroom and hard_header_len depend on the payload type

Routed payload requires less headroom than bridged payload.
So do not reallocate headroom if not needed.
Also, add worst case AAL5 overhead to netdev->hard_header_len.

Signed-off-by: Pascal Hambourg <pascal@plouf.fr.eu.org>
Signed-off-by: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
---
 net/atm/br2684.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 53b0aa1..ed72263 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -202,7 +202,10 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev,
 {
 	struct br2684_dev *brdev = BRPRIV(dev);
 	struct atm_vcc *atmvcc;
-	int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
+	int minheadroom = (brvcc->encaps == e_llc) ?
+		((brdev->payload == p_bridged) ?
+			sizeof(llc_oui_pid_pad) : sizeof(llc_oui_ipv4)) :
+		((brdev->payload == p_bridged) ? BR2684_PAD_LEN : 0);
 
 	if (skb_headroom(skb) < minheadroom) {
 		struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
@@ -583,6 +586,7 @@ static void br2684_setup(struct net_device *netdev)
 	struct br2684_dev *brdev = BRPRIV(netdev);
 
 	ether_setup(netdev);
+	netdev->hard_header_len += sizeof(llc_oui_pid_pad); /* worst case */
 	brdev->net_dev = netdev;
 
 	netdev->netdev_ops = &br2684_netdev_ops;
@@ -595,7 +599,7 @@ static void br2684_setup_routed(struct net_device *netdev)
 	struct br2684_dev *brdev = BRPRIV(netdev);
 
 	brdev->net_dev = netdev;
-	netdev->hard_header_len = 0;
+	netdev->hard_header_len = sizeof(llc_oui_ipv4); /* worst case */
 	netdev->netdev_ops = &br2684_netdev_ops_routed;
 	netdev->addr_len = 0;
 	netdev->mtu = 1500;
-- 
1.7.6

^ permalink raw reply related

* Subject: [PATCH 2/2] atm: br2684: Avoid alignment issues
From: chas williams - CONTRACTOR @ 2011-11-28 18:40 UTC (permalink / raw)
  To: netdev, linux-atm-general


From: Pascal Hambourg <pascal@plouf.fr.eu.org>
Date: Wed, 17 Aug 2011 08:37:52 +0200
Subject: [PATCH 2/2] atm: br2684: Avoid alignment issues

Use memcmp() instead of cast to u16 when checking the PAD field.

Signed-off-by: Pascal Hambourg <pascal@plouf.fr.eu.org>
Signed-off-by: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
---
 net/atm/br2684.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ed72263..353fccf 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -53,6 +53,7 @@ static const unsigned char ethertype_ipv4[] = { ETHERTYPE_IPV4 };
 static const unsigned char ethertype_ipv6[] = { ETHERTYPE_IPV6 };
 static const unsigned char llc_oui_pid_pad[] =
 			{ LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
+static const unsigned char pad[] = { PAD_BRIDGED };
 static const unsigned char llc_oui_ipv4[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
 static const unsigned char llc_oui_ipv6[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
 
@@ -453,7 +454,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 			skb->pkt_type = PACKET_HOST;
 		} else { /* p_bridged */
 			/* first 2 chars should be 0 */
-			if (*((u16 *) (skb->data)) != 0)
+			if (memcmp(skb->data, pad, BR2684_PAD_LEN) != 0)
 				goto error;
 			skb_pull(skb, BR2684_PAD_LEN);
 			skb->protocol = eth_type_trans(skb, net_dev);
-- 
1.7.6

^ permalink raw reply related

* Re: Issues with openflow protocol WAS(RE: [GIT PULL v2] Open vSwitch
From: Justin Pettit @ 2011-11-28 18:44 UTC (permalink / raw)
  To: Jamal Hadi Salim
  Cc: Fischer, Anna, dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	David Miller, Herbert Xu,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1322489230.7338.71.camel@mojatatu>

On Nov 28, 2011, at 6:07 AM, Jamal Hadi Salim wrote:

> On Mon, 2011-11-28 at 13:54 +0000, Fischer, Anna wrote:
> 
>> Yes, I mentioned this months ago, and I am surprised this critical 
>> issue has never been picked up on and addressed. With a flaw like 
>> this there is no chance this component can be used in any serious 
>> virtualization deployment where different customers share the same physical server.
>> 
>> The path up to user-space needs to be designed in a multi-queue fashion, so that 
>> each vPort has its own queue up to user-space. Ideally those queues also need to 
>> be rate controlled in some form, so that no DoS is possible.
> 
> Good - more folks scrutinizing openflow ;->

I realize you chair an IETF standard with overlapping goals with
OpenFlow (ForCES), so you may have strong opinions about its design.
However, that's not relevant to this discussion, since OpenFlow's design
has nothing to do with the discussion being held here in regards to Open
vSwitch.  OpenFlow is just a bullet point--although an important one--in
a large set of features that Open vSwitch provides.  Its design is such
that it should be fairly easy to include new control protocols; OpenFlow
is just a library in Open vSwitch.  If you have issues with OpenFlow,
those would be better directed to the ONF or one of the OpenFlow mailing
lists.

--Justin

> That would resolve the kernel->user if in addition you then add
> prioritization of those queues. 
> But even then also the same problem exists with open flow in the 
> northbound direction towards the external controller where
> there is a single (TCP) socket.
> 
> cheers,
> jamal
> 
> _______________________________________________
> dev mailing list
> dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org
> http://openvswitch.org/mailman/listinfo/dev

^ permalink raw reply

* Re: [GIT PULL v2] Open vSwitch
From: Fischer, Anna @ 2011-11-28 18:52 UTC (permalink / raw)
  To: Ben Pfaff
  Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Miller,
	Herbert Xu, jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org
In-Reply-To: <20111128160400.GB6349-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

> Subject: Re: [ovs-dev] [GIT PULL v2] Open vSwitch
> 
> On Mon, Nov 28, 2011 at 01:54:16PM +0000, Fischer, Anna wrote:
> > Yes, I mentioned this months ago, and I am surprised this critical
> > issue has never been picked up on and addressed. With a flaw like
> this
> > there is no chance this component can be used in any serious
> > virtualization deployment where different customers share the same
> > physical server.
> 
> It was addressed, by introducing additional queues and using them in
> userspace.
> 
> This is documented in NEWS:
> 
>     - Flow setups are now processed in a round-robin manner across
> ports
>       to prevent any single client from monopolizing the CPU and
> conducting
>       a denial of service attack.

OK, that addresses my point, thanks. Ideally there should be smarter or more flexible algorithms than just a round robin scheduler, but it is a start.

Anna

^ permalink raw reply

* Re: Issues with openflow protocol WAS(RE: [GIT PULL v2] Open vSwitch
From: Fischer, Anna @ 2011-11-28 18:54 UTC (permalink / raw)
  To: Justin Pettit, Jamal Hadi Salim
  Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Miller,
	Herbert Xu, David-/PVsmBQoxgPKo9QCiBeYKEEOCMrvLtNR
In-Reply-To: <20124540-D566-41B0-B86F-0BCA19B948AA-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

> Subject: Re: [ovs-dev] Issues with openflow protocol WAS(RE: [GIT PULL
> v2] Open vSwitch
> 
> On Nov 28, 2011, at 6:07 AM, Jamal Hadi Salim wrote:
> 
> > On Mon, 2011-11-28 at 13:54 +0000, Fischer, Anna wrote:
> >
> >> Yes, I mentioned this months ago, and I am surprised this critical
> >> issue has never been picked up on and addressed. With a flaw like
> >> this there is no chance this component can be used in any serious
> >> virtualization deployment where different customers share the same
> physical server.
> >>
> >> The path up to user-space needs to be designed in a multi-queue
> fashion, so that
> >> each vPort has its own queue up to user-space. Ideally those queues
> also need to
> >> be rate controlled in some form, so that no DoS is possible.
> >
> > Good - more folks scrutinizing openflow ;->
> 
> I realize you chair an IETF standard with overlapping goals with
> OpenFlow (ForCES), so you may have strong opinions about its design.
> However, that's not relevant to this discussion, since OpenFlow's
> design
> has nothing to do with the discussion being held here in regards to
> Open
> vSwitch.  OpenFlow is just a bullet point--although an important one--
> in
> a large set of features that Open vSwitch provides.  Its design is such
> that it should be fairly easy to include new control protocols;
> OpenFlow
> is just a library in Open vSwitch.  If you have issues with OpenFlow,
> those would be better directed to the ONF or one of the OpenFlow
> mailing
> lists.

True, and I was not interested in OpenFlow rate controlling but purely in rate controlling within the kernel for what goes up to user-space. And you addressed that with individual queues per vPort, so that solves my issues.

^ permalink raw reply

* Re: [NET][TG3] Fwd: page allocation failure with linux 3.1.1
From: Rick Jones @ 2011-11-28 19:05 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Пламен Петров,
	David Miller, netdev
In-Reply-To: <1322468762.2826.17.camel@edumazet-laptop>

On 11/28/2011 12:26 AM, Eric Dumazet wrote:
> Le lundi 28 novembre 2011 à 09:16 +0200, Пламен Петров a écrit :
>
>> Well, Eric, thanks for the explanation! I will disable TSO and will
>> see how is that working out for me - if I recall correctly, I had no
>> problems when TSO was off.
>>
>> Sorry to bother you, if the above explanation was somewhere readily
>> available, but I didn't manage to find it.
>
> You dont bother me at all :)
>
> As a matter of fact, your mail reminded me something I wanted to do in
> the past and forgot about.
>
> Since some devices might copy skb to a linear one in their
> ndo_start_xmit(), we could set a netdev limit so that TSO can still be
> used on these devices, but limiting number of frags to
> 2^PAGE_ALLOC_COSTLY_ORDER

How much "TSO value" remains after such a copy?

rick jones

>
> (Since PAGE_ALLOC_COSTLY_ORDER == 3, thats 8 frags, instead of 16 right
> now on x86)
>
> Of course, if memory is really tight, even an ATOMIC order-3 allocation
> might fail. If this happens, device limit could be dynamically
> decreased. In the end, only linear skb could be built by TCP.
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] net: rfkill: convert net/rfkill/* to use module_platform_driver()
From: Rhyland Klein @ 2011-11-28 19:09 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	John W. Linville, Johannes Berg, David S. Miller, Antonio Ospite,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1322471704.2730.1.camel@phoenix>

On Mon, 2011-11-28 at 01:15 -0800, Axel Lin wrote:
> This patch converts the drivers in net/rfkill/* to use the
> module_platform_driver() macro which makes the code smaller and a bit
> simpler.
> 
> Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Cc: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
> Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
> Cc: Antonio Ospite <ospite-aNJ+ML1ZbiP93QAQaVx+gl6hYfS7NtTn@public.gmane.org>
> Cc: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Axel Lin <axel.lin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  net/rfkill/rfkill-gpio.c      |   13 +------------
>  net/rfkill/rfkill-regulator.c |   12 +-----------
>  2 files changed, 2 insertions(+), 23 deletions(-)
> 
> diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
> index 128677d..ca355e7 100644
> --- a/net/rfkill/rfkill-gpio.c
> +++ b/net/rfkill/rfkill-gpio.c
> @@ -220,18 +220,7 @@ static struct platform_driver rfkill_gpio_driver = {
>  	},
>  };
>  
> -static int __init rfkill_gpio_init(void)
> -{
> -	return platform_driver_register(&rfkill_gpio_driver);
> -}
> -
> -static void __exit rfkill_gpio_exit(void)
> -{
> -	platform_driver_unregister(&rfkill_gpio_driver);
> -}
> -
> -module_init(rfkill_gpio_init);
> -module_exit(rfkill_gpio_exit);
> +module_platform_driver(rfkill_gpio_driver);
>  
>  MODULE_DESCRIPTION("gpio rfkill");
>  MODULE_AUTHOR("NVIDIA");

Gpio part looks good to me.

Acked-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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

* Re: [NET][TG3] Fwd: page allocation failure with linux 3.1.1
From: Eric Dumazet @ 2011-11-28 19:28 UTC (permalink / raw)
  To: Rick Jones
  Cc: Пламен Петров,
	David Miller, netdev
In-Reply-To: <4ED3DB91.9090409@hp.com>

Le lundi 28 novembre 2011 à 11:05 -0800, Rick Jones a écrit :
> On 11/28/2011 12:26 AM, Eric Dumazet wrote:

> > Since some devices might copy skb to a linear one in their
> > ndo_start_xmit(), we could set a netdev limit so that TSO can still be
> > used on these devices, but limiting number of frags to
> > 2^PAGE_ALLOC_COSTLY_ORDER
> 
> How much "TSO value" remains after such a copy?

Instead of filling up to 64Kbytes + one head of data per skb, we'll fill
32kbytes (8*4Kbytes) + one head.

Thats still better than 1460 bytes per skb :)

^ permalink raw reply

* [PATCH net-next 0/2] tg3: Quick fixes
From: Matt Carlson @ 2011-11-28 19:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, mcarlson

This patchset fixes two recently discovered bugs.

^ permalink raw reply

* [PATCH net-next 2/2] tg3: Scale back code that modifies MRRS
From: Matt Carlson @ 2011-11-28 19:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, mcarlson, Michael Chan

Tg3 normally gets a performance boost by increasing the PCI Maximum Read
Request Size (MRRS) to 4k.  Unfortunately, this is causing some problems
on particular hardware platforms.  This patch removes all code that
modifies the MRRS except for one case.

As part of a solution to fix an internal FIFO problem on the 5719, the
driver artificially capped the MRRS to 2k for the entire 5719, and later
5720, ASIC revs.  This was overly aggressive and only really needed to
be done for the 5719 A0.  In the spirit of the rest of this patch, the
driver will only reprogram the MRRS for this device if the value exceeds
the 2k cap.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c |   27 ++++++++++-----------------
 1 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 0c695dc..aa413d6 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7615,15 +7615,11 @@ static void tg3_restore_pci_state(struct tg3 *tp)
 
 	pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
 
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) {
-		if (tg3_flag(tp, PCI_EXPRESS))
-			pcie_set_readrq(tp->pdev, tp->pcie_readrq);
-		else {
-			pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
-					      tp->pci_cacheline_sz);
-			pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
-					      tp->pci_lat_timer);
-		}
+	if (!tg3_flag(tp, PCI_EXPRESS)) {
+		pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
+				      tp->pci_cacheline_sz);
+		pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
+				      tp->pci_lat_timer);
 	}
 
 	/* Make sure PCI-X relaxed ordering bit is clear. */
@@ -7808,8 +7804,6 @@ static int tg3_chip_reset(struct tg3 *tp)
 				      pci_pcie_cap(tp->pdev) + PCI_EXP_DEVCTL,
 				      val16);
 
-		pcie_set_readrq(tp->pdev, tp->pcie_readrq);
-
 		/* Clear error status */
 		pci_write_config_word(tp->pdev,
 				      pci_pcie_cap(tp->pdev) + PCI_EXP_DEVSTA,
@@ -14053,12 +14047,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 
 		tg3_flag_set(tp, PCI_EXPRESS);
 
-		tp->pcie_readrq = 4096;
-		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
-		    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720)
-			tp->pcie_readrq = 2048;
-
-		pcie_set_readrq(tp->pdev, tp->pcie_readrq);
+		if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0) {
+			int readrq = pcie_get_readrq(tp->pdev);
+			if (readrq > 2048)
+				pcie_set_readrq(tp->pdev, 2048);
+		}
 
 		pci_read_config_word(tp->pdev,
 				     pci_pcie_cap(tp->pdev) + PCI_EXP_LNKCTL,
-- 
1.7.3.4

^ permalink raw reply related

* [PATCH net-next 1/2] tg3: Fix TSO CAP for 5704 devs w / ASF enabled
From: Matt Carlson @ 2011-11-28 19:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, mcarlson, Michael Chan

On the earliest TSO capable devices, TSO was accomplished through
firmware.  The TSO cannot coexist with ASF management firmware though.
The tg3 driver determines whether or not ASF is enabled by calling
tg3_get_eeprom_hw_cfg(), which checks a particular bit of NIC memory.
Commit dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, entitled "tg3: Move
TSO_CAPABLE assignment", accidentally moved the code that determines
TSO capabilities earlier than the call to tg3_get_eeprom_hw_cfg().  As a
consequence, the driver was attempting to determine TSO capabilities
before it had all the data it needed to make the decision.

This patch fixes the problem by revisiting and reevaluating the decision
after tg3_get_eeprom_hw_cfg() is called.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 0acb279..0c695dc 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -13988,9 +13988,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	if (tg3_flag(tp, HW_TSO_1) ||
 	    tg3_flag(tp, HW_TSO_2) ||
 	    tg3_flag(tp, HW_TSO_3) ||
-	    (tp->fw_needed && !tg3_flag(tp, ENABLE_ASF)))
+	    tp->fw_needed) {
+		/* For firmware TSO, assume ASF is disabled.
+		 * We'll disable TSO later if we discover ASF
+		 * is enabled in tg3_get_eeprom_hw_cfg().
+		 */
 		tg3_flag_set(tp, TSO_CAPABLE);
-	else {
+	} else {
 		tg3_flag_clear(tp, TSO_CAPABLE);
 		tg3_flag_clear(tp, TSO_BUG);
 		tp->fw_needed = NULL;
@@ -14266,6 +14270,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	 */
 	tg3_get_eeprom_hw_cfg(tp);
 
+	if (tp->fw_needed && tg3_flag(tp, ENABLE_ASF)) {
+		tg3_flag_clear(tp, TSO_CAPABLE);
+		tg3_flag_clear(tp, TSO_BUG);
+		tp->fw_needed = NULL;
+	}
+
 	if (tg3_flag(tp, ENABLE_APE)) {
 		/* Allow reads and writes to the
 		 * APE register and memory space.
-- 
1.7.3.4

^ permalink raw reply related

* Re: iwlagn failed resume from S3
From: Srivatsa S. Bhat @ 2011-11-28 19:45 UTC (permalink / raw)
  To: Udo Steinberg
  Cc: Guy, Wey-Yi, Linux Kernel Mailing List,
	Linux Network Mailing List, linux-wireless, Linux PM mailing list
In-Reply-To: <20111128151406.51282c25@x220.fritz.box>


Adding linux-pm mailing list to CC.

Thanks,
Srivatsa S. Bhat

On 11/28/2011 07:44 PM, Udo Steinberg wrote:

> Hi,
> 
> After coming out of Suspend-to-RAM with Linux-3.1.0, the Centrino Advanced-N
> 6205 WiFi failed to resume with the following warnings in dmesg. So far this
> has happened just once and it's not easily reproducible.
> 
> Cheers,
> 
> 	- Udo
> 
> iwlagn 0000:03:00.0: restoring config space at offset 0xf (was 0x100, writing 0x1ff)
> iwlagn 0000:03:00.0: restoring config space at offset 0x4 (was 0x4, writing 0xf2500004)
> iwlagn 0000:03:00.0: restoring config space at offset 0x3 (was 0x0, writing 0x10)
> iwlagn 0000:03:00.0: L1 Disabled; Enabling L0S
> iwlagn 0000:03:00.0: Radio type=0x1-0x2-0x0
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c:765 iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]()
> Hardware name: 4290W4H
> wrong command queue 2 (should be 9), sequence 0x2FA readp=0 writep=0
> Modules linked in: iwlagn
> Pid: 0, comm: swapper Not tainted 3.1.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffffa0027199>] ? iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]
>  [<ffffffffa001c15c>] ? iwl_rx_dispatch+0x147/0x20f [iwlagn]
>  [<ffffffffa00251d0>] ? iwl_irq_tasklet+0x7c9/0xb52 [iwlagn]
>  [<ffffffffa0025fc3>] ? iwl_isr_ict+0x563/0x628 [iwlagn]
>  [<ffffffff8103b439>] ? tasklet_action+0x67/0xa7
>  [<ffffffff8103b95b>] ? __do_softirq+0x7f/0x106
>  [<ffffffff813c10ec>] ? call_softirq+0x1c/0x26
>  [<ffffffff8100351e>] ? do_softirq+0x31/0x67
>  [<ffffffff8103bc0f>] ? irq_exit+0x44/0xb0
>  [<ffffffff8100325f>] ? do_IRQ+0x94/0xad
>  [<ffffffff813bf62b>] ? common_interrupt+0x6b/0x6b
>  <EOI>  [<ffffffff8104fe71>] ? __hrtimer_start_range_ns+0x2c6/0x2d9
>  [<ffffffff81190656>] ? intel_idle+0xcd/0xe9
>  [<ffffffff81190632>] ? intel_idle+0xa9/0xe9
>  [<ffffffff812cb231>] ? cpuidle_idle_call+0xa0/0xdb
>  [<ffffffff810007b9>] ? cpu_idle+0x53/0x7c
>  [<ffffffff816869fa>] ? start_kernel+0x2be/0x2c9
> ---[ end trace 0107c607401edcc1 ]---
> iwl data: 00000000: 00 00 35 02 00 00 fa 02 00 00 34 02 00 00 fa 02  ..5.......4.....
> iwl data: 00000010: 00 00 35 02 00 00 34 02 00 00 35 02 00 00 f7 02  ..5...4...5.....
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 209 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 215 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 221 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 214 is out of range [0-256] 0 0.
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c:765 iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]()
> Hardware name: 4290W4H
> wrong command queue 20 (should be 9), sequence 0x1447 readp=0 writep=0
> Modules linked in: iwlagn
> Pid: 0, comm: swapper Tainted: G        W   3.1.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffffa0027199>] ? iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]
>  [<ffffffffa001c15c>] ? iwl_rx_dispatch+0x147/0x20f [iwlagn]
>  [<ffffffffa00251d0>] ? iwl_irq_tasklet+0x7c9/0xb52 [iwlagn]
>  [<ffffffffa0025fc3>] ? iwl_isr_ict+0x563/0x628 [iwlagn]
>  [<ffffffff8103b439>] ? tasklet_action+0x67/0xa7
>  [<ffffffff8103b95b>] ? __do_softirq+0x7f/0x106
>  [<ffffffff813c10ec>] ? call_softirq+0x1c/0x26
>  [<ffffffff8100351e>] ? do_softirq+0x31/0x67
>  [<ffffffff8103bc0f>] ? irq_exit+0x44/0xb0
>  [<ffffffff8100325f>] ? do_IRQ+0x94/0xad
>  [<ffffffff813bf62b>] ? common_interrupt+0x6b/0x6b
>  <EOI>  [<ffffffff8104fe71>] ? __hrtimer_start_range_ns+0x2c6/0x2d9
>  [<ffffffff81190656>] ? intel_idle+0xcd/0xe9
>  [<ffffffff81190632>] ? intel_idle+0xa9/0xe9
>  [<ffffffff812cb231>] ? cpuidle_idle_call+0xa0/0xdb
>  [<ffffffff810007b9>] ? cpu_idle+0x53/0x7c
>  [<ffffffff816869fa>] ? start_kernel+0x2be/0x2c9
> ---[ end trace 0107c607401edcc2 ]---
> iwl data: 00000000: cc 0e ba 13 e6 5d 47 14 14 13 7c 6c 42 dc f5 1a  .....]G...|lB...
> iwl data: 00000010: 5a f8 f3 ba 2f b8 6d 20 10 0e 10 b2 c0 38 e7 0b  Z.../.m .....8..
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c:765 iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]()
> Hardware name: 4290W4H
> wrong command queue 0 (should be 9), sequence 0xE1 readp=0 writep=0
> Modules linked in: iwlagn
> Pid: 0, comm: swapper Tainted: G        W   3.1.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffffa0027199>] ? iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]
>  [<ffffffffa001e577>] ? iwl_rx_scan_complete_notif+0x163/0x1d3 [iwlagn]
>  [<ffffffffa00251d0>] ? iwl_irq_tasklet+0x7c9/0xb52 [iwlagn]
>  [<ffffffffa0025fc3>] ? iwl_isr_ict+0x563/0x628 [iwlagn]
>  [<ffffffff8103b439>] ? tasklet_action+0x67/0xa7
>  [<ffffffff8103b95b>] ? __do_softirq+0x7f/0x106
>  [<ffffffff813c10ec>] ? call_softirq+0x1c/0x26
>  [<ffffffff8100351e>] ? do_softirq+0x31/0x67
>  [<ffffffff8103bc0f>] ? irq_exit+0x44/0xb0
>  [<ffffffff8100325f>] ? do_IRQ+0x94/0xad
>  [<ffffffff813bf62b>] ? common_interrupt+0x6b/0x6b
>  <EOI>  [<ffffffff8104fe71>] ? __hrtimer_start_range_ns+0x2c6/0x2d9
>  [<ffffffff81190656>] ? intel_idle+0xcd/0xe9
>  [<ffffffff81190632>] ? intel_idle+0xa9/0xe9
>  [<ffffffff812cb231>] ? cpuidle_idle_call+0xa0/0xdb
>  [<ffffffff810007b9>] ? cpu_idle+0x53/0x7c
>  [<ffffffff816869fa>] ? start_kernel+0x2be/0x2c9
> ---[ end trace 0107c607401edcc3 ]---
> iwl data: 00000000: 35 18 04 00 84 c5 e1 00 f1 00 e0 00 58 00 4e 00  5...........X.N.
> iwl data: 00000010: 35 08 04 00 85 c5 e1 00 2a b0 e1 00 15 00 13 00  5.......*.......
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 208 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 232 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 213 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 210 is out of range [0-256] 0 0.
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c:765 iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]()
> Hardware name: 4290W4H
> wrong command queue 0 (should be 9), sequence 0x61 readp=0 writep=0
> Modules linked in: iwlagn
> Pid: 0, comm: swapper Tainted: G        W   3.1.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffffa0027199>] ? iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]
>  [<ffffffffa001c15c>] ? iwl_rx_dispatch+0x147/0x20f [iwlagn]
>  [<ffffffffa00251d0>] ? iwl_irq_tasklet+0x7c9/0xb52 [iwlagn]
>  [<ffffffffa0025fc3>] ? iwl_isr_ict+0x563/0x628 [iwlagn]
>  [<ffffffff8103b439>] ? tasklet_action+0x67/0xa7
>  [<ffffffff8103b95b>] ? __do_softirq+0x7f/0x106
>  [<ffffffff813c10ec>] ? call_softirq+0x1c/0x26
>  [<ffffffff8100351e>] ? do_softirq+0x31/0x67
>  [<ffffffff8103bc0f>] ? irq_exit+0x44/0xb0
>  [<ffffffff8100325f>] ? do_IRQ+0x94/0xad
>  [<ffffffff813bf62b>] ? common_interrupt+0x6b/0x6b
>  <EOI>  [<ffffffff8104fe71>] ? __hrtimer_start_range_ns+0x2c6/0x2d9
>  [<ffffffff81190656>] ? intel_idle+0xcd/0xe9
>  [<ffffffff81190632>] ? intel_idle+0xa9/0xe9
>  [<ffffffff812cb231>] ? cpuidle_idle_call+0xa0/0xdb
>  [<ffffffff810007b9>] ? cpu_idle+0x53/0x7c
>  [<ffffffff816869fa>] ? start_kernel+0x2be/0x2c9
> ---[ end trace 0107c607401edcc4 ]---
> iwl data: 00000000: 35 18 04 00 47 10 61 00 45 10 61 00 0c 00 0c 00  5...G.a.E.a.....
> iwl data: 00000010: 37 00 04 00 48 10 61 00 45 10 61 00 00 00 00 00  7...H.a.E.a.....
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 219 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 220 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 212 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 230 is out of range [0-256] 0 0.
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c:765 iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]()
> Hardware name: 4290W4H
> wrong command queue 0 (should be 9), sequence 0x0 readp=0 writep=0
> Modules linked in: iwlagn
> Pid: 0, comm: swapper Tainted: G        W   3.1.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffffa0027199>] ? iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]
>  [<ffffffffa001c15c>] ? iwl_rx_dispatch+0x147/0x20f [iwlagn]
>  [<ffffffffa00251d0>] ? iwl_irq_tasklet+0x7c9/0xb52 [iwlagn]
>  [<ffffffffa0025fc3>] ? iwl_isr_ict+0x563/0x628 [iwlagn]
>  [<ffffffff8103b439>] ? tasklet_action+0x67/0xa7
>  [<ffffffff8103b95b>] ? __do_softirq+0x7f/0x106
>  [<ffffffff813c10ec>] ? call_softirq+0x1c/0x26
>  [<ffffffff8100351e>] ? do_softirq+0x31/0x67
>  [<ffffffff8103bc0f>] ? irq_exit+0x44/0xb0
>  [<ffffffff8100325f>] ? do_IRQ+0x94/0xad
>  [<ffffffff813bf62b>] ? common_interrupt+0x6b/0x6b
>  <EOI>  [<ffffffff8104fe71>] ? __hrtimer_start_range_ns+0x2c6/0x2d9
>  [<ffffffff81190656>] ? intel_idle+0xcd/0xe9
>  [<ffffffff81190632>] ? intel_idle+0xa9/0xe9
>  [<ffffffff812cb231>] ? cpuidle_idle_call+0xa0/0xdb
>  [<ffffffff810007b9>] ? cpu_idle+0x53/0x7c
>  [<ffffffff816869fa>] ? start_kernel+0x2be/0x2c9
> ---[ end trace 0107c607401edcc5 ]---
> iwl data: 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 fe 01 00 00  ................
> iwl data: 00000010: b8 c0 0c 04 00 ea ff ff c8 d7 09 07 00 ea ff ff  ................
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 216 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 224 is out of range [0-256] 0 0.
> iwlagn 0000:03:00.0: iwl_hcmd_queue_reclaim: Read index for DMA queue txq id (9), index 223 is out of range [0-256] 0 0.
> ------------[ cut here ]------------
> WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c:765 iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]()
> Hardware name: 4290W4H
> wrong command queue 18 (should be 9), sequence 0x5259 readp=0 writep=0
> Modules linked in: iwlagn
> Pid: 0, comm: swapper Tainted: G        W   3.1.0 #1
> Call Trace:
>  <IRQ>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffffa0027199>] ? iwl_tx_cmd_complete+0xa4/0x335 [iwlagn]
>  [<ffffffffa001c15c>] ? iwl_rx_dispatch+0x147/0x20f [iwlagn]
>  [<ffffffffa00251d0>] ? iwl_irq_tasklet+0x7c9/0xb52 [iwlagn]
>  [<ffffffffa0025fc3>] ? iwl_isr_ict+0x563/0x628 [iwlagn]
>  [<ffffffff8103b439>] ? tasklet_action+0x67/0xa7
>  [<ffffffff8103b95b>] ? __do_softirq+0x7f/0x106
>  [<ffffffff813c10ec>] ? call_softirq+0x1c/0x26
>  [<ffffffff8100351e>] ? do_softirq+0x31/0x67
>  [<ffffffff8103bc0f>] ? irq_exit+0x44/0xb0
>  [<ffffffff8100325f>] ? do_IRQ+0x94/0xad
>  [<ffffffff813bf62b>] ? common_interrupt+0x6b/0x6b
>  <EOI>  [<ffffffff8104fe71>] ? __hrtimer_start_range_ns+0x2c6/0x2d9
>  [<ffffffff81190656>] ? intel_idle+0xcd/0xe9
>  [<ffffffff81190632>] ? intel_idle+0xa9/0xe9
>  [<ffffffff812cb231>] ? cpuidle_idle_call+0xa0/0xdb
>  [<ffffffff810007b9>] ? cpu_idle+0x53/0x7c
>  [<ffffffff816869fa>] ? start_kernel+0x2be/0x2c9
> ---[ end trace 0107c607401edcc6 ]---
> iwl data: 00000000: d0 26 c9 95 25 33 59 52 20 38 a2 2c 91 27 48 90  .&..%3YR 8.,.'H.
> iwl data: 00000010: fb 08 36 49 c5 1a a6 ee 13 48 03 62 44 30 77 60  ..6I.....H.bD0w`
> iwlagn 0000:03:00.0: Failed to start RT ucode: -110
> iwlagn 0000:03:00.0: Unable to initialize device.
> ------------[ cut here ]------------
> WARNING: at net/mac80211/util.c:1182 ieee80211_reconfig+0x110/0x407()
> Hardware name: 4290W4H
> Hardware became unavailable upon resume. This could be a software issue prior to suspend or a hardware issue.
> Modules linked in: iwlagn
> Pid: 4801, comm: acpi_handler.sh Tainted: G        W   3.1.0 #1
> Call Trace:
>  [<ffffffff81036e2d>] ? warn_slowpath_common+0x78/0x8c
>  [<ffffffff81379cbf>] ? wiphy_suspend+0x5f/0x5f
>  [<ffffffff81036ee2>] ? warn_slowpath_fmt+0x45/0x4a
>  [<ffffffff813a7c7e>] ? ieee80211_reconfig+0x110/0x407
>  [<ffffffff81379cbf>] ? wiphy_suspend+0x5f/0x5f
>  [<ffffffff81379d2b>] ? wiphy_resume+0x6c/0x7c
>  [<ffffffff8123d6ed>] ? legacy_resume+0x1e/0x4e
>  [<ffffffff8123db3a>] ? device_resume+0xb7/0x100
>  [<ffffffff8123e16f>] ? dpm_resume+0xd7/0x182
>  [<ffffffff8123e36c>] ? dpm_resume_end+0x8/0x10
>  [<ffffffff81062179>] ? suspend_devices_and_enter+0x1b3/0x1ec
>  [<ffffffff8106228a>] ? enter_state+0xd8/0x12b
>  [<ffffffff810619aa>] ? state_store+0xaa/0xca
>  [<ffffffff810f08e1>] ? sysfs_write_file+0xd3/0x10f
>  [<ffffffff810ac20b>] ? vfs_write+0xaf/0x129
>  [<ffffffff810ac45e>] ? sys_write+0x45/0x6e
>  [<ffffffff813bfc7b>] ? system_call_fastpath+0x16/0x1b
> ---[ end trace 0107c607401edcc7 ]---
> legacy_resume(): wiphy_resume+0x0/0x7c returns -110
> PM: Device phy0 failed to resume: error -110
> PM: resume of devices complete after 2777.958 msecs
> PM: Finishing wakeup.
> Restarting tasks ... done.
> video LNXVIDEO:00: Restoring backlight state

^ permalink raw reply

* Re: [PATCH net-next 2/2] tg3: Scale back code that modifies MRRS
From: Ben Hutchings @ 2011-11-28 19:53 UTC (permalink / raw)
  To: Matt Carlson; +Cc: davem, netdev, Michael Chan
In-Reply-To: <1322509264-19636-3-git-send-email-mcarlson@broadcom.com>

On Mon, 2011-11-28 at 11:41 -0800, Matt Carlson wrote:
> Tg3 normally gets a performance boost by increasing the PCI Maximum Read
> Request Size (MRRS) to 4k.  Unfortunately, this is causing some problems
> on particular hardware platforms.  This patch removes all code that
> modifies the MRRS except for one case.
> 
> As part of a solution to fix an internal FIFO problem on the 5719, the
> driver artificially capped the MRRS to 2k for the entire 5719, and later
> 5720, ASIC revs.  This was overly aggressive and only really needed to
> be done for the 5719 A0.  In the spirit of the rest of this patch, the
> driver will only reprogram the MRRS for this device if the value exceeds
> the 2k cap.
[...]

It may be better to do this as a PCI quirk, so that the generic MPS/MRRS
configuration code has this information.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* pull request: wireless-next 2011-11-28
From: John W. Linville @ 2011-11-28 20:02 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

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

commit 39338b56382ac640614851a80e0bd71994cc664d

Dave,

Another big pull request -- my apologies!  I have a couple of
sub-maintainers that had let their patch queues back-up a bit too
long...

This pull request contains a lot of refactoring in the iwlegacy and
ath6kl drivers.  mac80211 and rndis_wlan get some love as well.  Beyond
that, there is a handful of small updates and minor fixes to some
drivers and around the wireless stack.

Let me know if there are problems!

John

---

The following changes since commit 8b7ff200010600ef7cd9d002f9f8f97edfc7578e:

  net/irda: convert drivers/net/irda/* to use module_platform_driver() (2011-11-27 20:29:11 -0500)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem

Aarthi Thiruvengadam (2):
      ath6kl: add support for WPS
      ath6kl: fix missing copy of action frame contents

Ben Greear (2):
      wireless: Support ht-capabilities over-rides.
      mac80211: Support ht-cap over-rides.

Bing Zhao (1):
      mwifiex: add support for Marvell sd8797 device

Chilam Ng (1):
      ath6kl: make sure WLAN power save is enabled during suspend

Christian Lamparter (2):
      p54: use ieee80211_free_txskb
      carl9170: use ieee80211_free_txskb

Dan Carpenter (2):
      mac80211: use kfree_skb() instead of kfree()
      mac80211: memory leak in mesh_queue_preq()

Emmanuel Grumbach (4):
      iwlwifi: check the HW when a queue is stuck
      iwlwifi: improve the prints in the reclaim path
      iwlwifi: fix endianity issues in debug prints
      iwlwifi: tid_data is taken twice in iwl_trans_pcie_tx_agg_alloc

Felix Fietkau (1):
      mac80211: call ieee80211_recalc_idle() after sending packets

George (1):
      rtlwifi: rtl8192cu: Allow retries for USB I/O

Greg Dietsche (9):
      iwlegacy: change IL_WARN to D_HT in il4965_tx_agg_start
      iwlegacy: change IL_ERR to D_HT in iwl4965_rs_tl_turn_on_agg_for_tid
      iwlegacy: 4965: remove vif null check in request_scan
      iwlegacy: 4965-rs: remove null check on sta in il4965_rs_tx_status
      iwlegacy: 4965-rs: remove unnecessary null check for sta and lq_sta
      iwlegacy: 4965-rs: il4965_rs_alloc_sta: remove lq_sta local var
      iwlegacy: 4965-rs: don't return rate from il4965_rs_update_rate_tbl
      iwlegacy: 4965-rs: cleanup il4965_rs_sta_dbgfs_rate_scale_data_read
      iwlegacy: debugfs_ops should depend on CONFIG_IWLEGACY_DEBUGFS

Helmut Schaa (2):
      mac80211: Check rate->idx before rate->count
      mac80211: Get rid of search loop for rate group index

Ilan Elias (1):
      NFC: Fix indentation in nci.h file

Joe Perches (2):
      brcmsmac: Use current logging styles
      iwl-debug: Shrink object by using dev_err and deduplicating formats

Johannes Berg (12):
      mac80211: remove crypto special case for auth frames
      mac80211: use skb list for fragments
      mac80211: move fragment flag adjustment
      mac80211: make TX LED handling independent of fragmentation
      mac80211: transmit fragment list to drivers
      mac80211: remove unused ASSOC_AP flag
      mac80211: minor cleanup to mesh state locking
      cfg80211: add flags for off-channel capabilities
      nl80211: make get_vlan logic more common
      cfg80211/mac80211: Revert "move information element parsing logic to cfg80211"
      cfg80211: work around a sparse issue
      mac80211: fix RCU warnings in mesh

John W. Linville (5):
      Merge branch 'for-linville' of git://github.com/kvalo/ath6kl
      Merge branch 'for-linville' of git://github.com/sgruszka/iwlegacy
      Merge branch 'master' of git://git.kernel.org/.../torvalds/linux
      rtlwifi: squash warning in _usb_read_sync
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem

Jouni Malinen (10):
      ath6kl: Add endpoint_stats debugfs file
      ath6kl: Add debugfs file for target roam table
      ath6kl: Add debugfs files for roaming control
      ath6kl: Add debugfs control for keepalive and disconnection timeout
      ath6kl: Allow CCKM AKM and KRK to be configured
      ath6kl: Fix endpoint_stats debugfs buffer length calculation
      ath6kl: Report unique remain-on-channel cookie values
      ath6kl: Remove unused WMI crypto defines
      ath6kl: Fix key configuration to copy at most seq_len from seq
      ath6kl: Do not hide ath6kl_wmi_addkey_cmd() error values

Jussi Kivilinna (5):
      rndis_wlan: split getting current channel to separate function
      rndis_wlan: pass channel info to cfg80211_roamed()
      rndis_wlan: add missing __packed
      rndis_wlan: add reporting of PMKSA candidate events
      rndis_wlan: remove unused macro

Kalle Valo (47):
      ath6kl: remove unused parameters from struct wmi
      ath6kl: fix struct host_app_area endian handling
      ath6kl: return error block size is not power of 2
      ath6kl: move htc_hif to hif.c
      ath6kl: remove unused values from htc_hif.h
      ath6kl: move remaining content from htc_hif.h to hif.h
      ath6kl: fix null skb dereference in ath6kl_rx()
      ath6kl: fix firmware start address for ar6003 hw2.0
      ath6kl: merge htc debug levels
      ath6kl: cleanup htc debug messages
      ath6kl: don't dump full htc packets
      ath6kl: add debug level for hif
      ath6kl: remove unused A_CACHE_LINE_PAD
      ath6kl: use ath6kl prefix in credit functions
      ath6kl: rename struct htc_endpoint_credit_dist.htc_rsvd to htc_ep
      ath6kl: rename struct htc_credit_state_info to ath6kl_htc_credit_info
      ath6kl: move all credit distribution code to htc.c
      ath6kl: use ath6kl_credit prefix consistently
      ath6kl: remove unused debug levels
      ath6kl: add debug messages for credit handling
      ath6kl: add more boot debug messages
      ath6kl: don't use cfg80211_scan_request after cfg80211_scan_done()
      ath6kl: rename ath6kl_wmi_qos_state_init() to _wmi_reset()
      ath6kl: move power control from sdio to core
      ath6kl: add a fixme to ath6kl_htc_wait_target()
      ath6kl: merge ath6kl_init() to ath6kl_core_init()
      ath6kl: separate hardware boot code from module initialisation code
      ath6kl: remove useless cleanup call from ath6kl_bmi_done()
      ath6kl: add a timeout to ath6kl_hif_intr_bh_handler()
      ath6kl: create ath6kl_htc_reset()
      ath6kl: don't print an error for canceled packets
      ath6kl: change name of sdio driver to ath6kl
      ath6kl: create ath6kl_hif_stop()
      ath6kl: power down hardware when interface is down
      ath6kl: fix WLAN_ENABLE usage in ath6kl_close()
      ath6kl: print firmware crashes always
      ath6kl: print seqno in htc debug logs
      ath6kl: add aborted parameter to ath6kl_cfg80211_scan_complete_event()
      ath6kl: create ath6kl_cfg80211_stop()
      ath6kl: reset CONNECT_PEND and CONNECTED flags in ath6kl_cfg80211_stop()
      ath6kl: implement ath6kl_cfg80211_suspend()
      ath6kl: add state variable depicting hw/fw state
      ath6kl: refactor sdio configuration to a separate function
      ath6kl: cut power during suspend
      ath6kl: don't power down hardware when interface is down
      ath6kl: add suspend_cutpower module parameter
      nl80211: add testmode to the list of supported commands

Kevin Fang (1):
      ath6kl: Add WSC IE on the associate message

Larry Finger (3):
      rtlwifi: rtl8192cu: Change firmware upload to use block writes
      rtlwifi: rtl8192cu: Fix endianian issues
      rtlwifi: Remove redundant code from PCI interrupt

Luis R. Rodriguez (2):
      cfg80211: process regulatory DFS region for countries
      cfg80211: pass DFS region to drivers through reg_notifier()

Michael Buesch (1):
      p54spi: Remove FIXME in op_stop

Patrick Kelle (1):
      minstrel_ht: Remove unused function parameters

Raja Mani (11):
      ath6kl: Add wmi functions to add/delete WOW patterns
      ath6kl: Add wmi functions to configure WOW mode and host sleep mode
      ath6kl: Add WOW suspend/resume implementation
      ath6kl: Include new parameter in suspend path for wowlan
      ath6kl: Add new state for WOW mode
      ath6kl: Move ath6kl_cfg80211_stop() call specific to deep sleep and cut pwr
      ath6kl: Invoke WOW suspend/resume calls during PM operation
      ath6kl: Perform WOW resume in RX path in case of SDIO IRQ wake up
      ath6kl: Remove WARN_ON msg in Suspend path
      ath6kl: Expose ath6kl's WOW capabilities to cfg80211
      ath6kl: Remove few unused WMI stuff

Rajkumar Manoharan (3):
      ath9k: Remove enabling btcoex from stomp type change
      ath9k_hw: Cleanup btcoex wlan weights
      ath9k_hw: set btcoex weights for AR9462

Rick Jones (1):
      wireless: use strlcpy routine in .get_drvinfo

Rishi Panjwani (4):
      ath6kl: Implement support for QOS-enable and QOS-disable from userspace
      ath6kl: Implement support for background scan control from userspace
      ath6kl: Implement support for listen interval from userspace
      ath6kl: Implement support for power parameter control from userspace

Sam Leffler (1):
      ath6kl: unbreak suspend

Sangwook Lee (1):
      ath6kl: Fix compilation error from of.h

Stanislaw Gruszka (68):
      iwlegacy: remove tracing
      iwlegacy: rename iwl to il
      iwlegacy: rename priv to il
      iwlegacy: rename iwlegacy to il
      iwlegacy: remove DEBUG_IO
      iwlegacy: remove DEBUG_LIMIT
      iwlegacy: rename IL_DEBUG_ to D_
      iwlegacy: remove il argument from IWL_ERR/INFO/WARN/CRIT
      iwlegacy: remove IL_CRIT
      iwlegacy: rename il_{read,write}32 to _il_{rd,wr}
      iwlegacy: mark poll bit as unlocked function
      iwlegacy: mark il_{grab,release}_nic_access as unlocked
      iwlegacy: remove _il_{read,write}_direct32
      iwlegacy: rename i/o direct methods
      iwlegacy: rename il_{read,write}_prph
      iwlegacy: remove not needed parentheses
      iwlegacy: rename remaining IWLs to ILs
      iwlegacy: s/iwl_rx_packet/iwl_rx_pkt/
      iwlegacy: partial rxon context cleanup
      iwlegacy: s/il_rx_mem_buffer/il_rx_buf/
      iwlegacy: s/statistics/stats/
      iwlegacy: s/window/win/
      iwlegacy: s/IL_RATE/RATE/
      iwlegacy: s/INDEX/IDX/
      iwlegacy: s/index/idx/
      iwlegacy: s/TABLE/TBL/
      iwlegacy: remove for_each_context
      iwlegacy: rename base 4965 and 3945 file names
      iwlegacy: merge iwl-4965-led.c into 4965.c
      iwlegacy: merge iwl-3945-led.c into 3945.c
      iwlegacy: merge iwl-4965-eeprom.c into 4965.c
      iwlegacy: merge iwl-4965-ucode.c into 4965.c
      iwlegacy: merge iwl-4965-sta.c into 4965-mac.c
      iwlegacy: merge iwl-4965-{tx,rx}.c into 4965-mac.c
      iwlegacy: merge iwl-4965-lib.c into 4965-mac.c
      iwlegacy: rename iwl-4965-{rs,calib,debugfs}.c to 4965-{rs,calib,debug}.c
      iwlegacy: rename iwl-3945-{rs,debugfs}.c to 3945-{rs,debug}.c
      iwlegacy: add accidentally removed comments
      iwlegacy: move iwl-4965-{,hw,debugfs,calib}.h to 4965.h
      iwlegacy: move iwl-3945-{,hw,fh,debugfs}.h to 3945.h
      iwlegacy: s/STATUS_/S_/
      iwlegacy: s/STATISTICS/STATS/
      iwlegacy: rename REPLY_ to N_ or C_
      iwlegacy: s/rx_handler/handler/
      iwlegacy: s/rx_reply/hdl/
      iwlegacy: rename other handlers
      iwlegacy: rename iwl-core.c to common.c
      iwlegacy: merge common .c files
      iwlegacy: rename module name
      iwlegacy: rename iwl-commands.h to commands.h
      iwlegacy: remove il_ieee80211_get_hw_conf
      iwlegacy: move IL_MASK
      iwlegacy: rename iwl-csr.h to csr.h
      iwlegacy: rename iwl-core.h to common.h
      iwlegacy: merge common header files
      iwlegacy: remove iwl-helpers.h
      iwlegacy: merge iwl-legacy-rs.h into common.h
      iwlegacy: merge iwl-power.h into common.h
      iwlegacy: merge iwl-{eeprom,led}.h into common.h
      iwlegacy: rename iwl-prph.h to prph.h
      iwlegacy: use FH39_ prefix in 3945 code
      iwlegacy: use FH49_ prefix in 4965 code
      iwlegacy: merge iwl-fh.h into 4965.h
      iwlegacy: rename iwl-debug.c to debug.c
      iwlegacy: merge iwl-debug.h into common.h
      iwlegacy: indentions and whitespaces
      iwlegacy: checkpatch.pl fixes
      iwlegacy: remove unused IL_AC_UNSET define

Thomas Meyer (1):
      brcm80211: smac: Use kmemdup rather than duplicating its implementation

Vasanthakumar Thiagarajan (42):
      ath6kl: Enable force foreground scan in connected state
      ath6kl: Fix sparse warning "symbol 'conn' shadows an earlier one"
      ath6kl: Replace spin_lock_irqsave with spin_lock_bh
      ath6kl: Claim sdio function only at appropriate places
      ath6kl: Fix htc_packet leak in ath6kl_htc_rx_process_packets()
      ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch()
      ath6kl: Avoid processing failed rx packets
      ath6kl: Minor cleanup in msg_look_ahead parameter in ath6kl_htc_rxmsg_pending_handler()
      ath6kl: Pass ath6kl structure to ath6kl_init() instead of net_device
      ath6kl: Keep wiphy reference in ath6kl structure
      ath6kl: Refactor wiphy dev and net dev init functions
      ath6kl: Cleanup fw interface type setting
      ath6kl: Define an initial vif structure and use it
      ath6kl: Define interface specific states
      ath6kl: Move ssid and crypto information to vif structure
      ath6kl: Move nw_type to vif structure
      ath6kl: Move bssid information to vif structure
      ath6kl: Move channel information to vif structure
      ath6kl: Move key information to vif structure
      ath6kl: Move aggregation information to vif structure
      ath6kl: Move disconnect timer to vif structure
      ath6kl: Move scan_req info and sme_state to vif
      ath6kl: Move few more vif specific information to struct ath6kl_vif
      ath6kl: Make net and target stats vif specific
      ath6kl: Maintain firmware interface index in struct ath6kl_vif
      ath6kl: Take vif information from wmi event
      ath6kl: Remove net_device from ath6kl
      ath6kl: Cleanup parameters in ath6kl_init_control_info() and ath6kl_init_profile_info()
      ath6kl: Refactor ath6kl_destroy()
      ath6kl: Use interface index from wmi data headr
      ath6kl: Store hw mac address in struct ath6kl
      ath6kl: Introduce spinlock to protect vif specific information
      ath6kl: Maintain virtual interface in a list
      ath6kl: Use the other variant of netdev (un)register APIs
      ath6kl: Configure inteface information at init time
      ath6kl: Implement add_virtual_intf() and del_virtual_intf()
      ath6kl: Add a modparam to enable multi normal interface support
      ath6kl: Initialize target wlan values for every vif
      ath6kl: Use appropriate wdev from vif
      ath6kl: Fix lockdep warning
      ath6kl: Fix tx packet drop in AP mode with bridge
      ath6kl: Fix error in writing create_qos debugfs

Wey-Yi Guy (1):
      iwlwifi: remove redundancy

Zefir Kurtisi (1):
      ath9k: trivial: reorder rx_tasklet processing

 drivers/net/wireless/Makefile                      |    2 +-
 drivers/net/wireless/ath/ath6kl/Makefile           |    2 +-
 drivers/net/wireless/ath/ath6kl/bmi.c              |    7 +-
 drivers/net/wireless/ath/ath6kl/bmi.h              |    2 +
 drivers/net/wireless/ath/ath6kl/cfg80211.c         | 1428 ++++--
 drivers/net/wireless/ath/ath6kl/cfg80211.h         |   30 +-
 drivers/net/wireless/ath/ath6kl/common.h           |   16 +-
 drivers/net/wireless/ath/ath6kl/core.h             |  202 +-
 drivers/net/wireless/ath/ath6kl/debug.c            |  849 +++-
 drivers/net/wireless/ath/ath6kl/debug.h            |   34 +-
 drivers/net/wireless/ath/ath6kl/hif-ops.h          |   49 +-
 .../net/wireless/ath/ath6kl/{htc_hif.c => hif.c}   |  150 +-
 drivers/net/wireless/ath/ath6kl/hif.h              |   61 +-
 drivers/net/wireless/ath/ath6kl/htc.c              |  725 ++-
 drivers/net/wireless/ath/ath6kl/htc.h              |   18 +-
 drivers/net/wireless/ath/ath6kl/htc_hif.h          |   92 -
 drivers/net/wireless/ath/ath6kl/init.c             |  676 +-
 drivers/net/wireless/ath/ath6kl/main.c             |  668 +--
 drivers/net/wireless/ath/ath6kl/sdio.c             |  335 +-
 drivers/net/wireless/ath/ath6kl/target.h           |    3 +
 drivers/net/wireless/ath/ath6kl/txrx.c             |  221 +-
 drivers/net/wireless/ath/ath6kl/wmi.c              |  688 ++-
 drivers/net/wireless/ath/ath6kl/wmi.h              |  243 +-
 drivers/net/wireless/ath/ath9k/btcoex.c            |  107 +-
 drivers/net/wireless/ath/ath9k/btcoex.h            |   10 +-
 drivers/net/wireless/ath/ath9k/gpio.c              |    2 +
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c      |    2 +
 drivers/net/wireless/ath/ath9k/hw.h                |    5 -
 drivers/net/wireless/ath/ath9k/recv.c              |   10 +-
 drivers/net/wireless/ath/ath9k/reg.h               |   15 +-
 drivers/net/wireless/ath/carl9170/tx.c             |    4 +-
 drivers/net/wireless/brcm80211/brcmsmac/aiutils.c  |   14 +-
 drivers/net/wireless/brcm80211/brcmsmac/dma.c      |  145 +-
 .../net/wireless/brcm80211/brcmsmac/mac80211_if.c  |    3 +-
 drivers/net/wireless/hostap/hostap_ioctl.c         |    4 +-
 drivers/net/wireless/ipw2x00/ipw2100.c             |    7 +-
 drivers/net/wireless/ipw2x00/ipw2200.c             |    7 +-
 drivers/net/wireless/iwlegacy/3945-debug.c         |  505 ++
 drivers/net/wireless/iwlegacy/3945-mac.c           | 3977 ++++++++++++
 drivers/net/wireless/iwlegacy/3945-rs.c            |  995 +++
 drivers/net/wireless/iwlegacy/3945.c               | 2751 ++++++++
 drivers/net/wireless/iwlegacy/3945.h               |  626 ++
 .../iwlegacy/{iwl-4965-calib.c => 4965-calib.c}    |  613 +-
 drivers/net/wireless/iwlegacy/4965-debug.c         |  746 +++
 drivers/net/wireless/iwlegacy/4965-mac.c           | 6536 ++++++++++++++++++++
 drivers/net/wireless/iwlegacy/4965-rs.c            | 2860 +++++++++
 drivers/net/wireless/iwlegacy/4965.c               | 2421 ++++++++
 drivers/net/wireless/iwlegacy/4965.h               | 1309 ++++
 drivers/net/wireless/iwlegacy/Kconfig              |   43 +-
 drivers/net/wireless/iwlegacy/Makefile             |   24 +-
 .../iwlegacy/{iwl-commands.h => commands.h}        | 1134 ++--
 drivers/net/wireless/iwlegacy/common.c             | 5707 +++++++++++++++++
 drivers/net/wireless/iwlegacy/common.h             | 3424 ++++++++++
 drivers/net/wireless/iwlegacy/{iwl-csr.h => csr.h} |   93 +-
 drivers/net/wireless/iwlegacy/debug.c              | 1411 +++++
 drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c   |  523 --
 drivers/net/wireless/iwlegacy/iwl-3945-debugfs.h   |   60 -
 drivers/net/wireless/iwlegacy/iwl-3945-fh.h        |  187 -
 drivers/net/wireless/iwlegacy/iwl-3945-hw.h        |  291 -
 drivers/net/wireless/iwlegacy/iwl-3945-led.c       |   63 -
 drivers/net/wireless/iwlegacy/iwl-3945-led.h       |   32 -
 drivers/net/wireless/iwlegacy/iwl-3945-rs.c        |  996 ---
 drivers/net/wireless/iwlegacy/iwl-3945.c           | 2741 --------
 drivers/net/wireless/iwlegacy/iwl-3945.h           |  308 -
 drivers/net/wireless/iwlegacy/iwl-4965-calib.h     |   75 -
 drivers/net/wireless/iwlegacy/iwl-4965-debugfs.c   |  774 ---
 drivers/net/wireless/iwlegacy/iwl-4965-debugfs.h   |   59 -
 drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c    |  154 -
 drivers/net/wireless/iwlegacy/iwl-4965-hw.h        |  811 ---
 drivers/net/wireless/iwlegacy/iwl-4965-led.c       |   73 -
 drivers/net/wireless/iwlegacy/iwl-4965-led.h       |   33 -
 drivers/net/wireless/iwlegacy/iwl-4965-lib.c       | 1194 ----
 drivers/net/wireless/iwlegacy/iwl-4965-rs.c        | 2871 ---------
 drivers/net/wireless/iwlegacy/iwl-4965-rx.c        |  215 -
 drivers/net/wireless/iwlegacy/iwl-4965-sta.c       |  721 ---
 drivers/net/wireless/iwlegacy/iwl-4965-tx.c        | 1378 -----
 drivers/net/wireless/iwlegacy/iwl-4965-ucode.c     |  166 -
 drivers/net/wireless/iwlegacy/iwl-4965.c           | 2183 -------
 drivers/net/wireless/iwlegacy/iwl-4965.h           |  282 -
 drivers/net/wireless/iwlegacy/iwl-core.c           | 2661 --------
 drivers/net/wireless/iwlegacy/iwl-core.h           |  636 --
 drivers/net/wireless/iwlegacy/iwl-debug.h          |  198 -
 drivers/net/wireless/iwlegacy/iwl-debugfs.c        | 1314 ----
 drivers/net/wireless/iwlegacy/iwl-dev.h            | 1364 ----
 drivers/net/wireless/iwlegacy/iwl-devtrace.c       |   42 -
 drivers/net/wireless/iwlegacy/iwl-devtrace.h       |  210 -
 drivers/net/wireless/iwlegacy/iwl-eeprom.c         |  553 --
 drivers/net/wireless/iwlegacy/iwl-eeprom.h         |  344 -
 drivers/net/wireless/iwlegacy/iwl-fh.h             |  513 --
 drivers/net/wireless/iwlegacy/iwl-hcmd.c           |  271 -
 drivers/net/wireless/iwlegacy/iwl-helpers.h        |  196 -
 drivers/net/wireless/iwlegacy/iwl-io.h             |  545 --
 drivers/net/wireless/iwlegacy/iwl-led.c            |  205 -
 drivers/net/wireless/iwlegacy/iwl-led.h            |   56 -
 drivers/net/wireless/iwlegacy/iwl-legacy-rs.h      |  456 --
 drivers/net/wireless/iwlegacy/iwl-power.c          |  165 -
 drivers/net/wireless/iwlegacy/iwl-power.h          |   55 -
 drivers/net/wireless/iwlegacy/iwl-rx.c             |  282 -
 drivers/net/wireless/iwlegacy/iwl-scan.c           |  550 --
 drivers/net/wireless/iwlegacy/iwl-spectrum.h       |    4 +-
 drivers/net/wireless/iwlegacy/iwl-sta.c            |  540 +-
 drivers/net/wireless/iwlegacy/iwl-sta.h            |  148 -
 drivers/net/wireless/iwlegacy/iwl-tx.c             |  659 --
 drivers/net/wireless/iwlegacy/iwl3945-base.c       | 4016 ------------
 drivers/net/wireless/iwlegacy/iwl4965-base.c       | 3281 ----------
 .../net/wireless/iwlegacy/{iwl-prph.h => prph.h}   |  133 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c          |    7 +-
 drivers/net/wireless/iwlwifi/iwl-debug.h           |   37 +-
 drivers/net/wireless/iwlwifi/iwl-io.c              |    2 +-
 drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h  |    5 +
 drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c   |    4 -
 drivers/net/wireless/iwlwifi/iwl-trans-pcie.c      |   12 +-
 drivers/net/wireless/libertas/ethtool.c            |    7 +-
 drivers/net/wireless/mwifiex/Kconfig               |    4 +-
 drivers/net/wireless/mwifiex/cfp.c                 |   38 +-
 drivers/net/wireless/mwifiex/fw.h                  |    1 +
 drivers/net/wireless/mwifiex/main.h                |    3 +-
 drivers/net/wireless/mwifiex/sdio.c                |   17 +-
 drivers/net/wireless/mwifiex/sdio.h                |    1 +
 drivers/net/wireless/mwifiex/sta_cmdresp.c         |    2 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c           |    4 +-
 drivers/net/wireless/p54/p54spi.c                  |    6 +-
 drivers/net/wireless/p54/txrx.c                    |    4 +-
 drivers/net/wireless/prism54/islpci_dev.c          |    4 +-
 drivers/net/wireless/rndis_wlan.c                  |   86 +-
 drivers/net/wireless/rtlwifi/base.c                |    6 +-
 drivers/net/wireless/rtlwifi/base.h                |    2 +-
 drivers/net/wireless/rtlwifi/pci.c                 |    3 -
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c  |   60 +-
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h  |   23 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c        |    9 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/mac.c       |    1 +
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c       |    2 +-
 drivers/net/wireless/rtlwifi/usb.c                 |   57 +-
 drivers/net/wireless/rtlwifi/wifi.h                |    7 +-
 include/linux/nl80211.h                            |   35 +
 include/net/cfg80211.h                             |   94 +-
 include/net/mac80211.h                             |   22 +-
 include/net/nfc/nci.h                              |   84 +-
 include/net/regulatory.h                           |    6 +
 net/mac80211/cfg.c                                 |    2 +-
 net/mac80211/debugfs_sta.c                         |    4 +-
 net/mac80211/driver-ops.h                          |    8 +
 net/mac80211/ht.c                                  |   83 +-
 net/mac80211/ieee80211_i.h                         |   75 +-
 net/mac80211/iface.c                               |    2 +-
 net/mac80211/main.c                                |   20 +-
 net/mac80211/mesh.c                                |    2 +-
 net/mac80211/mesh_hwmp.c                           |    7 +-
 net/mac80211/mesh_pathtbl.c                        |   27 +-
 net/mac80211/mesh_plink.c                          |    3 +-
 net/mac80211/mlme.c                                |   30 +-
 net/mac80211/offchannel.c                          |    4 +-
 net/mac80211/rc80211_minstrel_ht.c                 |   62 +-
 net/mac80211/sta_info.h                            |    2 -
 net/mac80211/tx.c                                  |  222 +-
 net/mac80211/util.c                                |  186 +-
 net/mac80211/wep.c                                 |    5 +-
 net/mac80211/work.c                                |   16 +-
 net/mac80211/wpa.c                                 |   25 +-
 net/wireless/core.h                                |   10 +-
 net/wireless/mlme.c                                |   37 +-
 net/wireless/nl80211.c                             |  133 +-
 net/wireless/reg.c                                 |   39 +
 net/wireless/reg.h                                 |    1 +
 net/wireless/sme.c                                 |    7 +-
 net/wireless/util.c                                |  186 +-
 167 files changed, 40220 insertions(+), 39231 deletions(-)
 rename drivers/net/wireless/ath/ath6kl/{htc_hif.c => hif.c} (80%)
 delete mode 100644 drivers/net/wireless/ath/ath6kl/htc_hif.h
 create mode 100644 drivers/net/wireless/iwlegacy/3945-debug.c
 create mode 100644 drivers/net/wireless/iwlegacy/3945-mac.c
 create mode 100644 drivers/net/wireless/iwlegacy/3945-rs.c
 create mode 100644 drivers/net/wireless/iwlegacy/3945.c
 create mode 100644 drivers/net/wireless/iwlegacy/3945.h
 rename drivers/net/wireless/iwlegacy/{iwl-4965-calib.c => 4965-calib.c} (55%)
 create mode 100644 drivers/net/wireless/iwlegacy/4965-debug.c
 create mode 100644 drivers/net/wireless/iwlegacy/4965-mac.c
 create mode 100644 drivers/net/wireless/iwlegacy/4965-rs.c
 create mode 100644 drivers/net/wireless/iwlegacy/4965.c
 create mode 100644 drivers/net/wireless/iwlegacy/4965.h
 rename drivers/net/wireless/iwlegacy/{iwl-commands.h => commands.h} (79%)
 create mode 100644 drivers/net/wireless/iwlegacy/common.c
 create mode 100644 drivers/net/wireless/iwlegacy/common.h
 rename drivers/net/wireless/iwlegacy/{iwl-csr.h => csr.h} (84%)
 create mode 100644 drivers/net/wireless/iwlegacy/debug.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-debugfs.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-debugfs.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-fh.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-hw.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-led.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-led.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945-rs.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-3945.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-calib.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-debugfs.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-debugfs.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-eeprom.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-hw.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-led.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-led.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-lib.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-rs.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-rx.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-sta.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-tx.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-4965.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-core.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-core.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-debug.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-debugfs.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-dev.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-devtrace.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-devtrace.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-eeprom.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-eeprom.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-fh.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-hcmd.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-helpers.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-io.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-led.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-led.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-power.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-power.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-rx.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-scan.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-sta.h
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl-tx.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl3945-base.c
 delete mode 100644 drivers/net/wireless/iwlegacy/iwl4965-base.c
 rename drivers/net/wireless/iwlegacy/{iwl-prph.h => prph.h} (83%)
-- 
John W. Linville		Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH 3/3] xfrm: allow to overwrite incoming dev after decryption
From: Ulrich Weber @ 2011-11-28 20:14 UTC (permalink / raw)
  To: netdev; +Cc: davem
In-Reply-To: <1322511292-1413-1-git-send-email-ulrich.weber@sophos.com>

and flush related xfrm states if interface goes down.

If XFRMA_RECV_DEV is set to an interface index, all decrypted
packets of the associated xfrm state will have the incoming
interface set to that interface.

This allows to create multiple virtual IPsec devices, which
all receive their packets via the same uplink interface.

Xfrm policies can then match against these virtual IPsec
interfaces. Otherwise only one policy could be installed
matching the uplink interface.

Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
---
 include/linux/xfrm.h  |    1 +
 include/net/xfrm.h    |    6 +++++-
 net/key/af_key.c      |    2 +-
 net/xfrm/xfrm_input.c |    5 +++++
 net/xfrm/xfrm_state.c |   44 +++++++++++++++++++++++++++++++++++++++-----
 net/xfrm/xfrm_user.c  |   14 +++++++++++++-
 6 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index bb1bb49..13b04f4 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -295,6 +295,7 @@ enum xfrm_attr_type_t {
 	XFRMA_MARK,		/* struct xfrm_mark */
 	XFRMA_TFCPAD,		/* __u32 */
 	XFRMA_REPLAY_ESN_VAL,	/* struct xfrm_replay_esn */
+	XFRMA_RECV_DEV,		/* __u32 */
 	__XFRMA_MAX
 
 #define XFRMA_MAX (__XFRMA_MAX - 1)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 89174e2..3febf6a 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -226,6 +226,9 @@ struct xfrm_state {
 	/* Security context */
 	struct xfrm_sec_ctx	*security;
 
+	/* Overwrite incoming device */
+	struct net_device	*dev;
+
 	/* Private data of this transformer, format is opaque,
 	 * interpreted by xfrm_type methods. */
 	void			*data;
@@ -1442,7 +1445,8 @@ struct xfrmk_spdinfo {
 extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark,
 					      u32 seq);
 extern int xfrm_state_delete(struct xfrm_state *x);
-extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info);
+extern int xfrm_state_flush(struct net *net, u8 proto, struct net_device *dev,
+			    struct xfrm_audit *audit_info);
 extern void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si);
 extern void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si);
 extern u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index bfc0bef..3bd8075 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1726,7 +1726,7 @@ static int pfkey_flush(struct sock *sk, struct sk_buff *skb, const struct sadb_m
 	audit_info.loginuid = audit_get_loginuid(current);
 	audit_info.sessionid = audit_get_sessionid(current);
 	audit_info.secid = 0;
-	err = xfrm_state_flush(net, proto, &audit_info);
+	err = xfrm_state_flush(net, proto, NULL, &audit_info);
 	err2 = unicast_flush_resp(sk, hdr);
 	if (err || err2) {
 		if (err == -ESRCH) /* empty table - go quietly */
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 54a0dc2..80eb73a 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -239,6 +239,11 @@ resume:
 			goto drop;
 		}
 
+		if (x->dev) {
+			skb->dev = x->dev;
+			skb->skb_iif = skb->dev->ifindex;
+		}
+
 		if (x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) {
 			decaps = 1;
 			break;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 5b228f9..41c6cc5 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -368,6 +368,8 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
 		x->type->destructor(x);
 		xfrm_put_type(x->type);
 	}
+	if (x->dev)
+		dev_put(x->dev);
 	security_xfrm_state_free(x);
 	kfree(x);
 }
@@ -567,7 +569,8 @@ EXPORT_SYMBOL(xfrm_state_delete);
 
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
 static inline int
-xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct xfrm_audit *audit_info)
+xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct net_device *dev,
+			      struct xfrm_audit *audit_info)
 {
 	int i, err = 0;
 
@@ -577,6 +580,7 @@ xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct xfrm_audit *audi
 
 		hlist_for_each_entry(x, entry, net->xfrm.state_bydst+i, bydst) {
 			if (xfrm_id_proto_match(x->id.proto, proto) &&
+			   (!dev || dev == x->dev) &&
 			   (err = security_xfrm_state_delete(x)) != 0) {
 				xfrm_audit_state_delete(x, 0,
 							audit_info->loginuid,
@@ -591,18 +595,20 @@ xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct xfrm_audit *audi
 }
 #else
 static inline int
-xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct xfrm_audit *audit_info)
+xfrm_state_flush_secctx_check(struct net *net, u8 proto, struct net_device *dev,
+			      struct xfrm_audit *audit_info)
 {
 	return 0;
 }
 #endif
 
-int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info)
+int xfrm_state_flush(struct net *net, u8 proto, struct net_device *dev,
+		     struct xfrm_audit *audit_info)
 {
 	int i, err = 0, cnt = 0;
 
 	spin_lock_bh(&xfrm_state_lock);
-	err = xfrm_state_flush_secctx_check(net, proto, audit_info);
+	err = xfrm_state_flush_secctx_check(net, proto, dev, audit_info);
 	if (err)
 		goto out;
 
@@ -613,6 +619,7 @@ int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info)
 restart:
 		hlist_for_each_entry(x, entry, net->xfrm.state_bydst+i, bydst) {
 			if (!xfrm_state_kern(x) &&
+			    (!dev || x->dev == dev) &&
 			    xfrm_id_proto_match(x->id.proto, proto)) {
 				xfrm_state_hold(x);
 				spin_unlock_bh(&xfrm_state_lock);
@@ -1185,6 +1192,11 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
 
 	memcpy(&x->mark, &orig->mark, sizeof(x->mark));
 
+	if (orig->dev) {
+		dev_hold(dev);
+		x->dev = orig->dev;
+	}
+
 	err = xfrm_init_state(x);
 	if (err)
 		goto error;
@@ -2005,6 +2017,26 @@ int xfrm_init_state(struct xfrm_state *x)
 
 EXPORT_SYMBOL(xfrm_init_state);
 
+
+static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+	struct net_device *dev = ptr;
+	struct xfrm_audit audit_info;
+
+	switch (event) {
+	case NETDEV_DOWN:
+		audit_info.loginuid = -1;
+		audit_info.sessionid = -1;
+		audit_info.secid = 0;
+		xfrm_state_flush(dev_net(dev), IPSEC_PROTO_ANY, dev, &audit_info);
+	}
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block xfrm_dev_notifier = {
+	.notifier_call	= xfrm_dev_event,
+};
+
 int __net_init xfrm_state_init(struct net *net)
 {
 	unsigned int sz;
@@ -2029,6 +2061,8 @@ int __net_init xfrm_state_init(struct net *net)
 	INIT_HLIST_HEAD(&net->xfrm.state_gc_list);
 	INIT_WORK(&net->xfrm.state_gc_work, xfrm_state_gc_task);
 	init_waitqueue_head(&net->xfrm.km_waitq);
+	if (net_eq(net, &init_net))
+		register_netdevice_notifier(&xfrm_dev_notifier);
 	return 0;
 
 out_byspi:
@@ -2048,7 +2082,7 @@ void xfrm_state_fini(struct net *net)
 	audit_info.loginuid = -1;
 	audit_info.sessionid = -1;
 	audit_info.secid = 0;
-	xfrm_state_flush(net, IPSEC_PROTO_ANY, &audit_info);
+	xfrm_state_flush(net, IPSEC_PROTO_ANY, NULL, &audit_info);
 	flush_work(&net->xfrm.state_gc_work);
 
 	WARN_ON(!list_empty(&net->xfrm.state_all));
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index d0a42df..46bd7ad 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -532,6 +532,12 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
 			goto error;
 	}
 
+	if (attrs[XFRMA_RECV_DEV]) {
+		x->dev = dev_get_by_index(net, *(int *) nla_data(attrs[XFRMA_RECV_DEV]));
+		if (x->dev == NULL)
+			goto error;
+	}
+
 	xfrm_mark_get(attrs, &x->mark);
 
 	err = __xfrm_init_state(x, false);
@@ -762,6 +768,9 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
 	if (x->lastused)
 		NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused);
 
+	if (x->dev)
+		NLA_PUT_U32(skb, XFRMA_RECV_DEV, x->dev->ifindex);
+
 	if (x->aead)
 		NLA_PUT(skb, XFRMA_ALG_AEAD, aead_len(x->aead), x->aead);
 	if (x->aalg) {
@@ -1642,7 +1651,7 @@ static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	audit_info.loginuid = audit_get_loginuid(current);
 	audit_info.sessionid = audit_get_sessionid(current);
 	security_task_getsecid(current, &audit_info.secid);
-	err = xfrm_state_flush(net, p->proto, &audit_info);
+	err = xfrm_state_flush(net, p->proto, NULL, &audit_info);
 	if (err) {
 		if (err == -ESRCH) /* empty table */
 			return 0;
@@ -2243,6 +2252,7 @@ static const struct nla_policy xfrma_policy[XFRMA_MAX+1] = {
 	[XFRMA_MARK]		= { .len = sizeof(struct xfrm_mark) },
 	[XFRMA_TFCPAD]		= { .type = NLA_U32 },
 	[XFRMA_REPLAY_ESN_VAL]	= { .len = sizeof(struct xfrm_replay_state_esn) },
+	[XFRMA_RECV_DEV]	= { .type = NLA_U32 },
 };
 
 static struct xfrm_link {
@@ -2432,6 +2442,8 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
 				    x->security->ctx_len);
 	if (x->coaddr)
 		l += nla_total_size(sizeof(*x->coaddr));
+	if (x->dev)
+		l += nla_total_size(sizeof(u32));
 
 	/* Must count x->lastused as it may become non-zero behind our back. */
 	l += nla_total_size(sizeof(u64));
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 0/3] xfrm: add incoming interface to selector
From: Ulrich Weber @ 2011-11-28 20:14 UTC (permalink / raw)
  To: netdev; +Cc: davem

Current implementation allows to match IPsec policies based
on the outgoing interface. This however is kind of broken:
 a) decode_session will not fill oif and is therefore always set to zero and
    will never match (see patch #2).
 b) its not possible to match the incoming interface. This makes it impossible,
    to create redundant IPsec tunnels over two uplink interfaces.

Over a year ago there was a discussion about adding the incoming interface to
the xfrm selector. See the following thread for more details:
http://kerneltrap.org/mailarchive/linux-netdev/2010/3/31/6273708


The first patch will reuse the user attribute in the xfrm selector as
incoming interface. Yes, this breaks the ABI. But user in xfrm selector was
never used and user space programs set it to zero. The alternative would
be to have different xfrm_selector structs in kernel and user space.

Second patch makes matching outgoing and incoming interfaces operational by
setting oif and iif in flowi struct. Local generated packets will have iif
set to loopback interface.

Third patch allows to override the incoming interface of decrypted packets.
This allows to create virtual IPsec devices for redundant IPsec tunnels, when
only one Internet uplink is available (e.g. used by Amazon VPC Connector).

Ulrich Weber (3):
  xfrm: add incoming interface to selector
  route: set iif and oif information in flowi struct
  xfrm: allow to overwrite incoming dev after decryption

 include/linux/xfrm.h    |    5 +++--
 include/net/xfrm.h      |    6 +++++-
 net/ipv4/route.c        |    4 ++++
 net/ipv4/xfrm4_policy.c |   19 +++++++++++++++++--
 net/ipv4/xfrm4_state.c  |    3 ++-
 net/ipv6/fib6_rules.c   |   10 ++++++++--
 net/ipv6/mip6.c         |    3 ++-
 net/ipv6/xfrm6_policy.c |   18 ++++++++++++++++--
 net/ipv6/xfrm6_state.c  |    3 ++-
 net/key/af_key.c        |    2 +-
 net/xfrm/xfrm_input.c   |    5 +++++
 net/xfrm/xfrm_policy.c  |    6 ++++--
 net/xfrm/xfrm_state.c   |   44 +++++++++++++++++++++++++++++++++++++++-----
 net/xfrm/xfrm_user.c    |   14 +++++++++++++-
 14 files changed, 121 insertions(+), 21 deletions(-)

-- 
1.7.4.1

^ permalink raw reply

* [PATCH 1/1] netstamp_needed shouldn't be jump_label_key
From: igorm @ 2011-11-28 20:23 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, Igor Maravic
In-Reply-To: <1322511796-6908-1-git-send-email-igorm@etf.rs>

From: Igor Maravic <igorm@etf.rs>

Problem with setting netstamp_needed as jump_label_key is that
it inc/dec, functions net_enable_timestamp/net_disable_timestamp,
are called from interrupts.

That can cause DEADLOCK, because jump_label_{inc, dec} are using mutex locking,
that may sleep.

Signed-off-by: Igor Maravic <igorm@etf.rs>

:100644 100644 d1f1071... 4d88cac... M	net/core/dev.c

diff --git a/net/core/dev.c b/net/core/dev.c
index d1f1071..4d88cac 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1442,29 +1442,29 @@ int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
 }
 EXPORT_SYMBOL(call_netdevice_notifiers);
 
-static struct jump_label_key netstamp_needed __read_mostly;
+static atomic_t netstamp_needed = ATOMIC_INIT(0);
 
 void net_enable_timestamp(void)
 {
-	jump_label_inc(&netstamp_needed);
+	atomic_inc(&netstamp_needed);
 }
 EXPORT_SYMBOL(net_enable_timestamp);
 
 void net_disable_timestamp(void)
 {
-	jump_label_dec(&netstamp_needed);
+	atomic_dec(&netstamp_needed);
 }
 EXPORT_SYMBOL(net_disable_timestamp);
 
 static inline void net_timestamp_set(struct sk_buff *skb)
 {
 	skb->tstamp.tv64 = 0;
-	if (static_branch(&netstamp_needed))
+	if (atomic_read(&netstamp_needed))
 		__net_timestamp(skb);
 }
 
 #define net_timestamp_check(COND, SKB)			\
-	if (static_branch(&netstamp_needed)) {		\
+	if (atomic_read(&netstamp_needed)) {		\
 		if ((COND) && !(SKB)->tstamp.tv64)	\
 			__net_timestamp(SKB);		\
 	}						\
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 0/1] jump_label logic fixing in dev.c
From: igorm @ 2011-11-28 20:23 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, Igor Maravic

From: Igor Maravic <igorm@etf.rs>

Hi all,
I had the problem with this specific patch:
http://git.kernel.org/?p=linux/kernel/git/davem/net-next.git;a=commitdiff;h=588f033075d8c7efe28695402114eab3f9da47c4;hp=66846048f55c6c05a4c46c2daabb773173f8f28d
Problem was occurring when I would ping unreachable host and then, after some while,
I would type Ctrl+C. This is the Call Trace:

------------
Nov 25 14:34:41 igortest kernel: [  102.264227] BUG: sleeping function called from invalid context at kernel/mutex.c:271
Nov 25 14:34:41 igortest kernel: [  102.264273] in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
Nov 25 14:34:41 igortest kernel: [  102.264305] 1 lock held by swapper/0:
Nov 25 14:34:41 igortest kernel: [  102.264307]  #0:  (&n->timer){+.-...}, at: [<ffffffff8107ce90>] call_timer_fn+0x0/0x340
Nov 25 14:34:41 igortest kernel: [  102.264318] Pid: 0, comm: swapper Not tainted 3.2.0-rc2-net-next-mpls+ #1
Nov 25 14:34:41 igortest kernel: [  102.264320] Call Trace:
Nov 25 14:34:41 igortest kernel: [  102.264321]  <IRQ>  [<ffffffff8104f417>] __might_sleep+0x137/0x1f0
Nov 25 14:34:41 igortest kernel: [  102.264330]  [<ffffffff816b9a2f>] mutex_lock_nested+0x2f/0x370
Nov 25 14:34:41 igortest kernel: [  102.264334]  [<ffffffff810a89fd>] ? trace_hardirqs_off+0xd/0x10
Nov 25 14:34:41 igortest kernel: [  102.264337]  [<ffffffff8109a37f>] ? local_clock+0x6f/0x80
Nov 25 14:34:41 igortest kernel: [  102.264340]  [<ffffffff810a90a5>] ? lock_release_holdtime.part.22+0x15/0x1a0
Nov 25 14:34:41 igortest kernel: [  102.264344]  [<ffffffff81557929>] ? sock_def_write_space+0x59/0x160
Nov 25 14:34:41 igortest kernel: [  102.264347]  [<ffffffff815e936e>] ? arp_error_report+0x3e/0x90
Nov 25 14:34:41 igortest kernel: [  102.264350]  [<ffffffff810969cd>] atomic_dec_and_mutex_lock+0x5d/0x80
Nov 25 14:34:41 igortest kernel: [  102.264354]  [<ffffffff8112fc1d>] jump_label_dec+0x1d/0x50
Nov 25 14:34:41 igortest kernel: [  102.264357]  [<ffffffff81566525>] net_disable_timestamp+0x15/0x20
Nov 25 14:34:41 igortest kernel: [  102.264360]  [<ffffffff81557a75>] sock_disable_timestamp+0x45/0x50
Nov 25 14:34:41 igortest kernel: [  102.264362]  [<ffffffff81557b00>] __sk_free+0x80/0x200
Nov 25 14:34:41 igortest kernel: [  102.264365]  [<ffffffff815578d0>] ? sk_send_sigurg+0x70/0x70
Nov 25 14:34:42 igortest kernel: [  102.264367]  [<ffffffff815e936e>] ? arp_error_report+0x3e/0x90
Nov 25 14:34:42 igortest kernel: [  102.264370]  [<ffffffff81557cba>] sock_wfree+0x3a/0x70
Nov 25 14:34:42 igortest kernel: [  102.264373]  [<ffffffff8155c2b0>] skb_release_head_state+0x70/0x120
Nov 25 14:34:42 igortest kernel: [  102.264376]  [<ffffffff8155c0b6>] __kfree_skb+0x16/0x30
Nov 25 14:34:42 igortest kernel: [  102.264378]  [<ffffffff8155c119>] kfree_skb+0x49/0x170
Nov 25 14:34:42 igortest kernel: [  102.264381]  [<ffffffff815e936e>] arp_error_report+0x3e/0x90
Nov 25 14:34:42 igortest kernel: [  102.264384]  [<ffffffff81575bd9>] neigh_invalidate+0x89/0xc0
Nov 25 14:34:42 igortest kernel: [  102.264387]  [<ffffffff81578dbe>] neigh_timer_handler+0x9e/0x2a0
Nov 25 14:34:42 igortest kernel: [  102.264389]  [<ffffffff81578d20>] ? neigh_update+0x640/0x640
Nov 25 14:34:42 igortest kernel: [  102.264406]  [<ffffffff81073558>] __do_softirq+0xc8/0x3a0
Nov 25 14:34:42 igortest kernel: [  102.264409]  [<ffffffff810a4864>] ? clockevents_program_event+0x74/0x100
Nov 25 14:34:42 igortest kernel: [  102.264411]  [<ffffffff810a5f34>] ? tick_program_event+0x24/0x30
Nov 25 14:34:42 igortest kernel: [  102.264415]  [<ffffffff816c6ffc>] call_softirq+0x1c/0x30
Nov 25 14:34:42 igortest kernel: [  102.264418]  [<ffffffff8101b615>] do_softirq+0xa5/0xe0
Nov 25 14:34:42 igortest kernel: [  102.264420]  [<ffffffff81073bbe>] irq_exit+0xae/0xe0
Nov 25 14:34:42 igortest kernel: [  102.264423]  [<ffffffff816c72de>] smp_apic_timer_interrupt+0x6e/0x99
Nov 25 14:34:42 igortest kernel: [  102.264426]  [<ffffffff816c6473>] apic_timer_interrupt+0x73/0x80
Nov 25 14:34:42 igortest kernel: [  102.264427]  <EOI>  [<ffffffff816c0c20>] ? notifier_call_chain+0x100/0x100
Nov 25 14:34:42 igortest kernel: [  102.264433]  [<ffffffff810400ab>] ? native_safe_halt+0xb/0x10
Nov 25 14:34:42 igortest kernel: [  102.264436]  [<ffffffff810ac86d>] ? trace_hardirqs_on+0xd/0x10
Nov 25 14:34:42 igortest kernel: [  102.264439]  [<ffffffff8102202a>] default_idle+0x4a/0x290
Nov 25 14:34:42 igortest kernel: [  102.264441]  [<ffffffff81022338>] amd_e400_idle+0xc8/0x160
Nov 25 14:34:42 igortest kernel: [  102.264444]  [<ffffffff81018239>] cpu_idle+0xe9/0x150
Nov 25 14:34:42 igortest kernel: [  102.264447]  [<ffffffff81684cce>] rest_init+0xd2/0xe4
Nov 25 14:34:42 igortest kernel: [  102.264450]  [<ffffffff81684bfc>] ? csum_partial_copy_generic+0x16c/0x16c
Nov 25 14:34:42 igortest kernel: [  102.264453]  [<ffffffff81eb5c69>] start_kernel+0x3fb/0x407
Nov 25 14:34:42 igortest kernel: [  102.264456]  [<ffffffff81eb5388>] x86_64_start_reservations+0x132/0x136
Nov 25 14:34:42 igortest kernel: [  102.264459]  [<ffffffff81eb5140>] ? early_idt_handlers+0x140/0x140
Nov 25 14:34:42 igortest kernel: [  102.264461]  [<ffffffff81eb5459>] x86_64_start_kernel+0xcd/0xdc
Nov 25 14:34:42 igortest kernel: [  102.264470]
Nov 25 14:34:42 igortest kernel: [  102.264479] =================================
Nov 25 14:34:42 igortest kernel: [  102.264501] [ INFO: inconsistent lock state ]
Nov 25 14:34:42 igortest kernel: [  102.264523] 3.2.0-rc2-net-next-mpls+ #1
Nov 25 14:34:42 igortest kernel: [  102.264542] ---------------------------------
Nov 25 14:34:42 igortest kernel: [  102.264564] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
Nov 25 14:34:42 igortest kernel: [  102.264594] swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
Nov 25 14:34:42 igortest kernel: [  102.264618]  (jump_label_mutex){+.?.+.}, at: [<ffffffff810969cd>] atomic_dec_and_mutex_lock+0x5d/0x80
Nov 25 14:34:42 igortest kernel: [  102.265911] {SOFTIRQ-ON-W} state was registered at:
Nov 25 14:34:42 igortest kernel: [  102.267182]   [<ffffffff810ac44f>] mark_irqflags+0x15f/0x1c0
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff810ae81b>] __lock_acquire+0x5cb/0xb40
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff810af48a>] lock_acquire+0xaa/0x200
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff816b9a78>] mutex_lock_nested+0x78/0x370
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff8112fa67>] jump_label_lock+0x17/0x20
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff8112fb25>] jump_label_module_notify+0x95/0xe0
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff816c0bb3>] notifier_call_chain+0x93/0x100
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff81099d28>] __blocking_notifier_call_chain+0x78/0xb0
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff81099d76>] blocking_notifier_call_chain+0x16/0x20
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff810be911>] sys_init_module+0x71/0x230
Nov 25 14:34:42 igortest kernel: [  102.268082]   [<ffffffff816c5902>] system_call_fastpath+0x16/0x1b
Nov 25 14:34:42 igortest kernel: [  102.268082] irq event stamp: 356072
Nov 25 14:34:42 igortest kernel: [  102.268082] hardirqs last  enabled at (356072): [<ffffffff81072dc7>] local_bh_enable_ip+0x97/0x100
Nov 25 14:34:42 igortest kernel: [  102.268082] hardirqs last disabled at (356071): [<ffffffff81072d74>] local_bh_enable_ip+0x44/0x100
Nov 25 14:34:42 igortest kernel: [  102.268082] softirqs last  enabled at (355994): [<ffffffff81072263>] _local_bh_enable+0x13/0x20
Nov 25 14:34:42 igortest kernel: [  102.268082] softirqs last disabled at (355995): [<ffffffff816c6ffc>] call_softirq+0x1c/0x30
Nov 25 14:34:42 igortest kernel: [  102.268082]
Nov 25 14:34:42 igortest kernel: [  102.268082] other info that might help us debug this:
Nov 25 14:34:42 igortest kernel: [  102.268082]  Possible unsafe locking scenario:
Nov 25 14:34:42 igortest kernel: [  102.268082]
Nov 25 14:34:42 igortest kernel: [  102.268082]        CPU0
Nov 25 14:34:42 igortest kernel: [  102.268082]        ----
Nov 25 14:34:42 igortest kernel: [  102.268082]   lock(jump_label_mutex);
Nov 25 14:34:42 igortest kernel: [  102.268082]   <Interrupt>
Nov 25 14:34:42 igortest kernel: [  102.268082]     lock(jump_label_mutex);
Nov 25 14:34:42 igortest kernel: [  102.268082]
Nov 25 14:34:42 igortest kernel: [  102.268082]  *** DEADLOCK ***
Nov 25 14:34:42 igortest kernel: [  102.268082]
Nov 25 14:34:42 igortest kernel: [  102.268082] 1 lock held by swapper/0:
Nov 25 14:34:42 igortest kernel: [  102.268082]  #0:  (&n->timer){+.-...}, at: [<ffffffff8107ce90>] call_timer_fn+0x0/0x340
Nov 25 14:34:42 igortest kernel: [  102.268082]
Nov 25 14:34:42 igortest kernel: [  102.268082] stack backtrace:
Nov 25 14:34:42 igortest kernel: [  102.268082] Pid: 0, comm: swapper Not tainted 3.2.0-rc2-net-next-mpls+ #1
Nov 25 14:34:42 igortest kernel: [  102.268082] Call Trace:
Nov 25 14:34:42 igortest kernel: [  102.268082]  <IRQ>  [<ffffffff816a3725>] print_usage_bug+0x164/0x175
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810aa520>] ? print_irq_inversion_bug.part.33+0x1f0/0x1f0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff816a37a2>] mark_lock_irq+0x6c/0x137
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810ac225>] mark_lock+0x125/0x1f0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810ac409>] mark_irqflags+0x119/0x1c0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810ae81b>] __lock_acquire+0x5cb/0xb40
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810af48a>] lock_acquire+0xaa/0x200
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810969cd>] ? atomic_dec_and_mutex_lock+0x5d/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8169f6b2>] ? dump_stack+0x77/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff816b9a78>] mutex_lock_nested+0x78/0x370
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810969cd>] ? atomic_dec_and_mutex_lock+0x5d/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810a89fd>] ? trace_hardirqs_off+0xd/0x10
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8109a37f>] ? local_clock+0x6f/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810969cd>] ? atomic_dec_and_mutex_lock+0x5d/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810a90a5>] ? lock_release_holdtime.part.22+0x15/0x1a0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81557929>] ? sock_def_write_space+0x59/0x160
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff815e936e>] ? arp_error_report+0x3e/0x90
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810969cd>] atomic_dec_and_mutex_lock+0x5d/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8112fc1d>] jump_label_dec+0x1d/0x50
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81566525>] net_disable_timestamp+0x15/0x20
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81557a75>] sock_disable_timestamp+0x45/0x50
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81557b00>] __sk_free+0x80/0x200
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff815578d0>] ? sk_send_sigurg+0x70/0x70
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff815e936e>] ? arp_error_report+0x3e/0x90
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81557cba>] sock_wfree+0x3a/0x70
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8155c2b0>] skb_release_head_state+0x70/0x120
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8155c0b6>] __kfree_skb+0x16/0x30
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8155c119>] kfree_skb+0x49/0x170
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff815e936e>] arp_error_report+0x3e/0x90
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81575bd9>] neigh_invalidate+0x89/0xc0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81578dbe>] neigh_timer_handler+0x9e/0x2a0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81578d20>] ? neigh_update+0x640/0x640
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8107cf1a>] call_timer_fn+0x8a/0x340
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8107ce90>] ? init_timer_deferrable_key+0x30/0x30
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8107d309>] run_timer_softirq+0x139/0x300
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81073511>] ? __do_softirq+0x81/0x3a0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81578d20>] ? neigh_update+0x640/0x640
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81073558>] __do_softirq+0xc8/0x3a0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810a4864>] ? clockevents_program_event+0x74/0x100
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810a5f34>] ? tick_program_event+0x24/0x30
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff816c6ffc>] call_softirq+0x1c/0x30
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8101b615>] do_softirq+0xa5/0xe0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81073bbe>] irq_exit+0xae/0xe0
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff816c72de>] smp_apic_timer_interrupt+0x6e/0x99
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff816c6473>] apic_timer_interrupt+0x73/0x80
Nov 25 14:34:42 igortest kernel: [  102.268082]  <EOI>  [<ffffffff816c0c20>] ? notifier_call_chain+0x100/0x100
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810400ab>] ? native_safe_halt+0xb/0x10
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff810ac86d>] ? trace_hardirqs_on+0xd/0x10
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff8102202a>] default_idle+0x4a/0x290
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81022338>] amd_e400_idle+0xc8/0x160
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81018239>] cpu_idle+0xe9/0x150
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81684cce>] rest_init+0xd2/0xe4
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81684bfc>] ? csum_partial_copy_generic+0x16c/0x16c
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81eb5c69>] start_kernel+0x3fb/0x407
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81eb5388>] x86_64_start_reservations+0x132/0x136
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81eb5140>] ? early_idt_handlers+0x140/0x140
Nov 25 14:34:42 igortest kernel: [  102.268082]  [<ffffffff81eb5459>] x86_64_start_kernel+0xcd/0xdc
------------------
Problem was calling net_disable_timestamp from Interrupt. By reverting netstamp_needed from jump_label_key 
to atomic_t I solved the problem. 
BR
Igor

Igor Maravic (1):
  netstamp_needed shouldn't be jump_label_key

 net/core/dev.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

-- 
1.7.5.4

^ permalink raw reply

* Re: [RFC PATCH 00/18] netfilter: IPv6 NAT
From: Ulrich Weber @ 2011-11-28 20:25 UTC (permalink / raw)
  To: sclark46@earthlink.net, kaber@trash.net
  Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <4ED3C174.9030302@earthlink.net>

Am 28.11.11 18:14 schrieb "Stephen Clark" unter <sclark46@earthlink.net>:
 
>Probabably a dumb question but are these patches for natting ipv6 to
>ipv6 or ipv4 to ipv6?

These patches are for natting IPv6 addresses behind whole IPv6 subnets
or just behind one IPv6 address.

This is useful for multiple Internet uplinks, where you want full control
on the router what connections are sent over which interface. Or its quite
easy to setup Load Balancing rules or create a DMZ. There a lots of use
casesŠ


If you are looking for IPv4->IPv6 or IPv6->IPv4, there are multiple
implementations. Two examples:

IPv6->IPv4:

http://ecdysis.viagenie.ca

IPv4->IPv6:
http://www.ivi2.org


Best regards
 Ulrich

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

^ permalink raw reply


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