Netdev List
 help / color / mirror / Atom feed
* [PATCH] hamradio: Resolve memory leak due to missing firmware release in add_mcs()
From: Jesper Juhl @ 2011-01-06 20:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: netdev, linux-hams, Jean-Paul Roubelat, Frederic Rible,
	Thomas Sailer


Failure to release_firmware() in drivers/net/hamradio/yam.c::add_mcs() 
causes memory leak.
This patch should fix it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 yam.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

  compile tested only

diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 4e7d1d0..7d9ced0 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -396,7 +396,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
 	while (p) {
 		if (p->bitrate == bitrate) {
 			memcpy(p->bits, bits, YAM_FPGA_SIZE);
-			return p->bits;
+			goto out;
 		}
 		p = p->next;
 	}
@@ -411,7 +411,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
 	p->bitrate = bitrate;
 	p->next = yam_data;
 	yam_data = p;
-
+ out:
 	release_firmware(fw);
 	return p->bits;
 }


-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.


^ permalink raw reply related

* Re: via-velocity: corrupted mac, deadlock on link
From: Stephen Hemminger @ 2011-01-06 20:58 UTC (permalink / raw)
  To: Janne Karhunen; +Cc: netdev
In-Reply-To: <AANLkTi=SV=_s3ViveEX4e2FpEGKK+w6BiGs=QYCsgPsv@mail.gmail.com>

On Thu, 6 Jan 2011 13:42:03 +0200
Janne Karhunen <janne.karhunen@gmail.com> wrote:

> Hey,
> 
> Just got my hands on via-velocity pci-e card and tried to give it
> a go on new Asus Nvidia Ion2 board. Driver loads fine and everything
> seems good until device gets a link - kernel deadlocks instantly. During
> bootup hang seems to happen when persistent-net rules rename device
> to eth1, after bootup instantly when cable is plugged (first interrupt?).
> 
> Any other quick suggestions other than to throw it away as DOA?
> 
> Linux rivendell 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24 10:18:49
> UTC 2010 i686 GNU/Linux
> 
> eth1      Link encap:Ethernet  HWaddr 00:00:00:00:00:04  (??????????)
> 
> [    1.171890] eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter
> [   18.468029] via-velocity 0000:0b:00.0: BAR 0: set to [io
> 0xe800-0xe8ff] (PCI address [0xe800-0xe8ff]
> [   18.468048] via-velocity 0000:0b:00.0: BAR 1: set to [mem
> 0xfbfffc00-0xfbfffcff 64bit] (PCI address [0xfbfffc00-0xfbfffcff]
> 
> 0b:00.0 Ethernet controller: VIA Technologies, Inc.
> VT6120/VT6121/VT6122 Gigabit Ethernet Adapter (rev 82)
> 
>  16:          0          0          0          0   IO-APIC-fasteoi
> uhci_hcd:usb5
>  17:          0          0          0          0   IO-APIC-fasteoi   eth1
>  18:       4639       4703       4637       4690   IO-APIC-fasteoi
> uhci_hcd:usb4, ahci, hda_intel, nvidia
>  19:          0          0          0          1   IO-APIC-fasteoi
> uhci_hcd:usb3, xhci_hcd:usb6
>  23:      14772      14895      14872      14730   IO-APIC-fasteoi
> ehci_hcd:usb1, uhci_hcd:usb2
>  40:          0          0          0          0   PCI-MSI-edge      pciehp
>  41:          0          0          0          0   PCI-MSI-edge      pciehp
>  42:          0          0          0          0   PCI-MSI-edge      pciehp
>  43:          0          0          0          0   PCI-MSI-edge      pciehp
>  52:      10951      10844      10829      10926   PCI-MSI-edge      eth0

To debug, remove the udev rule that does renaming
  cd /lib/udev
  mkdir save; mv rules.d/75-persistent-net-generator-rules save
and remove any rules
  rm /etc/udev/70-persistent-net.rules

Then after bootup you can debug problem.

^ permalink raw reply

* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Jesse Gross @ 2011-01-06 21:01 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Matt Carlson, Michael Leun, Michael Chan, David Miller,
	Ben Greear, linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <1293984348.2535.101.camel@edumazet-laptop>

On Sun, Jan 2, 2011 at 11:05 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le samedi 01 janvier 2011 à 19:27 -0500, Jesse Gross a écrit :
>> On Sat, Jan 1, 2011 at 12:03 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> > Le mardi 14 décembre 2010 à 11:15 -0800, Matt Carlson a écrit :
>> >
>> >> Thanks for the comments Jesse.  Below is an updated patch.
>> >>
>> >> Michael, I'm wondering if the difference in behavior can be explained by
>> >> the presence or absence of management firmware.  Can you look at the
>> >> driver sign-on messages in your syslogs for ASF[]?  I'm half expecting
>> >> the 5752 to show "ASF[0]" and the 5714 to show "ASF[1]".  If you see
>> >> this, and the below patch doesn't fix the problem, let me know.  I have
>> >> another test I'd like you to run.
>> >>
>> >> ----
>> >>
>> >> [PATCH] tg3: Use new VLAN code
>> >>
>> >> This patch pivots the tg3 driver to the new VLAN infrastructure.
>> >> All references to vlgrp have been removed and all VLAN code is
>> >> unconditionally active.
>> >>
>> >> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
>>
>> [...]
>>
>> > Hi Matt.
>> >
>> > Any news on this patch ?
>> >
>> > Without it, net-next-2.6 doesnt work for me on a vlan setup on top of
>> > bonding.
>> >
>> > (bond0 : eth1 & eth2, eth1 being bnx2, eth2 beging tg3)
>> >
>> > ip link add link bond0 vlan.103 type vlan id 103
>> > ip addr add 192.168.20.110/24 dev vlan.103
>> > ip link set vlan.103 up
>> >
>> >
>> > If active slave is eth1 (bnx2), everything works, but if active slave is
>> > eth2 (tg3), incoming tagged frames (on vlan 103) are lost.
>>
>> This patch isn't quite right - it always disables vlan stripping
>> unless management firmware is in use, so it's not really a correct
>> fix.
>>
>> You said that this used to work correctly on this NIC?  Does it work
>> without a bond, just a vlan on the tg3 device?  It sounds like Michael
>> has a problem with vlan stripping on one of his NICs but if it works
>> with just a vlan or on older kernels, it's probably not the same
>> thing.
>>
>
> 1) current linux-2.6 works OK for me (and previous versions as well, I
> am using this vlan/bonding setup since 3 years or so on one of my dev
> machine)
>
> Only net-next-2.6 has the problem.
>
> If I remove bonding of the equation, I still have the problem, and can
> see the 'dropped' counter increasing while I send packets to eth2 (tg3)
>
> $ ifconfig eth2
> eth2      Link encap:Ethernet  HWaddr 00:1E:0B:92:78:50
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:94 errors:0 dropped:38686 overruns:0 frame:0
>          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:8332 (8.1 Kb)  TX bytes:1392 (1.3 Kb)
>          Interrupt:19
> $ ifconfig vlan.103
> vlan.103  Link encap:Ethernet  HWaddr 00:1E:0B:92:78:50
>          inet addr:192.168.20.110  Bcast:0.0.0.0  Mask:255.255.255.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:0 (0.0 b)  TX bytes:846 (846.0 b)

Hmm, I thought that it might be some interaction with a corner case in
the networking core but now it seems less likely.  There weren't too
many vlan changes between the working and non-working states.  Plus,
since the rx counter isn't increasing, the packets probably aren't
making it anywhere.

I see that tg3 increases the drop counter in one place, which also
happens to be checking for vlan errors (at tg3.c:4753).  That seems
suspicious - maybe the NIC is only partially configured for vlan
offloading.  If we can confirm that is where the drop counter is being
incremented and what the error code is maybe it would shed some light.

If it's a driver issue I don't have much insight - maybe Matt or
bisect can help.

>> If it works on bnx2, it would seem to be a driver problem but it would
>> be good to confirm that the tag in skb->vlan_tci is not being
>> delievered to the networking core in this case.
>
> Hmm, where do you want me to check this ?

I was thinking right before vlan_gro_receive() at tg3.c:4837.  If my
theory above is right then this obviously isn't relevant since it
won't be hit at all.  Otherwise it would be good to know exactly what
the driver is producing.

^ permalink raw reply

* Re: [PATCH V8 12/13] ptp: Added a clock driver for the IXP46x.
From: Krzysztof Halasa @ 2011-01-06 21:01 UTC (permalink / raw)
  To: Richard Cochran
  Cc: linux-kernel, linux-api, netdev, Alan Cox, Arnd Bergmann,
	Christoph Lameter, David Miller, John Stultz, Peter Zijlstra,
	Rodolfo Giometti, Thomas Gleixner
In-Reply-To: <8151196c018776704df34748f333bdb159497d0b.1293820862.git.richard.cochran@omicron.at>

Richard Cochran <richardcochran@gmail.com> writes:

> +struct ixp46x_channel_ctl {
> +	u32 Ch_Control; /* 0x40 Time Synchronization Channel Control */
> +	u32 Ch_Event;   /* 0x44 Time Synchronization Channel Event */
> +	u32 TxSnapLo;   /* 0x48 Transmit Snapshot Low Register */
> +	u32 TxSnapHi;   /* 0x4C Transmit Snapshot High Register */
> +	u32 RxSnapLo;   /* 0x50 Receive Snapshot Low Register */
> +	u32 RxSnapHi;   /* 0x54 Receive Snapshot High Register */
> +	u32 SrcUUIDLo;  /* 0x58 Source UUID0 Low Register */
> +	u32 SrcUUIDHi;  /* 0x5C Sequence Identifier/Source UUID0 High */

I don't like these XxxYyyZzz either :-(

> +static void do_tx_timestamp(struct port *port, struct sk_buff *skb)
> +{
> +#ifdef __ARMEB__
> +	struct skb_shared_hwtstamps shhwtstamps;
> +	struct ixp46x_ts_regs *regs;
> +	struct skb_shared_info *shtx;
> +	u64 ns;
> +	u32 ch, cnt, hi, lo, val;
> +
> +	shtx = skb_shinfo(skb);
> +	if (unlikely(shtx->tx_flags & SKBTX_HW_TSTAMP && port->hwts_tx_en))
> +		shtx->tx_flags |= SKBTX_IN_PROGRESS;
> +	else
> +		return;
> +
> +	ch = PORT2CHANNEL(port);
> +
> +	regs = (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT;
> +
> +	/*
> +	 * This really stinks, but we have to poll for the Tx time stamp.
> +	 * Usually, the time stamp is ready after 4 to 6 microseconds.
> +	 */
> +	for (cnt = 0; cnt < 100; cnt++) {
> +		val = __raw_readl(&regs->channel[ch].Ch_Event);
> +		if (val & TX_SNAPSHOT_LOCKED)
> +			break;
> +		udelay(1);
> +	}
> +	if (!(val & TX_SNAPSHOT_LOCKED)) {
> +		shtx->tx_flags &= ~SKBTX_IN_PROGRESS;
> +		return;
> +	}
> +
> +	lo = __raw_readl(&regs->channel[ch].TxSnapLo);
> +	hi = __raw_readl(&regs->channel[ch].TxSnapHi);
> +	ns = ((u64) hi) << 32;
> +	ns |= lo;
> +	ns <<= TICKS_NS_SHIFT;
> +
> +	memset(&shhwtstamps, 0, sizeof(shhwtstamps));
> +	shhwtstamps.hwtstamp = ns_to_ktime(ns);
> +	skb_tstamp_tx(skb, &shhwtstamps);
> +
> +	__raw_writel(TX_SNAPSHOT_LOCKED, &regs->channel[ch].Ch_Event);
> +#endif
> +}

And what if we're little-endian? Why does it depend on BE?

> @@ -1171,6 +1357,11 @@ static int __devinit eth_init_one(struct platform_device *pdev)
>  	char phy_id[MII_BUS_ID_SIZE + 3];
>  	int err;
>  
> +	if (ptp_filter_init(ptp_filter, ARRAY_SIZE(ptp_filter))) {
> +		pr_err("ixp4xx_eth: bad ptp filter\n");
> +		return -EINVAL;
> +	}
> +
>  	if (!(dev = alloc_etherdev(sizeof(struct port))))
>  		return -ENOMEM;

Shouldn't it depend on CPU type?
BTW which CPU is required? IXP46x (455/460/465)? Does it work on 43x?

> +	if (NO_IRQ == irq)
> +		return NO_IRQ;

Don't like these either :-(
Not showstoppers but...

Also I don't like the ixp_read/ixp_write() trivial macros. Why not
simply call __raw_readl() and __raw_writel()?
-- 
Krzysztof Halasa

^ permalink raw reply

* [PATCH] Madge Ambassador ATM Adapter driver: Always release_firmware() in ucode_init() and don't leak memory.
From: Jesper Juhl @ 2011-01-06 21:06 UTC (permalink / raw)
  To: linux-atm-general; +Cc: Chas Williams, netdev, linux-kernel


Failure to call release_firmware() will result in memory leak in 
drivers/atm/ambassador.c::ucode_init().
This patch makes sure we always call release_firmware() when needed, thus 
removing the leak(s).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 ambassador.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

  Compile tested only since I have no way to actually test this.

diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index ffe9b65..ab56539 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -1927,7 +1927,7 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
   unsigned long start_address;
   const struct ihex_binrec *rec;
   int res;
-  
+
   res = request_ihex_firmware(&fw, "atmsar11.fw", &dev->pci_dev->dev);
   if (res) {
     PRINTK (KERN_ERR, "Cannot load microcode data");
@@ -1937,6 +1937,7 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
   /* First record contains just the start address */
   rec = (const struct ihex_binrec *)fw->data;
   if (be16_to_cpu(rec->len) != sizeof(__be32) || be32_to_cpu(rec->addr)) {
+    release_firmware(fw);
     PRINTK (KERN_ERR, "Bad microcode data (no start record)");
     return -EINVAL;
   }
@@ -1950,10 +1951,12 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
     PRINTD (DBG_LOAD, "starting region (%x, %u)", be32_to_cpu(rec->addr),
 	    be16_to_cpu(rec->len));
     if (be16_to_cpu(rec->len) > 4 * MAX_TRANSFER_DATA) {
+	    release_firmware(fw);
 	    PRINTK (KERN_ERR, "Bad microcode data (record too long)");
 	    return -EINVAL;
     }
     if (be16_to_cpu(rec->len) & 3) {
+	    release_firmware(fw);
 	    PRINTK (KERN_ERR, "Bad microcode data (odd number of bytes)");
 	    return -EINVAL;
     }



-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.

^ permalink raw reply related

* 2.6.37 vlans on bnx2 not functional, panic with tcpdump
From: Iain Paton @ 2011-01-06 21:32 UTC (permalink / raw)
  To: netdev, linux-kernel

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

Hi,

vlans don't appear to be functional on my HP DL380G6 with onboard bnx2 adapter using vanilla 2.6.37 kernel. No tagged vlan traffic 
is arriving at the vlan interface.

To reproduce, use vanilla 2.6.37 built with the attached config

ip link add link eth0 name v406 type vlan id 406
ip link set up dev eth0
ip link set up dev v406
ip addr add 10.251.0.3/16 dev v406

from another machine on the same vlan run a ping to 10.251.0.3, ping returns destination host unreachable.

tcpdump -n -e -i v406  shows no traffic.

If I then run

tcpdump -n -e -i eth0

while the ping is still running I get

[  112.190114] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[  112.198912] IP: [<ffffffff813f5a34>] __skb_recv_datagram+0x124/0x2a0
[  112.214203] PGD 31fa05067 PUD 31fb51067 PMD 0
[  112.220207] Oops: 0002 [#1] SMP
[  112.228949] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:01:04.6/class
[  112.248201] CPU 0
[  112.251342] Modules linked in: 8021q garp stp llc
[  112.269199]
[  112.269692] Pid: 1370, comm: rpc.statd Not tainted 2.6.37-64 #1 /ProLiant DL380 G6
[  112.275164] RIP: 0010:[<ffffffff813f5a34>]  [<ffffffff813f5a34>] __skb_recv_datagram+0x124/0x2a0
[  112.293143] RSP: 0018:ffff88031fbd5a88  EFLAGS: 00010046
[  112.300238] RAX: 0000000000000246 RBX: 0000000000000000 RCX: ffff88019f91a8c0
[  112.319307] RDX: ffff88019f94b500 RSI: ffff88031fbd5b44 RDI: ffff88019f91a8d4
[  112.329271] RBP: ffff88031fbd5b28 R08: 0000000000000000 R09: 0000000000001000
[  112.339123] R10: 0000000000000000 R11: 0000000000000246 R12: ffff88031fbd5ac8
[  112.360207] R13: ffff88019f91a8c0 R14: ffff88031fbd5ae0 R15: ffff88019f91a8d4
[  112.363278] FS:  00007ff90cd77700(0000) GS:ffff8800d7200000(0000) knlGS:0000000000000000
[  112.366216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  112.368311] CR2: 0000000000000008 CR3: 000000031fb1a000 CR4: 00000000000006f0
[  112.375050] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  112.379300] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  112.381913] Process rpc.statd (pid: 1370, threadinfo ffff88031fbd4000, task ffff88031fe00000)
[  112.387746] Stack:
[  112.388474]  ffff88031fbd5ae8 ffffffff8141eb50 7fffffffffffffff ffff88031fe00000
[  112.404676]  ffff88031fbd5bc4 ffff88031fbd5b44 000000001fbd5b88 ffff88031fe00000
[  112.411531]  ffff88019f91a800 ffff88019f8be600 000000000000055a ffffffff81b8d780
[  112.415367] Call Trace:
[  112.416223]  [<ffffffff8141eb50>] ? netlink_dump+0x1a0/0x200
[  112.418289]  [<ffffffff8141fa4d>] ? netlink_dump_start+0x18d/0x1b0
[  112.420439]  [<ffffffff813f5bcf>] skb_recv_datagram+0x1f/0x30
[  112.422686]  [<ffffffff8141eeec>] netlink_recvmsg+0x7c/0x440
[  112.424846]  [<ffffffff813f1ea2>] ? __kfree_skb+0x42/0xa0
[  112.444125]  [<ffffffff813e9cf8>] sock_recvmsg+0xf8/0x130
[  112.449889]  [<ffffffff814600bf>] ? inet_sendmsg+0x5f/0xb0
[  112.451876]  [<ffffffff813e9e7e>] ? sock_sendmsg+0xee/0x130
[  112.454213]  [<ffffffff810b6869>] ? __do_fault+0x3b9/0x4a0
[  112.456961]  [<ffffffff810a7b48>] ? lru_cache_add_lru+0x28/0x50
[  112.481554]  [<ffffffff813e8769>] ? might_fault+0x9/0x10
[  112.483393]  [<ffffffff813e9964>] ? move_addr_to_user+0x84/0xa0
[  112.485667]  [<ffffffff813ea04d>] __sys_recvmsg+0x13d/0x2b0
[  112.492094]  [<ffffffff8141ff2e>] ? netlink_table_ungrab+0x2e/0x30
[  112.512132]  [<ffffffff8141ffb9>] ? netlink_insert+0x89/0x160
[  112.514165]  [<ffffffff813eae40>] ? move_addr_to_kernel+0x50/0x60
[  112.531071]  [<ffffffff813eb6b4>] ? sys_sendto+0x104/0x140
[  112.541470]  [<ffffffff813e9964>] ? move_addr_to_user+0x84/0xa0
[  112.549085]  [<ffffffff813eb4c2>] ? sys_getsockname+0xa2/0xc0
[  112.569417]  [<ffffffff813ebe14>] sys_recvmsg+0x44/0x90
[  112.571711]  [<ffffffff81002552>] system_call_fastpath+0x16/0x1b
[  112.573894] Code: 00 00 00 e9 4f ff ff ff 0f 1f 80 00 00 00 00 ff 8b d0 00 00 00 48 8b 1a 48 8b 4a 08 48 c7 02 00 00 00 00 48 c7 
42 08 00 00 00 00 <48> 89 4b 08 48 89 19 e9 7c ff ff ff 31 c0 87 87 64 01 00 00 f7
[  112.592492] RIP  [<ffffffff813f5a34>] __skb_recv_datagram+0x124/0x2a0
[  112.603649]  RSP <ffff88031fbd5a88>
[  112.607123] CR2: 0000000000000008
[  112.609064] ---[ end trace f6cbe3b43db03698 ]---

The stack dump isn't always the same, sometimes I'll see

[  236.078335] general protection fault: 0000 [#1] SMP

and the dump shows scsi/blk or xfs or cpu_idle etc. so I don't know how relevant this particular dump is.

What's consistent is that running tcpdump against eth0 while there's tagged traffic arriving on eth0 will kill the kernel.

If I don't run tcpdump, the machine will stay up, but it's not much use if it can't use the network.

On 2.6.36 I needed the patch from http://patchwork.ozlabs.org/patch/69516/ to prevent a similar looking immediate crash on boot. I 
don't have logs from that to compare with and I know the vlan code has changed quite a bit since then.

The same issue has been duplicated on two physically different servers, so hopefully not hardware related. The full boot log from 
this latest attempt is attached.

Iain


[-- Attachment #2: 2.6.37-64-config.gz --]
[-- Type: application/gzip, Size: 20981 bytes --]

[-- Attachment #3: 2.6.37-vlan.txt --]
[-- Type: text/plain, Size: 42728 bytes --]

Decompressing Linux... Parsing ELF... done.
Booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.37-64 (root@dl380g6-64bit) (gcc version 4.5.0 (GCC) ) #1 SMP Thu Jan 6 08:00:48 GMT 2011
[    0.000000] Command line: BOOT_IMAGE=2637 root=6802 ro root=/dev/sda2 console=uart,io,0x2f8,115200
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009f400 (usable)
[    0.000000]  BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 00000000d762f000 (usable)
[    0.000000]  BIOS-e820: 00000000d762f000 - 00000000d763c000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000d763c000 - 00000000d763d000 (usable)
[    0.000000]  BIOS-e820: 00000000d763d000 - 00000000dc000000 (reserved)
[    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fee10000 (reserved)
[    0.000000]  BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved)
[    0.000000]  BIOS-e820: 0000000100000000 - 0000000327fff000 (usable)
[    0.000000] Early serial console at I/O port 0x2f8 (options '115200')
[    0.000000] bootconsole [uart0] enabled
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI 2.7 present.
[    0.000000] No AGP bridge found
[    0.000000] last_pfn = 0x327fff max_arch_pfn = 0x400000000
[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[    0.000000] last_pfn = 0xd763d max_arch_pfn = 0x400000000
[    0.000000] found SMP MP-table at [ffff8800000f4f80] f4f80
[    0.000000] init_memory_mapping: 0000000000000000-00000000d763d000
[    0.000000] init_memory_mapping: 0000000100000000-0000000327fff000
[    0.000000] ACPI: RSDP 00000000000f4f00 00024 (v02 HP    )
[    0.000000] ACPI: XSDT 00000000d7630040 000AC (v01 HP     ProLiant 00000002   � 0000162E)
[    0.000000] ACPI: FACP 00000000d7630140 000F4 (v03 HP     ProLiant 00000002   � 0000162E)
[    0.000000] ACPI Warning: Invalid length for Pm1aControlBlock: 32, using default 16 (20101013/tbfadt-607)
[    0.000000] ACPI Warning: Invalid length for Pm2ControlBlock: 32, using default 8 (20101013/tbfadt-607)
[    0.000000] ACPI: DSDT 00000000d7630240 02005 (v01 HP         DSDT 00000001 INTL 20030228)
[    0.000000] ACPI: FACS 00000000d762f100 00040
[    0.000000] ACPI: SPCR 00000000d762f140 00050 (v01 HP     SPCRRBSU 00000001   � 0000162E)
[    0.000000] ACPI: MCFG 00000000d762f1c0 0003C (v01 HP     ProLiant 00000001      00000000)
[    0.000000] ACPI: HPET 00000000d762f200 00038 (v01 HP     ProLiant 00000002   � 0000162E)
[    0.000000] ACPI: FFFF 00000000d762f240 00064 (v02 HP     ProLiant 00000002   � 0000162E)
[    0.000000] ACPI: SPMI 00000000d762f2c0 00040 (v05 HP     ProLiant 00000001   � 0000162E)
[    0.000000] ACPI: ERST 00000000d762f300 001D0 (v01 HP     ProLiant 00000001   � 0000162E)
[    0.000000] ACPI: APIC 00000000d762f500 0015E (v01 HP     ProLiant 00000002      00000000)
[    0.000000] ACPI: SRAT 00000000d762f680 00570 (v01 HP     Proliant 00000001   � 0000162E)
[    0.000000] ACPI: FFFF 00000000d762fc00 00176 (v01 HP     ProLiant 00000001   � 0000162E)
[    0.000000] ACPI: BERT 00000000d762fd80 00030 (v01 HP     ProLiant 00000001   � 0000162E)
[    0.000000] ACPI: HEST 00000000d762fdc0 000BC (v01 HP     ProLiant 00000001   � 0000162E)
[    0.000000] ACPI: FFFF 00000000d762fe80 00194 (v01 HP     ProLiant 00000001   � 0000162E)
[    0.000000] ACPI: SSDT 00000000d7632280 00125 (v03     HP  CRSPCI0 00000002   HP 00000001)
[    0.000000] ACPI: SSDT 00000000d76323c0 00255 (v03     HP  riser1a 00000002 INTL 20061109)
[    0.000000] ACPI: SSDT 00000000d7632640 00377 (v01     HP     pmab 00000001 INTL 20090625)
[    0.000000] ACPI: SSDT 00000000d76329c0 04CA4 (v01  INTEL PPM RCM  00000001 INTL 20061109)
[    0.000000] SRAT: PXM 0 -> APIC 0x00 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x01 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x02 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x03 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x04 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x05 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x06 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x07 -> Node 0
[    0.000000] SRAT: PXM 1 -> APIC 0x10 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x11 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x12 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x13 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x14 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x15 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x16 -> Node 1
[    0.000000] SRAT: PXM 1 -> APIC 0x17 -> Node 1
[    0.000000] ACPI: [SRAT:0x00] ignored 32 entries of 64 found
[    0.000000] SRAT: Node 0 PXM 0 0-d8000000
[    0.000000] SRAT: Node 0 PXM 0 100000000-1a8000000
[    0.000000] SRAT: Node 1 PXM 1 1a8000000-328000000
[    0.000000] SRAT: Node 0 [0,d8000000) + [100000000,1a8000000) -> [0,1a8000000)
[    0.000000] Initmem setup node 0 0000000000000000-00000001a8000000
[    0.000000]   NODE_DATA [00000001a7ffb000 - 00000001a7ffffff]
[    0.000000] Initmem setup node 1 00000001a8000000-0000000327fff000
[    0.000000]   NODE_DATA [0000000327ff9f00 - 0000000327ffeeff]
[    0.000000] [ffffea0005cc0000-ffffea0005dfffff] potential offnode page_structs
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000010 -> 0x00001000
[    0.000000]   DMA32    0x00001000 -> 0x00100000
[    0.000000]   Normal   0x00100000 -> 0x00327fff
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[5] active PFN ranges
[    0.000000]     0: 0x00000010 -> 0x0000009f
[    0.000000]     0: 0x00000100 -> 0x000d762f
[    0.000000]     0: 0x000d763c -> 0x000d763d
[    0.000000]     0: 0x00100000 -> 0x001a8000
[    0.000000]     1: 0x001a8000 -> 0x00327fff
[    0.000000] ACPI: PM-Timer IO Port: 0x908
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x10] lapic_id[0x20] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x08] lapic_id[0x10] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x18] lapic_id[0x30] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x04] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x14] lapic_id[0x24] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x14] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x1c] lapic_id[0x34] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x12] lapic_id[0x22] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x12] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x1a] lapic_id[0x32] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x06] lapic_id[0x06] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x16] lapic_id[0x26] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x16] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x1e] lapic_id[0x36] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x11] lapic_id[0x21] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x09] lapic_id[0x11] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x19] lapic_id[0x31] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x05] lapic_id[0x05] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x15] lapic_id[0x25] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x15] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x1d] lapic_id[0x35] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x03] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x13] lapic_id[0x23] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x13] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x1b] lapic_id[0x33] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x07] lapic_id[0x07] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x17] lapic_id[0x27] disabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x17] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x1f] lapic_id[0x37] disabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x08] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: IOAPIC (id[0x00] address[0xfec80000] gsi_base[24])
[    0.000000] IOAPIC[1]: apic_id 0, version 32, address 0xfec80000, GSI 24-47
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] SMP: Allowing 32 CPUs, 16 hotplug CPUs
[    0.000000] Allocating PCI resources starting at dc000000 (gap: dc000000:22c00000)
[    0.000000] Booting paravirtualized kernel on bare hardware
[    0.000000] setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:32 nr_node_ids:2
[    0.000000] PERCPU: Embedded 26 pages/cpu @ffff8800d7200000 s76736 r8192 d21568 u131072
[    0.000000] Built 2 zonelists in Zone order, mobility grouping on.  Total pages: 3097852
[    0.000000] Policy zone: Normal
[    0.000000] Kernel command line: BOOT_IMAGE=2637 root=6802 ro root=/dev/sda2 console=uart,io,0x2f8,115200
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Checking aperture...
[    0.000000] No AGP bridge found
[    0.000000] Memory: 12316744k/13238268k available (5289k kernel code, 665860k absent, 255664k reserved, 5361k data, 548k init)
[    0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=32, Nodes=2
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  CONFIG_RCU_FANOUT set to non-default value of 32
[    0.000000]  RCU-based detection of stalled CPUs is disabled.
[    0.000000] NR_IRQS:4352 nr_irqs:1344 16
[    0.000000] Extended CMOS year: 2000
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.000000] Fast TSC calibration using PIT
[    0.001000] Detected 2933.889 MHz processor.
[    0.000008] Calibrating delay loop (skipped), value calculated using timer frequency.. 5867.77 BogoMIPS (lpj=2933889)
[    0.041987] pid_max: default: 32768 minimum: 301
[    0.059118] Security Framework initialized
[    0.076022] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
[    0.118019] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
[    0.159178] Mount-cache hash table entries: 256
[    0.182061] Initializing cgroup subsys ns
[    0.201940] ns_cgroup deprecated: consider using the 'clone_children' flag without the ns_cgroup.
[    0.251920] Initializing cgroup subsys cpuacct
[    0.276921] Initializing cgroup subsys devices
[    0.300918] Initializing cgroup subsys freezer
[    0.323905] CPU: Physical Processor ID: 0
[    0.342923] CPU: Processor Core ID: 0
[    0.357904] mce: CPU supports 9 MCE banks
[    0.378892] CPU0: Thermal monitoring enabled (TM1)
[    0.401917] using mwait in idle threads.
[    0.418899] Performance Events: PEBS fmt1+, Nehalem events, Intel PMU driver.
[    0.453884] ... version:                3
[    0.473900] ... bit width:              48
[    0.497868] ... generic registers:      4
[    0.513874] ... value mask:             0000ffffffffffff
[    0.539903] ... max period:             000000007fffffff
[    0.564847] ... fixed-purpose events:   3
[    0.587872] ... event mask:             000000070000000f
[    0.618460] ACPI: Core revision 20101013
[    0.641959] Setting APIC routing to physical flat
[    0.657430] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.669821] CPU0: Intel(R) Xeon(R) CPU           X5570  @ 2.93GHz stepping 05
[    0.780022] Booting Node   1, Processors  #1 Ok.
[    0.876763] Booting Node   0, Processors  #2 Ok.
[    0.981770] Booting Node   1, Processors  #3 Ok.
[    1.076721] Booting Node   0, Processors  #4 Ok.
[    1.183701] Booting Node   1, Processors  #5 Ok.
[    1.281670] Booting Node   0, Processors  #6 Ok.
[    1.396655] Booting Node   1, Processors  #7 Ok.
[    1.505625] Booting Node   0, Processors  #8 Ok.
[    1.614585] Booting Node   1, Processors  #9 Ok.
[    1.726567] Booting Node   0, Processors  #10 Ok.
[    1.829548] Booting Node   1, Processors  #11 Ok.
[    1.934508] Booting Node   0, Processors  #12 Ok.
[    2.034508] Booting Node   1, Processors  #13 Ok.
[    2.133470] Booting Node   0, Processors  #14 Ok.
[    2.248443] Booting Node   1, Processors  #15
[    2.350335] Brought up 16 CPUs
[    2.365568] Total of 16 processors activated (93854.92 BogoMIPS).
[    2.393626] devtmpfs: initialized
[    2.403409] NET: Registered protocol family 16
[    2.409234] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    2.430708] ACPI: bus type pci registered
[    2.440537] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xd8000000-0xdbffffff] (base 0xd8000000)
[    2.476391] PCI: MMCONFIG at [mem 0xd8000000-0xdbffffff] reserved in E820
[    2.499279] PCI: Using configuration type 1 for base access
[    2.516390] PCI: HP ProLiant DL380 detected, enabling pci=bfsort.
[    2.533432] bio: create slab <bio-0> at 0
[    2.553171] ACPI Error: Field [CDW3] at 96 exceeds Buffer [NULL] size 64 (bits) (20101013/dsopcode-597)
[    2.568549] ACPI Error: Method parse/execution failed [\_SB_._OSC] (Node ffff880321415f28), AE_AML_BUFFER_LIMIT (20101013/psparse-537)
[    2.622959] ACPI: Interpreter enabled
[    2.632488] ACPI: (supports S0 S5)
[    2.634090] ACPI: Using IOAPIC for interrupt routing
[    2.657052] ACPI Exception: AE_NOT_FOUND, Evaluating _PRW (20101013/scan-723)
[    2.671916] ACPI: No dock devices found.
[    2.683414] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    2.706863] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-19])
[    2.709074] pci_root PNP0A08:00: host bridge window [mem 0xdf000000-0xfbffffff]
[    2.730321] pci_root PNP0A08:00: host bridge window [io  0x1000-0x4fff]
[    2.752323] pci_root PNP0A08:00: host bridge window [io  0x0000-0x03af]
[    2.784635] pci_root PNP0A08:00: host bridge window [io  0x03e0-0x0cf7]
[    2.802345] pci_root PNP0A08:00: host bridge window [io  0x0d00-0x0fff]
[    2.818305] pci_root PNP0A08:00: host bridge window [mem 0xfed00000-0xfed03fff]
[    2.821835] pci_root PNP0A08:00: host bridge window [mem 0xfed00000-0xfed44fff]
[    2.824986] pci_root PNP0A08:00: host bridge window [io  0x03b0-0x03bb]
[    2.835820] pci_root PNP0A08:00: host bridge window [io  0x03c0-0x03df]
[    2.858293] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
[    2.879101] pci_root PNP0A08:00: host bridge window expanded to [mem 0xfed00000-0xfed44fff]; [mem 0xfed00000-0xfed44fff] ignored
[    2.938486] pci 0000:00:01.0: PCI bridge to [bus 04-04]
[    2.945265] pci 0000:00:02.0: PCI bridge to [bus 05-05]
[    2.965363] pci 0000:00:03.0: PCI bridge to [bus 10-12]
[    2.976374] pci 0000:00:04.0: PCI bridge to [bus 13-13]
[    2.980267] pci 0000:00:05.0: PCI bridge to [bus 14-16]
[    3.003397] pci 0000:00:06.0: PCI bridge to [bus 17-19]
[    3.024278] pci 0000:00:07.0: PCI bridge to [bus 0d-0f]
[    3.037987] pci 0000:0a:00.0: disabling ASPM on pre-1.1 PCIe device.  You can enable it with 'pcie_aspm=force'
[    3.069292] pci 0000:00:08.0: PCI bridge to [bus 0a-0c]
[    3.091504] pci 0000:0a:00.0: PCI bridge to [bus 0b-0b]
[    3.096838] pci 0000:00:09.0: PCI bridge to [bus 07-09]
[    3.123248] pci 0000:00:0a.0: PCI bridge to [bus 06-06]
[    3.129145] pci 0000:00:1c.0: PCI bridge to [bus 02-02]
[    3.142200] pci 0000:00:1c.2: PCI bridge to [bus 03-03]
[    3.154810] pci 0000:00:1e.0: PCI bridge to [bus 01-01] (subtractive decode)
[    3.180641] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *7 10 11)
[    3.193422] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 7 10 *11)
[    3.209344] ACPI: PCI Interrupt Link [LNKC] (IRQs *5 7 10 11)
[    3.231640] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 7 *10 11)
[    3.246789] ACPI: PCI Interrupt Link [LNKE] (IRQs *5 7 10 11)
[    3.264462] ACPI: PCI Interrupt Link [LNKF] (IRQs 5 7 *10 11)
[    3.270575] ACPI: PCI Interrupt Link [LNKG] (IRQs 5 7 *10 11)
[    3.272563] ACPI: PCI Interrupt Link [LNKH] (IRQs 5 *7 10 11)
[    3.285631] HEST: HEST table parsing is initialized.
[    3.298343] vgaarb: device added: PCI:0000:01:03.0,decodes=io+mem,owns=io+mem,locks=none
[    3.335204] vgaarb: loaded
[    3.347425] SCSI subsystem initialized
[    3.357224] usbcore: registered new interface driver usbfs
[    3.359208] usbcore: registered new interface driver hub
[    3.389205] usbcore: registered new device driver usb
[    3.391740] PCI: Using ACPI for IRQ routing
[    3.404551] cfg80211: Calling CRDA to update world regulatory domain
[    3.423297] NetLabel: Initializing
[    3.429032] NetLabel:  domain hash size = 128
[    3.440684] NetLabel:  protocols = UNLABELED CIPSOv4
[    3.458150] NetLabel:  unlabeled traffic allowed by default
[    3.471568] HPET: 4 timers in total, 0 timers will be used for per-cpu timer
[    3.486887] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0
[    3.499446] hpet0: 4 comparators, 64-bit 14.318180 MHz counter
[    3.529269] Switching to clocksource tsc
[    3.538691] pnp: PnP ACPI init
[    3.540194] ACPI: bus type pnp registered
[    3.556644] pnp: PnP ACPI: found 11 devices
[    3.573120] ACPI: ACPI bus type pnp unregistered
[    3.584127] system 00:01: [io  0x0408-0x040f] has been reserved
[    3.587713] system 00:01: [io  0x04d0-0x04d1] has been reserved
[    3.602560] system 00:01: [io  0x0700-0x071f] has been reserved
[    3.622102] system 00:01: [io  0x0880-0x08ff] has been reserved
[    3.642337] system 00:01: [io  0x0900-0x097f] has been reserved
[    3.663109] system 00:01: [io  0x0c80-0x0c83] has been reserved
[    3.681545] system 00:01: [io  0x0cd4-0x0cd7] has been reserved
[    3.701489] system 00:01: [io  0x0f50-0x0f58] has been reserved
[    3.704557] system 00:01: [io  0x0ca0-0x0ca1] has been reserved
[    3.714042] system 00:01: [io  0x0ca4-0x0ca5] has been reserved
[    3.728417] system 00:01: [io  0x02f8-0x02ff] has been reserved
[    3.746945] system 00:01: [mem 0xd8000000-0xdbffffff] has been reserved
[    3.774242] system 00:01: [mem 0xfe000000-0xfebfffff] has been reserved
[    3.816604] pci 0000:00:01.0: BAR 15: assigned [mem 0xdf000000-0xdf0fffff pref]
[    3.846065] pci 0000:00:08.0: BAR 15: assigned [mem 0xdf100000-0xdf1fffff pref]
[    3.871046] pci 0000:00:09.0: BAR 15: assigned [mem 0xdf200000-0xdf2fffff pref]
[    3.893042] pci 0000:00:1c.0: BAR 15: assigned [mem 0xdf300000-0xdf3fffff pref]
[    3.916990] pci 0000:00:1c.2: BAR 15: assigned [mem 0xdf400000-0xdf4fffff pref]
[    3.934045] pci 0000:04:00.0: BAR 6: assigned [mem 0xdf000000-0xdf07ffff pref]
[    3.967037] pci 0000:00:01.0: PCI bridge to [bus 04-04]
[    3.972666] pci 0000:00:01.0:   bridge window [io  0x4000-0x4fff]
[    3.992583] pci 0000:00:01.0:   bridge window [mem 0xf5b00000-0xf5ffffff]
[    4.013025] pci 0000:00:01.0:   bridge window [mem 0xdf000000-0xdf0fffff pref]
[    4.038033] pci 0000:00:02.0: PCI bridge to [bus 05-05]
[    4.066006] pci 0000:00:02.0:   bridge window [io  disabled]
[    4.074985] pci 0000:00:02.0:   bridge window [mem disabled]
[    4.091549] pci 0000:00:02.0:   bridge window [mem pref disabled]
[    4.100375] pci 0000:00:03.0: PCI bridge to [bus 10-12]
[    4.113564] pci 0000:00:03.0:   bridge window [io  disabled]
[    4.117955] pci 0000:00:03.0:   bridge window [mem disabled]
[    4.144011] pci 0000:00:03.0:   bridge window [mem pref disabled]
[    4.160216] pci 0000:00:04.0: PCI bridge to [bus 13-13]
[    4.163063] pci 0000:00:04.0:   bridge window [io  disabled]
[    4.165057] pci 0000:00:04.0:   bridge window [mem disabled]
[    4.191080] pci 0000:00:04.0:   bridge window [mem pref disabled]
[    4.217334] pci 0000:00:05.0: PCI bridge to [bus 14-16]
[    4.225985] pci 0000:00:05.0:   bridge window [io  disabled]
[    4.251947] pci 0000:00:05.0:   bridge window [mem disabled]
[    4.262473] pci 0000:00:05.0:   bridge window [mem pref disabled]
[    4.278976] pci 0000:00:06.0: PCI bridge to [bus 17-19]
[    4.292960] pci 0000:00:06.0:   bridge window [io  disabled]
[    4.298899] pci 0000:00:06.0:   bridge window [mem disabled]
[    4.310947] pci 0000:00:06.0:   bridge window [mem pref disabled]
[    4.340145] pci 0000:00:07.0: PCI bridge to [bus 0d-0f]
[    4.363084] pci 0000:00:07.0:   bridge window [io  disabled]
[    4.365151] pci 0000:00:07.0:   bridge window [mem disabled]
[    4.370635] pci 0000:00:07.0:   bridge window [mem pref disabled]
[    4.398062] pci 0000:0a:00.0: BAR 15: assigned [mem 0xdf100000-0xdf1fffff pref]
[    4.413960] pci 0000:0b:00.0: BAR 6: assigned [mem 0xdf100000-0xdf10ffff pref]
[    4.444938] pci 0000:0a:00.0: PCI bridge to [bus 0b-0b]
[    4.468968] pci 0000:0a:00.0:   bridge window [io  disabled]
[    4.477431] pci 0000:0a:00.0:   bridge window [mem 0xfa000000-0xfbffffff]
[    4.487505] pci 0000:0a:00.0:   bridge window [mem 0xdf100000-0xdf1fffff pref]
[    4.512909] pci 0000:00:08.0: PCI bridge to [bus 0a-0c]
[    4.515152] pci 0000:00:08.0:   bridge window [io  disabled]
[    4.537876] pci 0000:00:08.0:   bridge window [mem 0xfa000000-0xfbffffff]
[    4.557992] pci 0000:00:08.0:   bridge window [mem 0xdf100000-0xdf1fffff pref]
[    4.571877] pci 0000:07:00.0: BAR 6: assigned [mem 0xdf200000-0xdf21ffff pref]
[    4.595875] pci 0000:07:00.1: BAR 6: assigned [mem 0xdf220000-0xdf23ffff pref]
[    4.619139] pci 0000:00:09.0: PCI bridge to [bus 07-09]
[    4.630888] pci 0000:00:09.0:   bridge window [io  disabled]
[    4.647148] pci 0000:00:09.0:   bridge window [mem 0xf6000000-0xf9ffffff]
[    4.675976] pci 0000:00:09.0:   bridge window [mem 0xdf200000-0xdf2fffff pref]
[    4.695278] pci 0000:00:0a.0: PCI bridge to [bus 06-06]
[    4.716856] pci 0000:00:0a.0:   bridge window [io  disabled]
[    4.731777] pci 0000:00:0a.0:   bridge window [mem disabled]
[    4.747857] pci 0000:00:0a.0:   bridge window [mem pref disabled]
[    4.764148] pci 0000:02:00.0: BAR 6: assigned [mem 0xdf300000-0xdf30ffff pref]
[    4.780860] pci 0000:02:00.1: BAR 6: assigned [mem 0xdf310000-0xdf31ffff pref]
[    4.806842] pci 0000:00:1c.0: PCI bridge to [bus 02-02]
[    4.817256] pci 0000:00:1c.0:   bridge window [io  disabled]
[    4.832839] pci 0000:00:1c.0:   bridge window [mem 0xec000000-0xefffffff]
[    4.843784] pci 0000:00:1c.0:   bridge window [mem 0xdf300000-0xdf3fffff pref]
[    4.861016] pci 0000:03:00.0: BAR 6: assigned [mem 0xdf400000-0xdf40ffff pref]
[    4.877805] pci 0000:03:00.1: BAR 6: assigned [mem 0xdf410000-0xdf41ffff pref]
[    4.890767] pci 0000:00:1c.2: PCI bridge to [bus 03-03]
[    4.911823] pci 0000:00:1c.2:   bridge window [io  disabled]
[    4.921337] pci 0000:00:1c.2:   bridge window [mem 0xf0000000-0xf3ffffff]
[    4.935973] pci 0000:00:1c.2:   bridge window [mem 0xdf400000-0xdf4fffff pref]
[    4.960996] pci 0000:01:03.0: BAR 6: assigned [mem 0xebe00000-0xebe1ffff pref]
[    4.973812] pci 0000:01:04.2: BAR 6: assigned [mem 0xebe20000-0xebe2ffff pref]
[    5.013776] pci 0000:00:1e.0: PCI bridge to [bus 01-01]
[    5.029758] pci 0000:00:1e.0:   bridge window [io  0x2000-0x3fff]
[    5.049953] pci 0000:00:1e.0:   bridge window [mem 0xebe00000-0xebffffff]
[    5.061721] pci 0000:00:1e.0:   bridge window [mem 0xe0000000-0xe7ffffff 64bit pref]
[    5.090839] pci 0000:00:1c.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    5.099716] pci 0000:00:1c.2: PCI INT C -> GSI 16 (level, low) -> IRQ 16
[    5.132857] NET: Registered protocol family 2
[    5.158065] IP route cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    5.185770] TCP established hash table entries: 524288 (order: 11, 8388608 bytes)
[    5.219046] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
[    5.231232] TCP: Hash tables configured (established 524288 bind 65536)
[    5.243823] TCP reno registered
[    5.257747] UDP hash table entries: 8192 (order: 6, 262144 bytes)
[    5.271762] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes)
[    5.286878] NET: Registered protocol family 1
[    5.307195] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    5.312684] Placing 64MB software IO TLB between ffff8800d3200000 - ffff8800d7200000
[    5.347877] software IO TLB at phys 0xd3200000 - 0xd7200000
[    5.367363] microcode: CPU0 sig=0x106a5, pf=0x1, revision=0x15
[    5.381920] microcode: CPU1 sig=0x106a5, pf=0x1, revision=0x15
[    5.392162] microcode: CPU2 sig=0x106a5, pf=0x1, revision=0x15
[    5.407678] microcode: CPU3 sig=0x106a5, pf=0x1, revision=0x15
[    5.418729] microcode: CPU4 sig=0x106a5, pf=0x1, revision=0x15
[    5.439973] microcode: CPU5 sig=0x106a5, pf=0x1, revision=0x15
[    5.464664] microcode: CPU6 sig=0x106a5, pf=0x1, revision=0x15
[    5.477675] microcode: CPU7 sig=0x106a5, pf=0x1, revision=0x15
[    5.480221] microcode: CPU8 sig=0x106a5, pf=0x1, revision=0x15
[    5.505670] microcode: CPU9 sig=0x106a5, pf=0x1, revision=0x15
[    5.516683] microcode: CPU10 sig=0x106a5, pf=0x1, revision=0x15
[    5.534609] microcode: CPU11 sig=0x106a5, pf=0x1, revision=0x15
[    5.561644] microcode: CPU12 sig=0x106a5, pf=0x1, revision=0x15
[    5.586677] microcode: CPU13 sig=0x106a5, pf=0x1, revision=0x15
[    5.605648] microcode: CPU14 sig=0x106a5, pf=0x1, revision=0x15
[    5.622629] microcode: CPU15 sig=0x106a5, pf=0x1, revision=0x15
[    5.635679] microcode: Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    5.664519] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    5.693659] VFS: Disk quotas dquot_6.5.2
[    5.709682] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    5.733811] JFS: nTxBlock = 8192, nTxLock = 65536
[    5.746010] SGI XFS with ACLs, security attributes, large block/inode numbers, no debug enabled
[    5.777175] Btrfs loaded
[    5.789610] msgmni has been set to 24056
[    5.799979] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    5.829583] io scheduler noop registered
[    5.839558] io scheduler deadline registered
[    5.859681] io scheduler cfq registered (default)
[    5.879611] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[    5.899607] ACPI: Power Button [PWRF]
[    5.921852] thermal LNXTHERM:00: registered as thermal_zone0
[    5.941649] ACPI: Thermal Zone [THM0] (8 C)
[    5.956820] ERST: Can not request iomem region <0xffffffff81a28060-0xffffffff034500c0> for ERST.
[    6.001773] Non-volatile memory driver v1.3
[    6.014622] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    6.303539] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
789:;<=>?@ABCDUVWXYZ[\]^_`abcdtuvwxyz{|}~�����������������������������������������������������[    6.593513] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    6.635213] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    6.649907] HP CISS Driver (v 3.6.26)
[    6.659574] HP HPSA Driver (v 2.0.2-1)
[    6.668402] hpsa 0000:04:00.0: PCI INT A -> GSI 28 (level, low) -> IRQ 28
[    6.692396] hpsa 0000:04:00.0: MSIX
[    6.718402] hpsa 0000:04:00.0: hpsa0: <0x323a> at IRQ 64 using DAC
[    6.749649] scsi0 : hpsa
[    6.764070] hpsa 0000:04:00.0: Direct-Access     device c0b0t0l0 added.
[    6.780375] hpsa 0000:04:00.0: RAID              device c0b3t0l0 added.
[    6.803964] scsi 0:0:0:0: Direct-Access     HP       LOGICAL VOLUME   3.00 PQ: 0 ANSI: 5
[    6.828892] scsi 0:3:0:0: RAID              HP       P410i            3.00 PQ: 0 ANSI: 0
[    6.844873] sd 0:0:0:0: [sda] 585871964 512-byte logical blocks: (299 GB/279 GiB)
[    6.844888] ata_piix 0000:00:1f.2: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[    6.844891] ata_piix 0000:00:1f.2: MAP [ P0 P2 P1 P3 ]
[    6.898659] sd 0:0:0:0: [sda] Write Protect is off
[    6.921557] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    6.945376]  sda: sda1 sda2
[    6.949079] sd 0:0:0:0: [sda] Attached SCSI disk
[    6.995839] scsi1 : ata_piix
[    7.002431] scsi2 : ata_piix
[    7.013396] ata1: SATA max UDMA/133 cmd 0x1080 ctl 0x1088 bmdma 0x10a0 irq 17
[    7.040316] ata2: SATA max UDMA/133 cmd 0x1090 ctl 0x1098 bmdma 0x10a8 irq 17
[    7.067551] bnx2: Broadcom NetXtreme II Gigabit Ethernet Driver bnx2 v2.0.18 (Oct 7, 2010)
[    7.105286] bnx2 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    7.129998] bnx2 0000:02:00.0: eth0: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem ee000000, IRQ 16, node addr 18:a9:05:5f:fc:00
[    7.161545] bnx2 0000:02:00.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[    7.190013] bnx2 0000:02:00.1: eth1: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem ec000000, IRQ 17, node addr 18:a9:05:5f:fc:02
[    7.230271] bnx2 0000:03:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[    7.243072] bnx2 0000:03:00.0: eth2: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f2000000, IRQ 18, node addr 18:a9:05:5f:fc:04
[    7.306457] bnx2 0000:03:00.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[    7.326963] bnx2 0000:03:00.1: eth3: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f0000000, IRQ 19, node addr 18:a9:05:5f:fc:06
[    7.346323] bnx2 0000:07:00.0: PCI INT A -> GSI 32 (level, low) -> IRQ 32
[    7.368912] bnx2 0000:07:00.0: eth4: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f8000000, IRQ 32, node addr d8:d3:85:bc:68:90
[    7.428246] bnx2 0000:07:00.1: PCI INT B -> GSI 42 (level, low) -> IRQ 42
[    7.450305] bnx2 0000:07:00.1: eth5: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem f6000000, IRQ 42, node addr d8:d3:85:bc:68:92
[    7.505291] bnx2 0000:0b:00.0: PCI INT A -> GSI 31 (level, low) -> IRQ 31
[    7.527875] bnx2 0000:0b:00.0: eth6: Broadcom NetXtreme II BCM5708 1000Base-SX (B2) PCI-X 64-bit 133MHz found at mem fa000000, IRQ 31, node addr 00:24:81:e5:ed:60
[    7.569208] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.592194] ehci_hcd 0000:00:1d.7: PCI INT A -> GSI 20 (level, low) -> IRQ 20
[    7.618123] ehci_hcd 0000:00:1d.7: EHCI Host Controller
[    7.641177] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1
[    7.659248] ehci_hcd 0000:00:1d.7: debug port 1
[    7.685005] ehci_hcd 0000:00:1d.7: irq 20, io mem 0xebdf0000
[    7.688177] ata2.00: SATA link down (SStatus 4 SControl 300)
[    7.688192] ata2.01: SATA link down (SStatus 4 SControl 300)
[    7.761318] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00
[    7.784124] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    7.816101] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    7.828382] ata1.00: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    7.828400] ata1.01: SATA link down (SStatus 4 SControl 300)
[    7.847463] ata1.00: ATAPI: TEAC    DV-W28S-VS, G.V0, max UDMA/100
[    7.869459] ata1.00: configured for UDMA/100
[    7.908467] usb usb1: Product: EHCI Host Controller
[    7.909534] usb usb1: Manufacturer: Linux 2.6.37-64 ehci_hcd
[    7.932096] usb usb1: SerialNumber: 0000:00:1d.7
[    7.957307] hub 1-0:1.0: USB hub found
[    7.959201] scsi 1:0:0:0: CD-ROM            TEAC     DV-W28S-VS       G.V0 PQ: 0 ANSI: 5
[    7.968535] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[    7.968537] cdrom: Uniform CD-ROM driver Revision: 3.20
[    8.032038] hub 1-0:1.0: 8 ports detected
[    8.038748] uhci_hcd: USB Universal Host Controller Interface driver
[    8.060710] uhci_hcd 0000:00:1d.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
[    8.072501] uhci_hcd 0000:00:1d.0: UHCI Host Controller
[    8.080505] uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
[    8.098025] uhci_hcd 0000:00:1d.0: irq 20, io base 0x00001000
[    8.116093] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    8.150032] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.175662] usb usb2: Product: UHCI Host Controller
[    8.193021] usb usb2: Manufacturer: Linux 2.6.37-64 uhci_hcd
[    8.217995] usb usb2: SerialNumber: 0000:00:1d.0
[    8.235145] hub 2-0:1.0: USB hub found
[    8.249318] hub 2-0:1.0: 2 ports detected
[    8.262032] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 23 (level, low) -> IRQ 23
[    8.284071] uhci_hcd 0000:00:1d.1: UHCI Host Controller
[    8.293023] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3
[    8.313423] uhci_hcd 0000:00:1d.1: irq 23, io base 0x00001020
[    8.332022] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    8.362128] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.391104] usb usb3: Product: UHCI Host Controller
[    8.392989] usb usb3: Manufacturer: Linux 2.6.37-64 uhci_hcd
[    8.409974] usb usb3: SerialNumber: 0000:00:1d.1
[    8.429076] hub 3-0:1.0: USB hub found
[    8.441956] hub 3-0:1.0: 2 ports detected
[    8.447349] uhci_hcd 0000:00:1d.2: PCI INT C -> GSI 22 (level, low) -> IRQ 22
[    8.457377] uhci_hcd 0000:00:1d.2: UHCI Host Controller
[    8.466960] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4
[    8.485973] uhci_hcd 0000:00:1d.2: irq 22, io base 0x00001040
[    8.506973] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001
[    8.517691] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.531889] usb usb4: Product: UHCI Host Controller
[    8.544944] usb usb4: Manufacturer: Linux 2.6.37-64 uhci_hcd
[    8.568030] usb usb4: SerialNumber: 0000:00:1d.2
[    8.581053] hub 4-0:1.0: USB hub found
[    8.595921] hub 4-0:1.0: 2 ports detected
[    8.618967] uhci_hcd 0000:00:1d.3: PCI INT D -> GSI 23 (level, low) -> IRQ 23
[    8.627906] uhci_hcd 0000:00:1d.3: UHCI Host Controller
[    8.649105] uhci_hcd 0000:00:1d.3: new USB bus registered, assigned bus number 5
[    8.672331] uhci_hcd 0000:00:1d.3: irq 23, io base 0x00001060
[    8.698108] usb usb5: New USB device found, idVendor=1d6b, idProduct=0001
[    8.722903] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.753888] usb usb5: Product: UHCI Host Controller
[    8.767279] usb usb5: Manufacturer: Linux 2.6.37-64 uhci_hcd
[    8.785163] usb usb5: SerialNumber: 0000:00:1d.3
[    8.801008] hub 5-0:1.0: USB hub found
[    8.802240] hub 5-0:1.0: 2 ports detected
[    8.818047] uhci_hcd 0000:01:04.4: PCI INT B -> GSI 22 (level, low) -> IRQ 22
[    8.834414] uhci_hcd 0000:01:04.4: UHCI Host Controller
[    8.845856] uhci_hcd 0000:01:04.4: new USB bus registered, assigned bus number 6
[    8.873900] uhci_hcd 0000:01:04.4: port count misdetected? forcing to 2 ports
[    8.901462] uhci_hcd 0000:01:04.4: irq 22, io base 0x00003800
[    8.922913] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001
[    8.948856] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    8.965278] usb usb6: Product: UHCI Host Controller
[    8.979857] usb usb6: Manufacturer: Linux 2.6.37-64 uhci_hcd
[    9.004116] usb usb6: SerialNumber: 0000:01:04.4
[    9.008913] hub 6-0:1.0: USB hub found
[    9.026837] hub 6-0:1.0: 2 ports detected
[    9.043927] Initializing USB Mass Storage driver...
[    9.060252] usbcore: registered new interface driver usb-storage
[    9.067785] USB Mass Storage support registered.
[    9.079488] usbcore: registered new interface driver libusual
[    9.098923] PNP: PS/2 Controller [PNP0303:KBD,PNP0f0e:PS2M] at 0x60,0x64 irq 1,12
[    9.138462] serio: i8042 KBD port at 0x60,0x64 irq 1
[    9.151836] serio: i8042 AUX port at 0x60,0x64 irq 12
[    9.156035] mice: PS/2 mouse device common for all mice
[    9.170899] rtc_cmos 00:0a: RTC can wake from S4
[    9.183569] rtc_cmos 00:0a: rtc core: registered rtc_cmos as rtc0
[    9.200778] rtc0: alarms up to one year, y3k, 114 bytes nvram, hpet irqs
[    9.236078] device-mapper: uevent: version 1.0.3
[    9.252867] device-mapper: ioctl: 4.18.0-ioctl (2010-06-29) initialised: dm-devel@redhat.com
[    9.268722] cpuidle: using governor ladder
[    9.287063] cpuidle: using governor menu
[    9.294189] No iBFT detected.
[    9.294310] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
[    9.330100] usbcore: registered new interface driver usbhid
[    9.344743] usbhid: USB HID core driver
[    9.364574] usb 6-1: new full speed USB device using uhci_hcd and address 2
[    9.393053] Netfilter messages via NETLINK v0.30.
[    9.406105] TCP cubic registered
[    9.408816] Initializing XFRM netlink socket
[    9.423269] NET: Registered protocol family 10
[    9.432121] lo: Disabled Privacy Extensions
[    9.445475] NET: Registered protocol family 17
[    9.448834] NET: Registered protocol family 15
[    9.472939] Registering the dns_resolver key type
[    9.486124] registered taskstats version 1
[    9.505005] rtc_cmos 00:0a: setting system clock to 2011-01-06 20:52:23 UTC (1294347143)
[    9.541801] usb 6-1: New USB device found, idVendor=03f0, idProduct=1027
[    9.556689] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    9.583762] usb 6-1: Product: Virtual Keyboard
[    9.595825] usb 6-1: Manufacturer: HP
[    9.624524] input: HP Virtual Keyboard as /devices/pci0000:00/0000:00:1e.0/0000:01:04.4/usb6/6-1/6-1:1.0/input/input2
[    9.657683] generic-usb 0003:03F0:1027.0001: input,hidraw0: USB HID v1.01 Keyboard [HP Virtual Keyboard] on usb-0000:01:04.4-1/input0
[    9.702263] input: HP Virtual Keyboard as /devices/pci0000:00/0000:00:1e.0/0000:01:04.4/usb6/6-1/6-1:1.1/input/input3
[    9.739453] generic-usb 0003:03F0:1027.0002: input,hidraw1: USB HID v1.01 Mouse [HP Virtual Keyboard] on usb-0000:01:04.4-1/input1
[    9.906433] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input4
[    9.944835] XFS mounting filesystem sda2
[   10.153937] Starting XFS recovery on filesystem: sda2 (logdev: internal)
[   10.308406] Ending XFS recovery on filesystem: sda2 (logdev: internal)
[   10.326708] VFS: Mounted root (xfs filesystem) readonly on device 8:2.
[   10.334360] Freeing unused kernel memory: 548k freed
[   10.345572] Write protecting the kernel read-only data: 10240k
[   10.357015] Freeing unused kernel memory: 836k freed
[   10.371486] Freeing unused kernel memory: 1956k freed
INIT: version 2.86 booting
sysfs on /sys type sysfs (rw)
INIT: Entering runlevel: 3
+ ip link add link eth0 name v406 type vlan id 406
[   11.500681] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[   11.523254] All bugs added by David S. Miller <davem@redhat.com>
+ ip link set up dev eth0
[   11.584691] bnx2 0000:02:00.0: eth0: using MSIX
[   11.590173] ADDRCONF(NETDEV_UP): eth0: link is not ready
+ ip link set up dev v406
+ ip addr add 10.251.0.3/16 dev v406
+ exit


Welcome to Hell..

64bit login: [  112.190114] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[  112.198912] IP: [<ffffffff813f5a34>] __skb_recv_datagram+0x124/0x2a0
[  112.214203] PGD 31fa05067 PUD 31fb51067 PMD 0 
[  112.220207] Oops: 0002 [#1] SMP 
[  112.228949] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:01:04.6/class
[  112.248201] CPU 0 
[  112.251342] Modules linked in: 8021q garp stp llc
[  112.269199] 
[  112.269692] Pid: 1370, comm: rpc.statd Not tainted 2.6.37-64 #1 /ProLiant DL380 G6
[  112.275164] RIP: 0010:[<ffffffff813f5a34>]  [<ffffffff813f5a34>] __skb_recv_datagram+0x124/0x2a0
[  112.293143] RSP: 0018:ffff88031fbd5a88  EFLAGS: 00010046
[  112.300238] RAX: 0000000000000246 RBX: 0000000000000000 RCX: ffff88019f91a8c0
[  112.319307] RDX: ffff88019f94b500 RSI: ffff88031fbd5b44 RDI: ffff88019f91a8d4
[  112.329271] RBP: ffff88031fbd5b28 R08: 0000000000000000 R09: 0000000000001000
[  112.339123] R10: 0000000000000000 R11: 0000000000000246 R12: ffff88031fbd5ac8
[  112.360207] R13: ffff88019f91a8c0 R14: ffff88031fbd5ae0 R15: ffff88019f91a8d4
[  112.363278] FS:  00007ff90cd77700(0000) GS:ffff8800d7200000(0000) knlGS:0000000000000000
[  112.366216] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  112.368311] CR2: 0000000000000008 CR3: 000000031fb1a000 CR4: 00000000000006f0
[  112.375050] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  112.379300] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  112.381913] Process rpc.statd (pid: 1370, threadinfo ffff88031fbd4000, task ffff88031fe00000)
[  112.387746] Stack:
[  112.388474]  ffff88031fbd5ae8 ffffffff8141eb50 7fffffffffffffff ffff88031fe00000
[  112.404676]  ffff88031fbd5bc4 ffff88031fbd5b44 000000001fbd5b88 ffff88031fe00000
[  112.411531]  ffff88019f91a800 ffff88019f8be600 000000000000055a ffffffff81b8d780
[  112.415367] Call Trace:
[  112.416223]  [<ffffffff8141eb50>] ? netlink_dump+0x1a0/0x200
[  112.418289]  [<ffffffff8141fa4d>] ? netlink_dump_start+0x18d/0x1b0
[  112.420439]  [<ffffffff813f5bcf>] skb_recv_datagram+0x1f/0x30
[  112.422686]  [<ffffffff8141eeec>] netlink_recvmsg+0x7c/0x440
[  112.424846]  [<ffffffff813f1ea2>] ? __kfree_skb+0x42/0xa0
[  112.444125]  [<ffffffff813e9cf8>] sock_recvmsg+0xf8/0x130
[  112.449889]  [<ffffffff814600bf>] ? inet_sendmsg+0x5f/0xb0
[  112.451876]  [<ffffffff813e9e7e>] ? sock_sendmsg+0xee/0x130
[  112.454213]  [<ffffffff810b6869>] ? __do_fault+0x3b9/0x4a0
[  112.456961]  [<ffffffff810a7b48>] ? lru_cache_add_lru+0x28/0x50
[  112.481554]  [<ffffffff813e8769>] ? might_fault+0x9/0x10
[  112.483393]  [<ffffffff813e9964>] ? move_addr_to_user+0x84/0xa0
[  112.485667]  [<ffffffff813ea04d>] __sys_recvmsg+0x13d/0x2b0
[  112.492094]  [<ffffffff8141ff2e>] ? netlink_table_ungrab+0x2e/0x30
[  112.512132]  [<ffffffff8141ffb9>] ? netlink_insert+0x89/0x160
[  112.514165]  [<ffffffff813eae40>] ? move_addr_to_kernel+0x50/0x60
[  112.531071]  [<ffffffff813eb6b4>] ? sys_sendto+0x104/0x140
[  112.541470]  [<ffffffff813e9964>] ? move_addr_to_user+0x84/0xa0
[  112.549085]  [<ffffffff813eb4c2>] ? sys_getsockname+0xa2/0xc0
[  112.569417]  [<ffffffff813ebe14>] sys_recvmsg+0x44/0x90
[  112.571711]  [<ffffffff81002552>] system_call_fastpath+0x16/0x1b
[  112.573894] Code: 00 00 00 e9 4f ff ff ff 0f 1f 80 00 00 00 00 ff 8b d0 00 00 00 48 8b 1a 48 8b 4a 08 48 c7 02 00 00 00 00 48 c7 42 08 00 00 00 00 <48> 89 4b 08 48 89 19 e9 7c ff ff ff 31 c0 87 87 64 01 00 00 f7 
[  112.592492] RIP  [<ffffffff813f5a34>] __skb_recv_datagram+0x124/0x2a0
[  112.603649]  RSP <ffff88031fbd5a88>
[  112.607123] CR2: 0000000000000008
[  112.609064] ---[ end trace f6cbe3b43db03698 ]---

^ permalink raw reply

* Re: [PATCH V8 01/13] time: Introduce timekeeping_inject_offset
From: Arnd Bergmann @ 2011-01-06 22:00 UTC (permalink / raw)
  To: John Stultz
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	Alan Cox, Christoph Lameter, David Miller, John Stultz,
	Krzysztof Halasa, Peter Zijlstra, Rodolfo Giometti,
	Thomas Gleixner, Richard Cochran
In-Reply-To: <15a12892b0bfc17327d2b3a7695c81fbe6f34337.1293820862.git.richard.cochran-3mrvs1K0uXizZXS1Dc/lvw@public.gmane.org>

On Friday 31 December 2010, John Stultz <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> This adds a kernel-internal timekeeping interface to add or subtract

Note that this is not the correct way to submit a patch from someone else.
You should instead use your own name and email address as the sender,
and have "From: John Stultz <johnstul-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>" as the first line in
the body of the email. You also need to add your own "Signed-off-by: 
Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>" line below the S-o-b from
John.

Using git-send-email plus git-format-patch will gets this right if
the commit was done correctly in your own git tree. If you prefer to
use a different set of tools, you need to watch out for these details
yourself.

	Arnd

^ permalink raw reply

* Re: [PATCH v2] net: Allow ethtool to set interface in loopback mode.
From: Ben Hutchings @ 2011-01-06 22:13 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Stephen Hemminger, Mahesh Bandewar, David Miller, Laurent Chavey,
	Tom Herbert, netdev
In-Reply-To: <4D249ABD.4080209@garzik.org>

On Wed, 2011-01-05 at 11:22 -0500, Jeff Garzik wrote:
> On 01/04/2011 08:21 PM, Ben Hutchings wrote:
> > On Tue, 2011-01-04 at 16:36 -0800, Stephen Hemminger wrote:
> >> On Tue,  4 Jan 2011 16:30:01 -0800
> >> Mahesh Bandewar<maheshb@google.com>  wrote:
> >>
> >>> This patch enables ethtool to set the loopback mode on a given interface.
> >>> By configuring the interface in loopback mode in conjunction with a policy
> >>> route / rule, a userland application can stress the egress / ingress path
> >>> exposing the flows of the change in progress and potentially help developer(s)
> >>> understand the impact of those changes without even sending a packet out
> >>> on the network.
> >>>
> >>> Following set of commands illustrates one such example -
> >>> 	a) ip -4 addr add 192.168.1.1/24 dev eth1
> >>> 	b) ip -4 rule add from all iif eth1 lookup 250
> >>> 	c) ip -4 route add local 0/0 dev lo proto kernel scope host table 250
> >>> 	d) arp -Ds 192.168.1.100 eth1
> >>> 	e) arp -Ds 192.168.1.200 eth1
> >>> 	f) sysctl -w net.ipv4.ip_nonlocal_bind=1
> >>> 	g) sysctl -w net.ipv4.conf.all.accept_local=1
> >>> 	# Assuming that the machine has 8 cores
> >>> 	h) taskset 000f netserver -L 192.168.1.200
> >>> 	i) taskset 00f0 netperf -t TCP_CRR -L 192.168.1.100 -H 192.168.1.200 -l 30
> >>>
> >>> Signed-off-by: Mahesh Bandewar<maheshb@google.com>
> >>> Reviewed-by: Ben Hutchings<bhutchings@solarflare.com>
> >>
> >> Since this is a boolean it SHOULD go into ethtool_flags rather than
> >> being a high level operation.
> >
> > It could do, but I though ETHTOOL_{G,S}FLAGS were intended for
> > controlling offload features.
> 
> It doesn't have to be.  As Stephen guessed, [GS]FLAGS are basically 
> common flags -- as differentiated from private, 
> driver-specific/hardware-specific flags.

Well, that would allow the patch to be simplified quite a bit. :-)

Ben.

From: Ben Hutchings <bhutchings@solarflare.com>
Subject: [PATCH net-2.6] ethtool: Define ETH_FLAG_LOOPBACK
Date: Thu, 6 Jan 2011 22:10:55 +0000

Mahesh Bandewar <maheshb@google.com> requested this, writing:

By configuring the interface in loopback mode in conjunction with a policy
route / rule, a userland application can stress the egress / ingress path
exposing the flows of the change in progress and potentially help developer(s)
understand the impact of those changes without even sending a packet out
on the network.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -309,6 +309,7 @@ struct ethtool_perm_addr {
  * flag differs from the read-only value.
  */
 enum ethtool_flags {
+	ETH_FLAG_LOOPBACK	= (1 << 2),	/* Host-side loopback enabled */
 	ETH_FLAG_TXVLAN		= (1 << 7),	/* TX VLAN offload enabled */
 	ETH_FLAG_RXVLAN		= (1 << 8),	/* RX VLAN offload enabled */
 	ETH_FLAG_LRO		= (1 << 15),	/* LRO is enabled */
---

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
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

* Re: Flow Control and Port Mirroring Revisited
From: Jesse Gross @ 2011-01-06 22:38 UTC (permalink / raw)
  To: Simon Horman
  Cc: Eric Dumazet, Rusty Russell, virtualization, dev, virtualization,
	netdev, kvm, Michael S. Tsirkin
In-Reply-To: <20110106124439.GA17004@verge.net.au>

On Thu, Jan 6, 2011 at 7:44 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Jan 06, 2011 at 11:22:42AM +0100, Eric Dumazet wrote:
>> Le jeudi 06 janvier 2011 à 18:33 +0900, Simon Horman a écrit :
>> > Hi,
>> >
>> > Back in October I reported that I noticed a problem whereby flow control
>> > breaks down when openvswitch is configured to mirror a port[1].
>> >
>> > I have (finally) looked into this further and the problem appears to relate
>> > to cloning of skbs, as Jesse Gross originally suspected.
>> >
>> > More specifically, in do_execute_actions[2] the first n-1 times that an skb
>> > needs to be transmitted it is cloned first and the final time the original
>> > skb is used.
>> >
>> > In the case that there is only one action, which is the normal case, then
>> > the original skb will be used. But in the case of mirroring the cloning
>> > comes into effect. And in my case the cloned skb seems to go to the (slow)
>> > eth1 interface while the original skb goes to the (fast) dummy0 interface
>> > that I set up to be a mirror. The result is that dummy0 "paces" the flow,
>> > and its a cracking pace at that.
>> >
>> > As an experiment I hacked do_execute_actions() to use the original skb
>> > for the first action instead of the last one.  In my case the result was
>> > that eth1 "paces" the flow, and things work reasonably nicely.
>> >
>> > Well, sort of. Things work well for non-GSO skbs but extremely poorly for
>> > GSO skbs where only 3 (yes 3, not 3%) end up at the remote host running
>> > netserv. I'm unsure why, but I digress.
>> >
>> > It seems to me that my hack illustrates the point that the flow ends up
>> > being "paced" by one interface. However I think that what would be
>> > desirable is that the flow is "paced" by the slowest link. Unfortunately
>> > I'm unsure how to achieve that.
>> >
>>
>> Hi Simon !
>>
>> "pacing" is done because skb is attached to a socket, and a socket has a
>> limited (but configurable) sndbuf. sk->sk_wmem_alloc is the current sum
>> of all truesize skbs in flight.
>>
>> When you enter something that :
>>
>> 1) Get a clone of the skb, queue the clone to device X
>> 2) queue the original skb to device Y
>>
>> Then :        Socket sndbuf is not affected at all by device X queue.
>>       This is speed on device Y that matters.
>>
>> You want to get servo control on both X and Y
>>
>> You could try to
>>
>> 1) Get a clone of skb
>>    Attach it to socket too (so that socket get a feedback of final
>> orphaning for the clone) with skb_set_owner_w()
>>    queue the clone to device X
>>
>> Unfortunatly, stacked skb->destructor() makes this possible only for
>> known destructor (aka sock_wfree())
>
> Hi Eric !
>
> Thanks for the advice. I had thought about the socket buffer but at some
> point it slipped my mind.
>
> In any case the following patch seems to implement the change that I had in
> mind. However my discussions Michael Tsirkin elsewhere in this thread are
> beginning to make me think that think that perhaps this change isn't the
> best solution.

I know that everyone likes a nice netperf result but I agree with
Michael that this probably isn't the right question to be asking.  I
don't think that socket buffers are a real solution to the flow
control problem: they happen to provide that functionality but it's
more of a side effect than anything.  It's just that the amount of
memory consumed by packets in the queue(s) doesn't really have any
implicit meaning for flow control (think multiple physical adapters,
all with the same speed instead of a virtual device and a physical
device with wildly different speeds).  The analog in the physical
world that you're looking for would be Ethernet flow control.
Obviously, if the question is limiting CPU or memory consumption then
that's a different story.

This patch also double counts memory, since the full size of the
packet will be accounted for by each clone, even though they share the
actual packet data.  Probably not too significant here but it might be
when flooding/mirroring to many interfaces.  This is at least fixable
(the Xen-style accounting through page tracking deals with it, though
it has its own problems).

^ permalink raw reply

* Re: POLLPRI/poll() behavior change since 2.6.31
From: Davide Libenzi @ 2011-01-06 22:40 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Leonardo Chiquitto, netdev, David S. Miller
In-Reply-To: <1294332929.3074.49.camel@edumazet-laptop>

On Thu, 6 Jan 2011, Eric Dumazet wrote:

> Hmm, this is because 	sock_def_readable() uses :
> 
> wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLRDNORM |
> POLLRDBAND);
> 
> So POLLPRI bit is not signaled. 
> 
> I would just add POLLPRI flag in sock_def_readable()
> 
> (Alternatively, define a tcp_def_readable() function to pass POLLPRI
> only if TCP_URG is set, but is it worth the pain for a seldom used
> feature ?)

It would be kinda cleaner though, /me thinks.


- Davide



^ permalink raw reply

* [PATCH] tlan: Use pr_fmt, pr_<level> and netdev_<level>, remove changelog
From: Joe Perches @ 2011-01-06 22:48 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: netdev, Samuel Chessman
In-Reply-To: <1294339817-31434-1-git-send-email-sakari.ailus@iki.fi>

Neatening and standardization to the standard logging mechanisms.
The changelog isn't useful anymore.
Miscellaneous speen/speed typo correction.

Signed-off-by: Joe Perches <joe@perches.com>
---

On top of Sakari Ailus' patches...

 drivers/net/tlan.c |  304 +++++++++++++---------------------------------------
 1 files changed, 74 insertions(+), 230 deletions(-)

diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index bbb0b12..ecfae1d 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -25,153 +25,10 @@
  *		Microchip Technology, 24C01A/02A/04A Data Sheet
  *			available in PDF format from www.microchip.com
  *
- * Change History
- *
- *	Tigran Aivazian <tigran@sco.com>:	TLan_PciProbe() now uses
- *						new PCI BIOS interface.
- *	Alan Cox	<alan@lxorguk.ukuu.org.uk>:
- *						Fixed the out of memory
- *						handling.
- *
- *	Torben Mathiasen <torben.mathiasen@compaq.com> New Maintainer!
- *
- *	v1.1 Dec 20, 1999    - Removed linux version checking
- *			       Patch from Tigran Aivazian.
- *			     - v1.1 includes Alan's SMP updates.
- *			     - We still have problems on SMP though,
- *			       but I'm looking into that.
- *
- *	v1.2 Jan 02, 2000    - Hopefully fixed the SMP deadlock.
- *			     - Removed dependency of HZ being 100.
- *			     - We now allow higher priority timers to
- *			       overwrite timers like TLAN_TIMER_ACTIVITY
- *			       Patch from John Cagle <john.cagle@compaq.com>.
- *			     - Fixed a few compiler warnings.
- *
- *	v1.3 Feb 04, 2000    - Fixed the remaining HZ issues.
- *			     - Removed call to pci_present().
- *			     - Removed SA_INTERRUPT flag from irq handler.
- *			     - Added __init and __initdata to reduce resisdent
- *			       code size.
- *			     - Driver now uses module_init/module_exit.
- *			     - Rewrote init_module and tlan_probe to
- *			       share a lot more code. We now use tlan_probe
- *			       with builtin and module driver.
- *			     - Driver ported to new net API.
- *			     - tlan.txt has been reworked to reflect current
- *			       driver (almost)
- *			     - Other minor stuff
- *
- *	v1.4 Feb 10, 2000    - Updated with more changes required after Dave's
- *			       network cleanup in 2.3.43pre7 (Tigran & myself)
- *			     - Minor stuff.
- *
- *	v1.5 March 22, 2000  - Fixed another timer bug that would hang the
- *			       driver if no cable/link were present.
- *			     - Cosmetic changes.
- *			     - TODO: Port completely to new PCI/DMA API
- *				     Auto-Neg fallback.
- *
- *	v1.6 April 04, 2000  - Fixed driver support for kernel-parameters.
- *			       Haven't tested it though, as the kernel support
- *			       is currently broken (2.3.99p4p3).
- *			     - Updated tlan.txt accordingly.
- *			     - Adjusted minimum/maximum frame length.
- *			     - There is now a TLAN website up at
- *			       http://hp.sourceforge.net/
- *
- *	v1.7 April 07, 2000  - Started to implement custom ioctls. Driver now
- *			       reports PHY information when used with Donald
- *			       Beckers userspace MII diagnostics utility.
- *
- *	v1.8 April 23, 2000  - Fixed support for forced speed/duplex settings.
- *			     - Added link information to Auto-Neg and forced
- *			       modes. When NIC operates with auto-neg the driver
- *			       will report Link speed & duplex modes as well as
- *			       link partner abilities. When forced link is used,
- *			       the driver will report status of the established
- *			       link.
- *			       Please read tlan.txt for additional information.
- *			     - Removed call to check_region(), and used
- *			       return value of request_region() instead.
- *
- *	v1.8a May 28, 2000   - Minor updates.
- *
- *	v1.9 July 25, 2000   - Fixed a few remaining Full-Duplex issues.
- *			     - Updated with timer fixes from Andrew Morton.
- *			     - Fixed module race in TLan_Open.
- *			     - Added routine to monitor PHY status.
- *			     - Added activity led support for Proliant devices.
- *
- *	v1.10 Aug 30, 2000   - Added support for EISA based tlan controllers
- *			       like the Compaq NetFlex3/E.
- *			     - Rewrote tlan_probe to better handle multiple
- *			       bus probes. Probing and device setup is now
- *			       done through TLan_Probe and TLan_init_one. Actual
- *			       hardware probe is done with kernel API and
- *			       TLan_EisaProbe.
- *			     - Adjusted debug information for probing.
- *			     - Fixed bug that would cause general debug
- *			       information to be printed after driver removal.
- *			     - Added transmit timeout handling.
- *			     - Fixed OOM return values in tlan_probe.
- *			     - Fixed possible mem leak in tlan_exit
- *			       (now tlan_remove_one).
- *			     - Fixed timer bug in TLan_phyMonitor.
- *			     - This driver version is alpha quality, please
- *			       send me any bug issues you may encounter.
- *
- *	v1.11 Aug 31, 2000   - Do not try to register irq 0 if no irq line was
- *			       set for EISA cards.
- *			     - Added support for NetFlex3/E with nibble-rate
- *			       10Base-T PHY. This is untestet as I haven't got
- *			       one of these cards.
- *			     - Fixed timer being added twice.
- *			     - Disabled PhyMonitoring by default as this is
- *			       work in progress. Define MONITOR to enable it.
- *			     - Now we don't display link info with PHYs that
- *			       doesn't support it (level1).
- *			     - Incresed tx_timeout beacuse of auto-neg.
- *			     - Adjusted timers for forced speeds.
- *
- *	v1.12 Oct 12, 2000   - Minor fixes (memleak, init, etc.)
- *
- *	v1.13 Nov 28, 2000   - Stop flooding console with auto-neg issues
- *			       when link can't be established.
- *			     - Added the bbuf option as a kernel parameter.
- *			     - Fixed ioaddr probe bug.
- *			     - Fixed stupid deadlock with MII interrupts.
- *			     - Added support for speed/duplex selection with
- *			       multiple nics.
- *			     - Added partly fix for TX Channel lockup with
- *			       TLAN v1.0 silicon. This needs to be investigated
- *			       further.
- *
- *	v1.14 Dec 16, 2000   - Added support for servicing multiple frames per.
- *			       interrupt. Thanks goes to
- *			       Adam Keys <adam@ti.com>
- *			       Denis Beaudoin <dbeaudoin@ti.com>
- *			       for providing the patch.
- *			     - Fixed auto-neg output when using multiple
- *			       adapters.
- *			     - Converted to use new taskq interface.
- *
- *	v1.14a Jan 6, 2001   - Minor adjustments (spinlocks, etc.)
- *
- *	Samuel Chessman <chessman@tux.org> New Maintainer!
- *
- *	v1.15 Apr 4, 2002    - Correct operation when aui=1 to be
- *			       10T half duplex no loopback
- *			       Thanks to Gunnar Eikman
- *
- *	Sakari Ailus <sakari.ailus@iki.fi>:
- *
- *	v1.15a Dec 15 2008   - Remove bbuf support, it doesn't work anyway.
- *	v1.16  Jan 6  2011   - Make checkpatch.pl happy.
- *	v1.17  Jan 6  2011   - Add suspend/resume support.
- *
  ******************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -204,7 +61,7 @@ module_param_array(speed, int, NULL, 0);
 MODULE_PARM_DESC(aui, "ThunderLAN use AUI port(s) (0-1)");
 MODULE_PARM_DESC(duplex,
 		 "ThunderLAN duplex setting(s) (0-default, 1-half, 2-full)");
-MODULE_PARM_DESC(speed, "ThunderLAN port speen setting(s) (0,10,100)");
+MODULE_PARM_DESC(speed, "ThunderLAN port speed setting(s) (0,10,100)");
 
 MODULE_AUTHOR("Maintainer: Samuel Chessman <chessman@tux.org>");
 MODULE_DESCRIPTION("Driver for TI ThunderLAN based ethernet PCI adapters");
@@ -542,7 +399,7 @@ static int __init tlan_probe(void)
 {
 	int rc = -ENODEV;
 
-	printk(KERN_INFO "%s", tlan_banner);
+	pr_info("%s", tlan_banner);
 
 	TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n");
 
@@ -551,16 +408,16 @@ static int __init tlan_probe(void)
 	rc = pci_register_driver(&tlan_driver);
 
 	if (rc != 0) {
-		printk(KERN_ERR "TLAN: Could not register pci driver.\n");
+		pr_err("Could not register pci driver\n");
 		goto err_out_pci_free;
 	}
 
 	TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n");
 	tlan_eisa_probe();
 
-	printk(KERN_INFO "TLAN: %d device%s installed, PCI: %d  EISA: %d\n",
-	       tlan_devices_installed, tlan_devices_installed == 1 ? "" : "s",
-	       tlan_have_pci, tlan_have_eisa);
+	pr_info("%d device%s installed, PCI: %d  EISA: %d\n",
+		tlan_devices_installed, tlan_devices_installed == 1 ? "" : "s",
+		tlan_have_pci, tlan_have_eisa);
 
 	if (tlan_devices_installed == 0) {
 		rc = -ENODEV;
@@ -619,7 +476,7 @@ static int __devinit tlan_probe1(struct pci_dev *pdev,
 
 		rc = pci_request_regions(pdev, tlan_signature);
 		if (rc) {
-			printk(KERN_ERR "TLAN: Could not reserve IO regions\n");
+			pr_err("Could not reserve IO regions\n");
 			goto err_out;
 		}
 	}
@@ -627,7 +484,7 @@ static int __devinit tlan_probe1(struct pci_dev *pdev,
 
 	dev = alloc_etherdev(sizeof(struct tlan_priv));
 	if (dev == NULL) {
-		printk(KERN_ERR "TLAN: Could not allocate memory for device.\n");
+		pr_err("Could not allocate memory for device\n");
 		rc = -ENOMEM;
 		goto err_out_regions;
 	}
@@ -646,8 +503,7 @@ static int __devinit tlan_probe1(struct pci_dev *pdev,
 
 		rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
 		if (rc) {
-			printk(KERN_ERR
-			       "TLAN: No suitable PCI mapping available.\n");
+			pr_err("No suitable PCI mapping available\n");
 			goto err_out_free_dev;
 		}
 
@@ -661,7 +517,7 @@ static int __devinit tlan_probe1(struct pci_dev *pdev,
 			}
 		}
 		if (!pci_io_base) {
-			printk(KERN_ERR "TLAN: No IO mappings available\n");
+			pr_err("No IO mappings available\n");
 			rc = -EIO;
 			goto err_out_free_dev;
 		}
@@ -717,13 +573,13 @@ static int __devinit tlan_probe1(struct pci_dev *pdev,
 
 	rc = tlan_init(dev);
 	if (rc) {
-		printk(KERN_ERR "TLAN: Could not set up device.\n");
+		pr_err("Could not set up device\n");
 		goto err_out_free_dev;
 	}
 
 	rc = register_netdev(dev);
 	if (rc) {
-		printk(KERN_ERR "TLAN: Could not register device.\n");
+		pr_err("Could not register device\n");
 		goto err_out_uninit;
 	}
 
@@ -740,12 +596,11 @@ static int __devinit tlan_probe1(struct pci_dev *pdev,
 		tlan_have_eisa++;
 	}
 
-	printk(KERN_INFO "TLAN: %s irq=%2d, io=%04x, %s, Rev. %d\n",
-	       dev->name,
-	       (int) dev->irq,
-	       (int) dev->base_addr,
-	       priv->adapter->device_label,
-	       priv->adapter_rev);
+	netdev_info(dev, "irq=%2d, io=%04x, %s, Rev. %d\n",
+		    (int)dev->irq,
+		    (int)dev->base_addr,
+		    priv->adapter->device_label,
+		    priv->adapter_rev);
 	return 0;
 
 err_out_uninit:
@@ -861,7 +716,7 @@ static void  __init tlan_eisa_probe(void)
 		}
 
 		if (debug == 0x10)
-			printk(KERN_INFO "Found one\n");
+			pr_info("Found one\n");
 
 
 		/* Get irq from board */
@@ -890,12 +745,12 @@ static void  __init tlan_eisa_probe(void)
 
 out:
 		if (debug == 0x10)
-			printk(KERN_INFO "None found\n");
+			pr_info("None found\n");
 		continue;
 
 out2:
 		if (debug == 0x10)
-			printk(KERN_INFO "Card found but it is not enabled, skipping\n");
+			pr_info("Card found but it is not enabled, skipping\n");
 		continue;
 
 	}
@@ -963,8 +818,7 @@ static int tlan_init(struct net_device *dev)
 	priv->dma_size = dma_size;
 
 	if (priv->dma_storage == NULL) {
-		printk(KERN_ERR
-		       "TLAN:  Could not allocate lists and buffers for %s.\n",
+		pr_err("Could not allocate lists and buffers for %s\n",
 		       dev->name);
 		return -ENOMEM;
 	}
@@ -982,9 +836,8 @@ static int tlan_init(struct net_device *dev)
 					 (u8) priv->adapter->addr_ofs + i,
 					 (u8 *) &dev->dev_addr[i]);
 	if (err) {
-		printk(KERN_ERR "TLAN: %s: Error reading MAC from eeprom: %d\n",
-		       dev->name,
-		       err);
+		pr_err("%s: Error reading MAC from eeprom: %d\n",
+		       dev->name, err);
 	}
 	dev->addr_len = 6;
 
@@ -1028,8 +881,8 @@ static int tlan_open(struct net_device *dev)
 			  dev->name, dev);
 
 	if (err) {
-		pr_err("TLAN:  Cannot open %s because IRQ %d is already in use.\n",
-		       dev->name, dev->irq);
+		netdev_err(dev, "Cannot open because IRQ %d is already in use\n",
+			   dev->irq);
 		return err;
 	}
 
@@ -1512,8 +1365,8 @@ static u32 tlan_handle_tx_eof(struct net_device *dev, u16 host_int)
 	}
 
 	if (!ack)
-		printk(KERN_INFO
-		       "TLAN: Received interrupt for uncompleted TX frame.\n");
+		netdev_info(dev,
+			    "Received interrupt for uncompleted TX frame\n");
 
 	if (eoc) {
 		TLAN_DBG(TLAN_DEBUG_TX,
@@ -1666,8 +1519,8 @@ drop_and_reuse:
 	}
 
 	if (!ack)
-		printk(KERN_INFO
-		       "TLAN: Received interrupt for uncompleted RX frame.\n");
+		netdev_info(dev,
+			    "Received interrupt for uncompleted RX frame\n");
 
 
 	if (eoc) {
@@ -1723,7 +1576,7 @@ drop_and_reuse:
 
 static u32 tlan_handle_dummy(struct net_device *dev, u16 host_int)
 {
-	pr_info("TLAN:  Test interrupt on %s.\n", dev->name);
+	netdev_info(dev, "Test interrupt\n");
 	return 1;
 
 }
@@ -1816,7 +1669,7 @@ static u32 tlan_handle_status_check(struct net_device *dev, u16 host_int)
 	if (host_int & TLAN_HI_IV_MASK) {
 		netif_stop_queue(dev);
 		error = inl(dev->base_addr + TLAN_CH_PARM);
-		pr_info("TLAN:  %s: Adaptor Error = 0x%x\n", dev->name, error);
+		netdev_info(dev, "Adaptor Error = 0x%x\n", error);
 		tlan_read_and_clear_stats(dev, TLAN_RECORD);
 		outl(TLAN_HC_AD_RST, dev->base_addr + TLAN_HOST_CMD);
 
@@ -2057,7 +1910,7 @@ static void tlan_reset_lists(struct net_device *dev)
 		list->buffer[0].count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER;
 		skb = netdev_alloc_skb_ip_align(dev, TLAN_MAX_FRAME_SIZE + 5);
 		if (!skb) {
-			pr_err("TLAN: out of memory for received data.\n");
+			netdev_err(dev, "Out of memory for received data\n");
 			break;
 		}
 
@@ -2141,13 +1994,13 @@ static void tlan_print_dio(u16 io_base)
 	u32 data0, data1;
 	int	i;
 
-	pr_info("TLAN:   Contents of internal registers for io base 0x%04hx.\n",
-	       io_base);
-	pr_info("TLAN:      Off.  +0	 +4\n");
+	pr_info("Contents of internal registers for io base 0x%04hx\n",
+		io_base);
+	pr_info("Off.  +0        +4\n");
 	for (i = 0; i < 0x4C; i += 8) {
 		data0 = tlan_dio_read32(io_base, i);
 		data1 = tlan_dio_read32(io_base, i + 0x4);
-		pr_info("TLAN:      0x%02x  0x%08x 0x%08x\n", i, data0, data1);
+		pr_info("0x%02x  0x%08x 0x%08x\n", i, data0, data1);
 	}
 
 }
@@ -2176,14 +2029,14 @@ static void tlan_print_list(struct tlan_list *list, char *type, int num)
 {
 	int i;
 
-	pr_info("TLAN:   %s List %d at %p\n", type, num, list);
-	pr_info("TLAN:      Forward    = 0x%08x\n",  list->forward);
-	pr_info("TLAN:      CSTAT      = 0x%04hx\n", list->c_stat);
-	pr_info("TLAN:      Frame Size = 0x%04hx\n", list->frame_size);
+	pr_info("%s List %d at %p\n", type, num, list);
+	pr_info("   Forward    = 0x%08x\n",  list->forward);
+	pr_info("   CSTAT      = 0x%04hx\n", list->c_stat);
+	pr_info("   Frame Size = 0x%04hx\n", list->frame_size);
 	/* for (i = 0; i < 10; i++) { */
 	for (i = 0; i < 2; i++) {
-		pr_info("TLAN:      Buffer[%d].count, addr = 0x%08x, 0x%08x\n",
-		       i, list->buffer[i].count, list->buffer[i].address);
+		pr_info("   Buffer[%d].count, addr = 0x%08x, 0x%08x\n",
+			i, list->buffer[i].count, list->buffer[i].address);
 	}
 
 }
@@ -2398,7 +2251,7 @@ tlan_finish_reset(struct net_device *dev)
 	if ((priv->adapter->flags & TLAN_ADAPTER_UNMANAGED_PHY) ||
 	    (priv->aui)) {
 		status = MII_GS_LINK;
-		pr_info("TLAN:  %s: Link forced.\n", dev->name);
+		netdev_info(dev, "Link forced\n");
 	} else {
 		tlan_mii_read_reg(dev, phy, MII_GEN_STS, &status);
 		udelay(1000);
@@ -2410,24 +2263,20 @@ tlan_finish_reset(struct net_device *dev)
 			tlan_mii_read_reg(dev, phy, MII_AN_LPA, &partner);
 			tlan_mii_read_reg(dev, phy, TLAN_TLPHY_PAR, &tlphy_par);
 
-			pr_info("TLAN: %s: Link active with ", dev->name);
-			if (!(tlphy_par & TLAN_PHY_AN_EN_STAT)) {
-				pr_info("forced 10%sMbps %s-Duplex\n",
-					tlphy_par & TLAN_PHY_SPEED_100
-					? "" : "0",
-					tlphy_par & TLAN_PHY_DUPLEX_FULL
-					? "Full" : "Half");
-			} else {
-				pr_info("Autonegotiation enabled, at 10%sMbps %s-Duplex\n",
-					tlphy_par & TLAN_PHY_SPEED_100
-					? "" : "0",
-					tlphy_par & TLAN_PHY_DUPLEX_FULL
-					? "Full" : "half");
-				pr_info("TLAN: Partner capability:");
+			netdev_info(dev,
+				    "Link active with %s %uMbps %s-Duplex\n",
+				    !(tlphy_par & TLAN_PHY_AN_EN_STAT)
+				    ? "forced" : "Autonegotiation enabled,",
+				    tlphy_par & TLAN_PHY_SPEED_100
+				    ? 100 : 10,
+				    tlphy_par & TLAN_PHY_DUPLEX_FULL
+				    ? "Full" : "Half");
+			if (tlphy_par & TLAN_PHY_AN_EN_STAT) {
+				netdev_info(dev, "Partner capability:");
 				for (i = 5; i < 10; i++)
 					if (partner & (1<<i))
-						printk(" %s", media[i-5]);
-				printk("\n");
+						pr_cont(" %s", media[i-5]);
+				pr_cont("\n");
 			}
 
 			tlan_dio_write8(dev->base_addr, TLAN_LED_REG,
@@ -2439,7 +2288,7 @@ tlan_finish_reset(struct net_device *dev)
 			tlan_set_timer(dev, (10*HZ), TLAN_TIMER_LINK_BEAT);
 #endif
 		} else if (status & MII_GS_LINK)  {
-			pr_info("TLAN: %s: Link active\n", dev->name);
+			netdev_info(dev, "Link active\n");
 			tlan_dio_write8(dev->base_addr, TLAN_LED_REG,
 					TLAN_LED_LINK);
 		}
@@ -2465,8 +2314,7 @@ tlan_finish_reset(struct net_device *dev)
 		outl(TLAN_HC_GO | TLAN_HC_RT, dev->base_addr + TLAN_HOST_CMD);
 		netif_carrier_on(dev);
 	} else {
-		pr_info("TLAN: %s: Link inactive, will retry in 10 secs...\n",
-		       dev->name);
+		netdev_info(dev, "Link inactive, will retry in 10 secs...\n");
 		tlan_set_timer(dev, (10*HZ), TLAN_TIMER_FINISH_RESET);
 		return;
 	}
@@ -2550,23 +2398,20 @@ static void tlan_phy_print(struct net_device *dev)
 	phy = priv->phy[priv->phy_num];
 
 	if (priv->adapter->flags & TLAN_ADAPTER_UNMANAGED_PHY) {
-		pr_info("TLAN:   Device %s, Unmanaged PHY.\n", dev->name);
+		netdev_info(dev, "Unmanaged PHY\n");
 	} else if (phy <= TLAN_PHY_MAX_ADDR) {
-		pr_info("TLAN:   Device %s, PHY 0x%02x.\n", dev->name, phy);
-		pr_info("TLAN:      Off.  +0     +1     +2     +3\n");
+		netdev_info(dev, "PHY 0x%02x\n", phy);
+		pr_info("   Off.  +0     +1     +2     +3\n");
 		for (i = 0; i < 0x20; i += 4) {
-			pr_info("TLAN:      0x%02x", i);
 			tlan_mii_read_reg(dev, phy, i, &data0);
-			printk(" 0x%04hx", data0);
 			tlan_mii_read_reg(dev, phy, i + 1, &data1);
-			printk(" 0x%04hx", data1);
 			tlan_mii_read_reg(dev, phy, i + 2, &data2);
-			printk(" 0x%04hx", data2);
 			tlan_mii_read_reg(dev, phy, i + 3, &data3);
-			printk(" 0x%04hx\n", data3);
+			pr_info("   0x%02x 0x%04hx 0x%04hx 0x%04hx 0x%04hx\n",
+				i, data0, data1, data2, data3);
 		}
 	} else {
-		pr_info("TLAN:   Device %s, Invalid PHY.\n", dev->name);
+		netdev_info(dev, "Invalid PHY\n");
 	}
 
 }
@@ -2633,7 +2478,7 @@ static void tlan_phy_detect(struct net_device *dev)
 	else if (priv->phy[0] != TLAN_PHY_NONE)
 		priv->phy_num = 0;
 	else
-		pr_info("TLAN:  Cannot initialize device, no PHY was found!\n");
+		netdev_info(dev, "Cannot initialize device, no PHY was found!\n");
 
 }
 
@@ -2761,8 +2606,7 @@ static void tlan_phy_start_link(struct net_device *dev)
 			 * but the card need additional time to start AN.
 			 * .5 sec should be plenty extra.
 			 */
-			pr_info("TLAN: %s: Starting autonegotiation.\n",
-				dev->name);
+			netdev_info(dev, "Starting autonegotiation\n");
 			tlan_set_timer(dev, (2*HZ), TLAN_TIMER_PHY_FINISH_AN);
 			return;
 		}
@@ -2825,16 +2669,16 @@ static void tlan_phy_finish_auto_neg(struct net_device *dev)
 		 * more time.  Perhaps we should fail after a while.
 		 */
 		if (!priv->neg_be_verbose++) {
-			pr_info("TLAN:  Giving autonegotiation more time.\n");
-			pr_info("TLAN:  Please check that your adapter has\n");
-			pr_info("TLAN:  been properly connected to a HUB or Switch.\n");
-			pr_info("TLAN:  Trying to establish link in the background...\n");
+			pr_info("Giving autonegotiation more time.\n");
+			pr_info("Please check that your adapter has\n");
+			pr_info("been properly connected to a HUB or Switch.\n");
+			pr_info("Trying to establish link in the background...\n");
 		}
 		tlan_set_timer(dev, (8*HZ), TLAN_TIMER_PHY_FINISH_AN);
 		return;
 	}
 
-	pr_info("TLAN: %s: Autonegotiation complete.\n", dev->name);
+	netdev_info(dev, "Autonegotiation complete\n");
 	tlan_mii_read_reg(dev, phy, MII_AN_ADV, &an_adv);
 	tlan_mii_read_reg(dev, phy, MII_AN_LPA, &an_lpa);
 	mode = an_adv & an_lpa & 0x03E0;
@@ -2859,11 +2703,11 @@ static void tlan_phy_finish_auto_neg(struct net_device *dev)
 		    (an_adv & an_lpa & 0x0040)) {
 			tlan_mii_write_reg(dev, phy, MII_GEN_CTL,
 					   MII_GC_AUTOENB | MII_GC_DUPLEX);
-			pr_info("TLAN:  Starting internal PHY with FULL-DUPLEX\n");
+			netdev_info(dev, "Starting internal PHY with FULL-DUPLEX\n");
 		} else {
 			tlan_mii_write_reg(dev, phy, MII_GEN_CTL,
 					   MII_GC_AUTOENB);
-			pr_info("TLAN:  Starting internal PHY with HALF-DUPLEX\n");
+			netdev_info(dev, "Starting internal PHY with HALF-DUPLEX\n");
 		}
 	}
 




^ permalink raw reply related

* Re: Flow Control and Port Mirroring Revisited
From: Simon Horman @ 2011-01-06 22:01 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Rusty Russell, virtualization, Jesse Gross, dev, virtualization,
	netdev, kvm, Michael S. Tsirkin
In-Reply-To: <1294320498.3074.36.camel@edumazet-laptop>

On Thu, Jan 06, 2011 at 02:28:18PM +0100, Eric Dumazet wrote:
> Le jeudi 06 janvier 2011 à 21:44 +0900, Simon Horman a écrit :
> 
> > Hi Eric !
> > 
> > Thanks for the advice. I had thought about the socket buffer but at some
> > point it slipped my mind.
> > 
> > In any case the following patch seems to implement the change that I had in
> > mind. However my discussions Michael Tsirkin elsewhere in this thread are
> > beginning to make me think that think that perhaps this change isn't the
> > best solution.
> > 
> > diff --git a/datapath/actions.c b/datapath/actions.c
> > index 5e16143..505f13f 100644
> > --- a/datapath/actions.c
> > +++ b/datapath/actions.c
> > @@ -384,7 +384,12 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
> >  
> >  	for (a = actions, rem = actions_len; rem > 0; a = nla_next(a, &rem)) {
> >  		if (prev_port != -1) {
> > -			do_output(dp, skb_clone(skb, GFP_ATOMIC), prev_port);
> > +			struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
> > +			if (nskb) {
> > +				if (skb->sk)
> > +					skb_set_owner_w(nskb, skb->sk);
> > +				do_output(dp, nskb, prev_port);
> > +			}
> >  			prev_port = -1;
> >  		}
> > 
> > I got a rather nasty panic without the if (skb->sk),
> > I guess some skbs don't have a socket.
> 
> Indeed, some packets are not linked to a socket.
> 
> (ARP packets for example)
> 
> Sorry, I should have mentioned it :)

Not at all, the occasional panic during hacking is good for the soul.

^ permalink raw reply

* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Eric Dumazet @ 2011-01-06 23:34 UTC (permalink / raw)
  To: Jesse Gross
  Cc: Matt Carlson, Michael Leun, Michael Chan, David Miller,
	Ben Greear, linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <AANLkTincX-wPQE9gs16v53E4=Skivzc4ZSJS43oNBLD_@mail.gmail.com>

Le jeudi 06 janvier 2011 à 16:01 -0500, Jesse Gross a écrit :

> Hmm, I thought that it might be some interaction with a corner case in
> the networking core but now it seems less likely.  There weren't too
> many vlan changes between the working and non-working states.  Plus,
> since the rx counter isn't increasing, the packets probably aren't
> making it anywhere.
> 
> I see that tg3 increases the drop counter in one place, which also
> happens to be checking for vlan errors (at tg3.c:4753).  That seems
> suspicious - maybe the NIC is only partially configured for vlan
> offloading.  If we can confirm that is where the drop counter is being
> incremented and what the error code is maybe it would shed some light.
> 

Hmm... I am pretty sure the drop counter is the dev rx_dropped (core
network handled, not tg3 one) incremented at the end of
__netif_receive_skb() : We found no suitable handler for packets.

atomic_long_inc(&skb->dev->rx_dropped);

But thats a guess, I'll have to check

> If it's a driver issue I don't have much insight - maybe Matt or
> bisect can help.
> 
> >> If it works on bnx2, it would seem to be a driver problem but it would
> >> be good to confirm that the tag in skb->vlan_tci is not being
> >> delievered to the networking core in this case.
> >
> > Hmm, where do you want me to check this ?
> 
> I was thinking right before vlan_gro_receive() at tg3.c:4837.  If my
> theory above is right then this obviously isn't relevant since it
> won't be hit at all.  Otherwise it would be good to know exactly what
> the driver is producing.

^ permalink raw reply

* [PATCH v2] net: ppp: use {get,put}_unaligned_be{16,32}
From: Changli Gao @ 2011-01-06 23:37 UTC (permalink / raw)
  To: David S. Miller
  Cc: Paul Mackerras, Harvey Harrison, linux-ppp, netdev, Changli Gao

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
v2: use asm/unaligned.h, thanks Harvey.
 drivers/net/ppp_async.c   |   10 +++++-----
 drivers/net/ppp_deflate.c |    9 ++++-----
 drivers/net/ppp_generic.c |    9 ++++-----
 drivers/net/ppp_mppe.c    |    7 +++----
 drivers/net/ppp_synctty.c |    3 ++-
 5 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 78d70a6..cbe1e13 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -32,6 +32,7 @@
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
+#include <asm/unaligned.h>
 #include <asm/uaccess.h>
 #include <asm/string.h>
 
@@ -542,7 +543,7 @@ ppp_async_encode(struct asyncppp *ap)
 	data = ap->tpkt->data;
 	count = ap->tpkt->len;
 	fcs = ap->tfcs;
-	proto = (data[0] << 8) + data[1];
+	proto = get_unaligned_be16(data);
 
 	/*
 	 * LCP packets with code values between 1 (configure-reqest)
@@ -963,7 +964,7 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
 	code = data[0];
 	if (code != CONFACK && code != CONFREQ)
 		return;
-	dlen = (data[2] << 8) + data[3];
+	dlen = get_unaligned_be16(data + 2);
 	if (len < dlen)
 		return;		/* packet got truncated or length is bogus */
 
@@ -997,15 +998,14 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
 	while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) {
 		switch (data[0]) {
 		case LCP_MRU:
-			val = (data[2] << 8) + data[3];
+			val = get_unaligned_be16(data + 2);
 			if (inbound)
 				ap->mru = val;
 			else
 				ap->chan.mtu = val;
 			break;
 		case LCP_ASYNCMAP:
-			val = (data[2] << 24) + (data[3] << 16)
-				+ (data[4] << 8) + data[5];
+			val = get_unaligned_be32(data + 2);
 			if (inbound)
 				ap->raccm = val;
 			else
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c
index 695bc83..df3ce78 100644
--- a/drivers/net/ppp_deflate.c
+++ b/drivers/net/ppp_deflate.c
@@ -41,6 +41,7 @@
 #include <linux/ppp-comp.h>
 
 #include <linux/zlib.h>
+#include <asm/unaligned.h>
 
 /*
  * State for a Deflate (de)compressor.
@@ -232,11 +233,9 @@ static int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,
 	 */
 	wptr[0] = PPP_ADDRESS(rptr);
 	wptr[1] = PPP_CONTROL(rptr);
-	wptr[2] = PPP_COMP >> 8;
-	wptr[3] = PPP_COMP;
+	put_unaligned_be16(PPP_COMP, wptr + 2);
 	wptr += PPP_HDRLEN;
-	wptr[0] = state->seqno >> 8;
-	wptr[1] = state->seqno;
+	put_unaligned_be16(state->seqno, wptr);
 	wptr += DEFLATE_OVHD;
 	olen = PPP_HDRLEN + DEFLATE_OVHD;
 	state->strm.next_out = wptr;
@@ -451,7 +450,7 @@ static int z_decompress(void *arg, unsigned char *ibuf, int isize,
 	}
 
 	/* Check the sequence number. */
-	seq = (ibuf[PPP_HDRLEN] << 8) + ibuf[PPP_HDRLEN+1];
+	seq = get_unaligned_be16(ibuf + PPP_HDRLEN);
 	if (seq != (state->seqno & 0xffff)) {
 		if (state->debug)
 			printk(KERN_DEBUG "z_decompress%d: bad seq # %d, expected %d\n",
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 6456484..0a81f0b 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -46,6 +46,7 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
+#include <asm/unaligned.h>
 #include <net/slhc_vj.h>
 #include <asm/atomic.h>
 
@@ -210,7 +211,7 @@ struct ppp_net {
 };
 
 /* Get the PPP protocol number from a skb */
-#define PPP_PROTO(skb)	(((skb)->data[0] << 8) + (skb)->data[1])
+#define PPP_PROTO(skb)	get_unaligned_be16((skb)->data)
 
 /* We limit the length of ppp->file.rq to this (arbitrary) value */
 #define PPP_MAX_RQLEN	32
@@ -964,8 +965,7 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	pp = skb_push(skb, 2);
 	proto = npindex_to_proto[npi];
-	pp[0] = proto >> 8;
-	pp[1] = proto;
+	put_unaligned_be16(proto, pp);
 
 	netif_stop_queue(dev);
 	skb_queue_tail(&ppp->file.xq, skb);
@@ -1473,8 +1473,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
 		q = skb_put(frag, flen + hdrlen);
 
 		/* make the MP header */
-		q[0] = PPP_MP >> 8;
-		q[1] = PPP_MP;
+		put_unaligned_be16(PPP_MP, q);
 		if (ppp->flags & SC_MP_XSHORTSEQ) {
 			q[2] = bits + ((ppp->nxseq >> 8) & 0xf);
 			q[3] = ppp->nxseq;
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c
index 6d1a1b8..44dab65 100644
--- a/drivers/net/ppp_mppe.c
+++ b/drivers/net/ppp_mppe.c
@@ -55,6 +55,7 @@
 #include <linux/ppp_defs.h>
 #include <linux/ppp-comp.h>
 #include <linux/scatterlist.h>
+#include <asm/unaligned.h>
 
 #include "ppp_mppe.h"
 
@@ -395,16 +396,14 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf,
 	 */
 	obuf[0] = PPP_ADDRESS(ibuf);
 	obuf[1] = PPP_CONTROL(ibuf);
-	obuf[2] = PPP_COMP >> 8;	/* isize + MPPE_OVHD + 1 */
-	obuf[3] = PPP_COMP;	/* isize + MPPE_OVHD + 2 */
+	put_unaligned_be16(PPP_COMP, obuf + 2);
 	obuf += PPP_HDRLEN;
 
 	state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE;
 	if (state->debug >= 7)
 		printk(KERN_DEBUG "mppe_compress[%d]: ccount %d\n", state->unit,
 		       state->ccount);
-	obuf[0] = state->ccount >> 8;
-	obuf[1] = state->ccount & 0xff;
+	put_unaligned_be16(state->ccount, obuf);
 
 	if (!state->stateful ||	/* stateless mode     */
 	    ((state->ccount & 0xff) == 0xff) ||	/* "flag" packet      */
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index 4c95ec3..fe86826 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -45,6 +45,7 @@
 #include <linux/completion.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <asm/unaligned.h>
 #include <asm/uaccess.h>
 
 #define PPP_VERSION	"2.4.2"
@@ -563,7 +564,7 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
 	int islcp;
 
 	data  = skb->data;
-	proto = (data[0] << 8) + data[1];
+	proto = get_unaligned_be16(data);
 
 	/* LCP packets with codes between 1 (configure-request)
 	 * and 7 (code-reject) must be sent as though no options

^ permalink raw reply related

* Re: [PATCH v2] net: ppp: use {get,put}_unaligned_be{16,32}
From: Harvey Harrison @ 2011-01-06 23:42 UTC (permalink / raw)
  To: Changli Gao; +Cc: David S. Miller, Paul Mackerras, linux-ppp, netdev
In-Reply-To: <1294357056-25889-1-git-send-email-xiaosuo@gmail.com>

On Thu, Jan 6, 2011 at 3:37 PM, Changli Gao <xiaosuo@gmail.com> wrote:
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>

FWIW:

Reviewed-by: Harvey Harrison <harvey.harrison@gmail.com>

^ permalink raw reply

* [PATCH] forcedeth: Do not use legacy PCI power management
From: Rafael J. Wysocki @ 2011-01-06 23:49 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, LKML, Linux-pm mailing list

From: Rafael J. Wysocki <rjw@sisk.pl>

The forcedeth driver uses the legacy PCI power management, so it has
to do PCI-specific things in its ->suspend() and ->resume() callbacks
and some of them are not done correctly.

Convert forcedeth to the new PCI power management framework and make
it let the PCI subsystem take care of all the PCI-specific aspects of
device handling during system power transitions.

Tested with nVidia Corporation MCP55 Ethernet (rev a2).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/net/forcedeth.c |   34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)

Index: linux-2.6/drivers/net/forcedeth.c
===================================================================
--- linux-2.6.orig/drivers/net/forcedeth.c
+++ linux-2.6/drivers/net/forcedeth.c
@@ -4082,6 +4082,7 @@ static int nv_set_wol(struct net_device
 		writel(flags, base + NvRegWakeUpFlags);
 		spin_unlock_irq(&np->lock);
 	}
+	device_set_wakeup_enable(&np->pci_dev->dev, np->wolenabled);
 	return 0;
 }
 
@@ -5643,14 +5644,10 @@ static int __devinit nv_probe(struct pci
 	/* set mac address */
 	nv_copy_mac_to_hw(dev);
 
-	/* Workaround current PCI init glitch:  wakeup bits aren't
-	 * being set from PCI PM capability.
-	 */
-	device_init_wakeup(&pci_dev->dev, 1);
-
 	/* disable WOL */
 	writel(0, base + NvRegWakeUpFlags);
 	np->wolenabled = 0;
+	device_set_wakeup_enable(&pci_dev->dev, false);
 
 	if (id->driver_data & DEV_HAS_POWER_CNTRL) {
 
@@ -5923,8 +5920,9 @@ static void __devexit nv_remove(struct p
 }
 
 #ifdef CONFIG_PM
-static int nv_suspend(struct pci_dev *pdev, pm_message_t state)
+static int nv_suspend(struct device *device)
 {
+	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct fe_priv *np = netdev_priv(dev);
 	u8 __iomem *base = get_hwbase(dev);
@@ -5940,25 +5938,17 @@ static int nv_suspend(struct pci_dev *pd
 	for (i = 0;i <= np->register_size/sizeof(u32); i++)
 		np->saved_config_space[i] = readl(base + i*sizeof(u32));
 
-	pci_save_state(pdev);
-	pci_enable_wake(pdev, pci_choose_state(pdev, state), np->wolenabled);
-	pci_disable_device(pdev);
-	pci_set_power_state(pdev, pci_choose_state(pdev, state));
 	return 0;
 }
 
-static int nv_resume(struct pci_dev *pdev)
+static int nv_resume(struct device *device)
 {
+	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct fe_priv *np = netdev_priv(dev);
 	u8 __iomem *base = get_hwbase(dev);
 	int i, rc = 0;
 
-	pci_set_power_state(pdev, PCI_D0);
-	pci_restore_state(pdev);
-	/* ack any pending wake events, disable PME */
-	pci_enable_wake(pdev, PCI_D0, 0);
-
 	/* restore non-pci configuration space */
 	for (i = 0;i <= np->register_size/sizeof(u32); i++)
 		writel(np->saved_config_space[i], base+i*sizeof(u32));
@@ -5977,6 +5967,9 @@ static int nv_resume(struct pci_dev *pde
 	return rc;
 }
 
+static SIMPLE_DEV_PM_OPS(nv_pm_ops, nv_suspend, nv_resume);
+#define NV_PM_OPS (&nv_pm_ops)
+
 static void nv_shutdown(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
@@ -6000,14 +5993,12 @@ static void nv_shutdown(struct pci_dev *
 	 * only put the device into D3 if we really go for poweroff.
 	 */
 	if (system_state == SYSTEM_POWER_OFF) {
-		if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled))
-			pci_enable_wake(pdev, PCI_D3hot, np->wolenabled);
+		pci_wake_from_d3(pdev, np->wolenabled);
 		pci_set_power_state(pdev, PCI_D3hot);
 	}
 }
 #else
-#define nv_suspend NULL
-#define nv_shutdown NULL
+#define NV_PM_OPS NULL
 #define nv_resume NULL
 #endif /* CONFIG_PM */
 
@@ -6180,9 +6171,8 @@ static struct pci_driver driver = {
 	.id_table	= pci_tbl,
 	.probe		= nv_probe,
 	.remove		= __devexit_p(nv_remove),
-	.suspend	= nv_suspend,
-	.resume		= nv_resume,
 	.shutdown	= nv_shutdown,
+	.driver.pm	= NV_PM_OPS,
 };
 
 static int __init init_nic(void)

^ permalink raw reply

* Re: 2.6.37 vlans on bnx2 not functional, panic with tcpdump
From: Michael Chan @ 2011-01-06 23:52 UTC (permalink / raw)
  To: Iain Paton; +Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <4D2634DE.2060907@gmail.com>


On Thu, 2011-01-06 at 13:32 -0800, Iain Paton wrote:
> Hi,
> 
> vlans don't appear to be functional on my HP DL380G6 with onboard bnx2
> adapter using vanilla 2.6.37 kernel. No tagged vlan traffic 
> is arriving at the vlan interface.

VLANs on net-next-2.6 kernel works for me on bnx2 devices.  I'll try
2.6.37 next.

> 
> To reproduce, use vanilla 2.6.37 built with the attached config
> 
> ip link add link eth0 name v406 type vlan id 406
> ip link set up dev eth0
> ip link set up dev v406
> ip addr add 10.251.0.3/16 dev v406
> 
> from another machine on the same vlan run a ping to 10.251.0.3, ping
> returns destination host unreachable.
> 
> tcpdump -n -e -i v406  shows no traffic.
> 
> If I then run
> 
> tcpdump -n -e -i eth0
> 
> while the ping is still running I get
> 
> [  112.190114] BUG: unable to handle kernel NULL pointer dereference
> at 0000000000000008

^ permalink raw reply

* [net-next 00/12][pull-request] Intel Wired LAN Driver Updates
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Jeff Kirsher, netdev, gosp, bphilips

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

The following series contains ixgbe/e1000e cleanups and fixes.  The
addition of CE4100 support in e1000, and ixgb VLAN conversion to the
new model.

The following changes since commit dbbe68bb12b34f3e450da7a73c20e6fa1f85d63a:

  Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

are available in the git repository at:

  master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6.git master

Alexander Duyck (3):
  ixgbe: cleanup flow director hash computation to improve performance
  ixgbe: further flow director performance optimizations
  ixgbe: update ntuple filter configuration

Bruce Allan (6):
  e1000e: cleanup variables set but not used
  e1000e: convert calls of ops.[read|write]_reg to e1e_[r|w]phy
  e1000e: properly bounds-check string functions
  e1000e: use either_crc_le() rather than re-write it
  e1000e: power off PHY after reset when interface is down
  e1000e: add custom set_d[0|3]_lplu_state function pointer for 82574

Dirk Brandewie (1):
  e1000: Add support for the CE4100 reference platform

Emil Tantilov (1):
  ixgb: convert to new VLAN model

Yi Zou (1):
  ixgbe: make sure per Rx queue is disabled before unmapping the
    receive buffer

 drivers/net/e1000/e1000_hw.c      |  328 +++++++++++++----
 drivers/net/e1000/e1000_hw.h      |   59 +++-
 drivers/net/e1000/e1000_main.c    |   35 ++
 drivers/net/e1000/e1000_osdep.h   |   19 +-
 drivers/net/e1000e/82571.c        |   77 ++++-
 drivers/net/e1000e/e1000.h        |    3 +
 drivers/net/e1000e/es2lan.c       |    4 +-
 drivers/net/e1000e/ethtool.c      |   54 ++-
 drivers/net/e1000e/hw.h           |    1 +
 drivers/net/e1000e/ich8lan.c      |   77 ++---
 drivers/net/e1000e/lib.c          |    3 +-
 drivers/net/e1000e/netdev.c       |   53 ++--
 drivers/net/e1000e/phy.c          |   40 +--
 drivers/net/ixgb/ixgb.h           |    2 +-
 drivers/net/ixgb/ixgb_ethtool.c   |   35 ++
 drivers/net/ixgb/ixgb_main.c      |   54 +--
 drivers/net/ixgbe/ixgbe.h         |   21 +-
 drivers/net/ixgbe/ixgbe_82599.c   |  749 +++++++++++++++----------------------
 drivers/net/ixgbe/ixgbe_ethtool.c |  142 +++++---
 drivers/net/ixgbe/ixgbe_main.c    |  169 ++++++---
 drivers/net/ixgbe/ixgbe_type.h    |   91 +++--
 21 files changed, 1182 insertions(+), 834 deletions(-)

-- 
1.7.3.4


^ permalink raw reply

* [net-next 01/12] e1000e: cleanup variables set but not used
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Bruce Allan, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

The ICR register is clear on read and we don't care what the returned value
is when resetting the hardware so the icr variable(s) can be removed.  We
should not ignore the return from e1000_lv_jumbo_workaround_ich8lan() and
from e1000_get_phy_id_82571() (dump a debug message when it fails and when
an unknown Phy id is returned).

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/82571.c   |   21 ++++++++++++++-------
 drivers/net/e1000e/es2lan.c  |    4 ++--
 drivers/net/e1000e/ich8lan.c |    4 ++--
 drivers/net/e1000e/netdev.c  |    3 +++
 4 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index e57e409..11a273e 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -121,29 +121,36 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
 
 	/* This can only be done after all function pointers are setup. */
 	ret_val = e1000_get_phy_id_82571(hw);
+	if (ret_val) {
+		e_dbg("Error getting PHY ID\n");
+		return ret_val;
+	}
 
 	/* Verify phy id */
 	switch (hw->mac.type) {
 	case e1000_82571:
 	case e1000_82572:
 		if (phy->id != IGP01E1000_I_PHY_ID)
-			return -E1000_ERR_PHY;
+			ret_val = -E1000_ERR_PHY;
 		break;
 	case e1000_82573:
 		if (phy->id != M88E1111_I_PHY_ID)
-			return -E1000_ERR_PHY;
+			ret_val = -E1000_ERR_PHY;
 		break;
 	case e1000_82574:
 	case e1000_82583:
 		if (phy->id != BME1000_E_PHY_ID_R2)
-			return -E1000_ERR_PHY;
+			ret_val = -E1000_ERR_PHY;
 		break;
 	default:
-		return -E1000_ERR_PHY;
+		ret_val = -E1000_ERR_PHY;
 		break;
 	}
 
-	return 0;
+	if (ret_val)
+		e_dbg("PHY ID unknown: type = 0x%08x\n", phy->id);
+
+	return ret_val;
 }
 
 /**
@@ -956,7 +963,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
  **/
 static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 {
-	u32 ctrl, ctrl_ext, icr;
+	u32 ctrl, ctrl_ext;
 	s32 ret_val;
 
 	/*
@@ -1040,7 +1047,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 
 	/* Clear any pending interrupt events. */
 	ew32(IMC, 0xffffffff);
-	icr = er32(ICR);
+	er32(ICR);
 
 	if (hw->mac.type == e1000_82571) {
 		/* Install any alternate MAC address into RAR0 */
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
index b18c644..e45a61c 100644
--- a/drivers/net/e1000e/es2lan.c
+++ b/drivers/net/e1000e/es2lan.c
@@ -784,7 +784,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
  **/
 static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 {
-	u32 ctrl, icr;
+	u32 ctrl;
 	s32 ret_val;
 
 	/*
@@ -818,7 +818,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 
 	/* Clear any pending interrupt events. */
 	ew32(IMC, 0xffffffff);
-	icr = er32(ICR);
+	er32(ICR);
 
 	ret_val = e1000_check_alt_mac_addr_generic(hw);
 
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index d86cc08..754590d 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -2977,7 +2977,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 {
 	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
 	u16 reg;
-	u32 ctrl, icr, kab;
+	u32 ctrl, kab;
 	s32 ret_val;
 
 	/*
@@ -3067,7 +3067,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 		ew32(CRC_OFFSET, 0x65656565);
 
 	ew32(IMC, 0xffffffff);
-	icr = er32(ICR);
+	er32(ICR);
 
 	kab = er32(KABGTXD);
 	kab |= E1000_KABGTXD_BGSQLBIAS;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index fe50242..5498689 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2734,6 +2734,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
 			ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
 		else
 			ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
+
+		if (ret_val)
+			e_dbg("failed to enable jumbo frame workaround mode\n");
 	}
 
 	/* Program MC offset vector base */
-- 
1.7.3.4


^ permalink raw reply related

* [net-next 02/12] e1000e: convert calls of ops.[read|write]_reg to e1e_[r|w]phy
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Bruce Allan, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

Cleans up the code a bit by using the driver-specific e1e_rphy and
e1e_wphy macros instead of the full function pointer variants.  Fix
a couple whitespace issue with two already existing calls to e1e_wphy.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/ich8lan.c |   54 +++++++++++++++++++----------------------
 drivers/net/e1000e/lib.c     |    3 +-
 drivers/net/e1000e/phy.c     |   40 +++++++++++++------------------
 3 files changed, 44 insertions(+), 53 deletions(-)

diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 754590d..902e493 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -3118,7 +3118,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 	 * Reset the phy after disabling host wakeup to reset the Rx buffer.
 	 */
 	if (hw->phy.type == e1000_phy_82578) {
-		hw->phy.ops.read_reg(hw, BM_WUC, &i);
+		e1e_rphy(hw, BM_WUC, &i);
 		ret_val = e1000_phy_hw_reset_ich8lan(hw);
 		if (ret_val)
 			return ret_val;
@@ -3276,9 +3276,8 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
 	    (hw->phy.type == e1000_phy_82577)) {
 		ew32(FCRTV_PCH, hw->fc.refresh_time);
 
-		ret_val = hw->phy.ops.write_reg(hw,
-		                             PHY_REG(BM_PORT_CTRL_PAGE, 27),
-		                             hw->fc.pause_time);
+		ret_val = e1e_wphy(hw, PHY_REG(BM_PORT_CTRL_PAGE, 27),
+				   hw->fc.pause_time);
 		if (ret_val)
 			return ret_val;
 	}
@@ -3342,8 +3341,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
 			return ret_val;
 		break;
 	case e1000_phy_ife:
-		ret_val = hw->phy.ops.read_reg(hw, IFE_PHY_MDIX_CONTROL,
-		                               &reg_data);
+		ret_val = e1e_rphy(hw, IFE_PHY_MDIX_CONTROL, &reg_data);
 		if (ret_val)
 			return ret_val;
 
@@ -3361,8 +3359,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
 			reg_data |= IFE_PMC_AUTO_MDIX;
 			break;
 		}
-		ret_val = hw->phy.ops.write_reg(hw, IFE_PHY_MDIX_CONTROL,
-		                                reg_data);
+		ret_val = e1e_wphy(hw, IFE_PHY_MDIX_CONTROL, reg_data);
 		if (ret_val)
 			return ret_val;
 		break;
@@ -3646,7 +3643,8 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
 {
 	if (hw->phy.type == e1000_phy_ife)
 		return e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED,
-			       (IFE_PSCL_PROBE_MODE | IFE_PSCL_PROBE_LEDS_OFF));
+				(IFE_PSCL_PROBE_MODE |
+				 IFE_PSCL_PROBE_LEDS_OFF));
 
 	ew32(LEDCTL, hw->mac.ledctl_mode1);
 	return 0;
@@ -3660,8 +3658,7 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
  **/
 static s32 e1000_setup_led_pchlan(struct e1000_hw *hw)
 {
-	return hw->phy.ops.write_reg(hw, HV_LED_CONFIG,
-					(u16)hw->mac.ledctl_mode1);
+	return e1e_wphy(hw, HV_LED_CONFIG, (u16)hw->mac.ledctl_mode1);
 }
 
 /**
@@ -3672,8 +3669,7 @@ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw)
  **/
 static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw)
 {
-	return hw->phy.ops.write_reg(hw, HV_LED_CONFIG,
-					(u16)hw->mac.ledctl_default);
+	return e1e_wphy(hw, HV_LED_CONFIG, (u16)hw->mac.ledctl_default);
 }
 
 /**
@@ -3704,7 +3700,7 @@ static s32 e1000_led_on_pchlan(struct e1000_hw *hw)
 		}
 	}
 
-	return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data);
+	return e1e_wphy(hw, HV_LED_CONFIG, data);
 }
 
 /**
@@ -3735,7 +3731,7 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw)
 		}
 	}
 
-	return hw->phy.ops.write_reg(hw, HV_LED_CONFIG, data);
+	return e1e_wphy(hw, HV_LED_CONFIG, data);
 }
 
 /**
@@ -3844,20 +3840,20 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
 	if ((hw->phy.type == e1000_phy_82578) ||
 	    (hw->phy.type == e1000_phy_82579) ||
 	    (hw->phy.type == e1000_phy_82577)) {
-		hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_ECOL_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_ECOL_LOWER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_MCC_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_MCC_LOWER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_LATECOL_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_LATECOL_LOWER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_COLC_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_COLC_LOWER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_DC_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_DC_LOWER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_TNCRS_UPPER, &phy_data);
-		hw->phy.ops.read_reg(hw, HV_TNCRS_LOWER, &phy_data);
+		e1e_rphy(hw, HV_SCC_UPPER, &phy_data);
+		e1e_rphy(hw, HV_SCC_LOWER, &phy_data);
+		e1e_rphy(hw, HV_ECOL_UPPER, &phy_data);
+		e1e_rphy(hw, HV_ECOL_LOWER, &phy_data);
+		e1e_rphy(hw, HV_MCC_UPPER, &phy_data);
+		e1e_rphy(hw, HV_MCC_LOWER, &phy_data);
+		e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data);
+		e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data);
+		e1e_rphy(hw, HV_COLC_UPPER, &phy_data);
+		e1e_rphy(hw, HV_COLC_LOWER, &phy_data);
+		e1e_rphy(hw, HV_DC_UPPER, &phy_data);
+		e1e_rphy(hw, HV_DC_LOWER, &phy_data);
+		e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data);
+		e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data);
 	}
 }
 
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 7e55170..ff28721 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -1135,7 +1135,8 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
 		ret_val = e1e_rphy(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg);
 		if (ret_val)
 			return ret_val;
-		ret_val = e1e_rphy(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg);
+		ret_val =
+		    e1e_rphy(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg);
 		if (ret_val)
 			return ret_val;
 
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
index 1781efe..a640f1c 100644
--- a/drivers/net/e1000e/phy.c
+++ b/drivers/net/e1000e/phy.c
@@ -637,12 +637,11 @@ s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data)
  **/
 s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
 {
-	struct e1000_phy_info *phy = &hw->phy;
 	s32 ret_val;
 	u16 phy_data;
 
 	/* Enable CRS on TX. This must be set for half-duplex operation. */
-	ret_val = phy->ops.read_reg(hw, I82577_CFG_REG, &phy_data);
+	ret_val = e1e_rphy(hw, I82577_CFG_REG, &phy_data);
 	if (ret_val)
 		goto out;
 
@@ -651,7 +650,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
 	/* Enable downshift */
 	phy_data |= I82577_CFG_ENABLE_DOWNSHIFT;
 
-	ret_val = phy->ops.write_reg(hw, I82577_CFG_REG, phy_data);
+	ret_val = e1e_wphy(hw, I82577_CFG_REG, phy_data);
 
 out:
 	return ret_val;
@@ -774,16 +773,14 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
 	}
 
 	if (phy->type == e1000_phy_82578) {
-		ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
-		                            &phy_data);
+		ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
 		if (ret_val)
 			return ret_val;
 
 		/* 82578 PHY - set the downshift count to 1x. */
 		phy_data |= I82578_EPSCR_DOWNSHIFT_ENABLE;
 		phy_data &= ~I82578_EPSCR_DOWNSHIFT_COUNTER_MASK;
-		ret_val = phy->ops.write_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
-		                             phy_data);
+		ret_val = e1e_wphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data);
 		if (ret_val)
 			return ret_val;
 	}
@@ -1319,9 +1316,8 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
 				 * We didn't get link.
 				 * Reset the DSP and cross our fingers.
 				 */
-				ret_val = e1e_wphy(hw,
-						M88E1000_PHY_PAGE_SELECT,
-						0x001d);
+				ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT,
+						   0x001d);
 				if (ret_val)
 					return ret_val;
 				ret_val = e1000e_phy_reset_dsp(hw);
@@ -3071,12 +3067,12 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
 		goto out;
 
 	/* Do not apply workaround if in PHY loopback bit 14 set */
-	hw->phy.ops.read_reg(hw, PHY_CONTROL, &data);
+	e1e_rphy(hw, PHY_CONTROL, &data);
 	if (data & PHY_CONTROL_LB)
 		goto out;
 
 	/* check if link is up and at 1Gbps */
-	ret_val = hw->phy.ops.read_reg(hw, BM_CS_STATUS, &data);
+	ret_val = e1e_rphy(hw, BM_CS_STATUS, &data);
 	if (ret_val)
 		goto out;
 
@@ -3092,14 +3088,12 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
 	mdelay(200);
 
 	/* flush the packets in the fifo buffer */
-	ret_val = hw->phy.ops.write_reg(hw, HV_MUX_DATA_CTRL,
-	                                HV_MUX_DATA_CTRL_GEN_TO_MAC |
-	                                HV_MUX_DATA_CTRL_FORCE_SPEED);
+	ret_val = e1e_wphy(hw, HV_MUX_DATA_CTRL, HV_MUX_DATA_CTRL_GEN_TO_MAC |
+			   HV_MUX_DATA_CTRL_FORCE_SPEED);
 	if (ret_val)
 		goto out;
 
-	ret_val = hw->phy.ops.write_reg(hw, HV_MUX_DATA_CTRL,
-	                                HV_MUX_DATA_CTRL_GEN_TO_MAC);
+	ret_val = e1e_wphy(hw, HV_MUX_DATA_CTRL, HV_MUX_DATA_CTRL_GEN_TO_MAC);
 
 out:
 	return ret_val;
@@ -3119,7 +3113,7 @@ s32 e1000_check_polarity_82577(struct e1000_hw *hw)
 	s32 ret_val;
 	u16 data;
 
-	ret_val = phy->ops.read_reg(hw, I82577_PHY_STATUS_2, &data);
+	ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data);
 
 	if (!ret_val)
 		phy->cable_polarity = (data & I82577_PHY_STATUS2_REV_POLARITY)
@@ -3142,13 +3136,13 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
 	u16 phy_data;
 	bool link;
 
-	ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
+	ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
 	if (ret_val)
 		goto out;
 
 	e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
 
-	ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
+	ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
 	if (ret_val)
 		goto out;
 
@@ -3212,7 +3206,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
 	if (ret_val)
 		goto out;
 
-	ret_val = phy->ops.read_reg(hw, I82577_PHY_STATUS_2, &data);
+	ret_val = e1e_rphy(hw, I82577_PHY_STATUS_2, &data);
 	if (ret_val)
 		goto out;
 
@@ -3224,7 +3218,7 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
 		if (ret_val)
 			goto out;
 
-		ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, &data);
+		ret_val = e1e_rphy(hw, PHY_1000T_STATUS, &data);
 		if (ret_val)
 			goto out;
 
@@ -3258,7 +3252,7 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw)
 	s32 ret_val;
 	u16 phy_data, length;
 
-	ret_val = phy->ops.read_reg(hw, I82577_PHY_DIAG_STATUS, &phy_data);
+	ret_val = e1e_rphy(hw, I82577_PHY_DIAG_STATUS, &phy_data);
 	if (ret_val)
 		goto out;
 
-- 
1.7.3.4


^ permalink raw reply related

* [net-next 04/12] e1000e: use either_crc_le() rather than re-write it
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Bruce Allan, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

For the 82579 jumbo frame workaround, there is no need to re-write the CRC
calculation functionality already found in the kernel's ether_crc_le().

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/e1000.h   |    1 +
 drivers/net/e1000e/ich8lan.c |   19 +------------------
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 2c913b8..4b3802a 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -38,6 +38,7 @@
 #include <linux/netdevice.h>
 #include <linux/pci.h>
 #include <linux/pci-aspm.h>
+#include <linux/crc32.h>
 
 #include "hw.h"
 
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 902e493..5328a292 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -1395,22 +1395,6 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw)
 	}
 }
 
-static u32 e1000_calc_rx_da_crc(u8 mac[])
-{
-	u32 poly = 0xEDB88320;	/* Polynomial for 802.3 CRC calculation */
-	u32 i, j, mask, crc;
-
-	crc = 0xffffffff;
-	for (i = 0; i < 6; i++) {
-		crc = crc ^ mac[i];
-		for (j = 8; j > 0; j--) {
-			mask = (crc & 1) * (-1);
-			crc = (crc >> 1) ^ (poly & mask);
-		}
-	}
-	return ~crc;
-}
-
 /**
  *  e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation
  *  with 82579 PHY
@@ -1453,8 +1437,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
 			mac_addr[4] = (addr_high & 0xFF);
 			mac_addr[5] = ((addr_high >> 8) & 0xFF);
 
-			ew32(PCH_RAICC(i),
-					e1000_calc_rx_da_crc(mac_addr));
+			ew32(PCH_RAICC(i), ~ether_crc_le(ETH_ALEN, mac_addr));
 		}
 
 		/* Write Rx addresses to the PHY */
-- 
1.7.3.4


^ permalink raw reply related

* [net-next 03/12] e1000e: properly bounds-check string functions
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Bruce Allan, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

Use string functions with bounds checking rather than their non-bounds
checking counterparts, and do not hard code these boundaries.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/ethtool.c |   14 +++++++++-----
 drivers/net/e1000e/netdev.c  |    4 ++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index affcacf..c942cca 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -624,20 +624,24 @@ static void e1000_get_drvinfo(struct net_device *netdev,
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 	char firmware_version[32];
 
-	strncpy(drvinfo->driver,  e1000e_driver_name, 32);
-	strncpy(drvinfo->version, e1000e_driver_version, 32);
+	strncpy(drvinfo->driver,  e1000e_driver_name,
+		sizeof(drvinfo->driver) - 1);
+	strncpy(drvinfo->version, e1000e_driver_version,
+		sizeof(drvinfo->version) - 1);
 
 	/*
 	 * EEPROM image version # is reported as firmware version # for
 	 * PCI-E controllers
 	 */
-	sprintf(firmware_version, "%d.%d-%d",
+	snprintf(firmware_version, sizeof(firmware_version), "%d.%d-%d",
 		(adapter->eeprom_vers & 0xF000) >> 12,
 		(adapter->eeprom_vers & 0x0FF0) >> 4,
 		(adapter->eeprom_vers & 0x000F));
 
-	strncpy(drvinfo->fw_version, firmware_version, 32);
-	strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
+	strncpy(drvinfo->fw_version, firmware_version,
+		sizeof(drvinfo->fw_version) - 1);
+	strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
+		sizeof(drvinfo->bus_info) - 1);
 	drvinfo->regdump_len = e1000_get_regs_len(netdev);
 	drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
 }
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 5498689..98729a6 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5639,7 +5639,7 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
 	ret_val = e1000_read_pba_string_generic(hw, pba_str,
 						E1000_PBANUM_LENGTH);
 	if (ret_val)
-		strcpy(pba_str, "Unknown");
+		strncpy((char *)pba_str, "Unknown", sizeof(pba_str) - 1);
 	e_info("MAC: %d, PHY: %d, PBA No: %s\n",
 	       hw->mac.type, hw->phy.type, pba_str);
 }
@@ -5968,7 +5968,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	if (!(adapter->flags & FLAG_HAS_AMT))
 		e1000_get_hw_control(adapter);
 
-	strcpy(netdev->name, "eth%d");
+	strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1);
 	err = register_netdev(netdev);
 	if (err)
 		goto err_register;
-- 
1.7.3.4


^ permalink raw reply related

* [net-next 05/12] e1000e: power off PHY after reset when interface is down
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Bruce Allan, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

Some Phys supported by the driver do not remain powered off across a reset
of the device when the interface is down, e.g. on 82571, but not on 82574.
This patch powers down (only when WoL is disabled) the PHY after a reset if
the interface is down and the ethtool diagnostics are not currently running.

The ethtool diagnostic function required a minor re-factor as a result, and
the e1000_[get|put]_hw_control() functions are renamed since they are no
longer static to netdev.c as they are needed by the ethtool diagnostics.
A couple minor whitespace issues were cleaned up, too.

Reported-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/e1000.h   |    2 +
 drivers/net/e1000e/ethtool.c |   40 ++++++++++++++++++++++-------------
 drivers/net/e1000e/netdev.c  |   46 +++++++++++++++++++++++------------------
 3 files changed, 53 insertions(+), 35 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 4b3802a..5255be7 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -497,6 +497,8 @@ extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
 extern void e1000e_update_stats(struct e1000_adapter *adapter);
 extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
 extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
+extern void e1000e_get_hw_control(struct e1000_adapter *adapter);
+extern void e1000e_release_hw_control(struct e1000_adapter *adapter);
 extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
 
 extern unsigned int copybreak;
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index c942cca..f8ed03d 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1708,6 +1708,19 @@ static void e1000_diag_test(struct net_device *netdev,
 	bool if_running = netif_running(netdev);
 
 	set_bit(__E1000_TESTING, &adapter->state);
+
+	if (!if_running) {
+		/* Get control of and reset hardware */
+		if (adapter->flags & FLAG_HAS_AMT)
+			e1000e_get_hw_control(adapter);
+
+		e1000e_power_up_phy(adapter);
+
+		adapter->hw.phy.autoneg_wait_to_complete = 1;
+		e1000e_reset(adapter);
+		adapter->hw.phy.autoneg_wait_to_complete = 0;
+	}
+
 	if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
 		/* Offline tests */
 
@@ -1721,8 +1734,6 @@ static void e1000_diag_test(struct net_device *netdev,
 		if (if_running)
 			/* indicate we're in test mode */
 			dev_close(netdev);
-		else
-			e1000e_reset(adapter);
 
 		if (e1000_reg_test(adapter, &data[0]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
@@ -1736,8 +1747,6 @@ static void e1000_diag_test(struct net_device *netdev,
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
 		e1000e_reset(adapter);
-		/* make sure the phy is powered up */
-		e1000e_power_up_phy(adapter);
 		if (e1000_loopback_test(adapter, &data[3]))
 			eth_test->flags |= ETH_TEST_FL_FAILED;
 
@@ -1759,28 +1768,29 @@ static void e1000_diag_test(struct net_device *netdev,
 		if (if_running)
 			dev_open(netdev);
 	} else {
-		if (!if_running && (adapter->flags & FLAG_HAS_AMT)) {
-			clear_bit(__E1000_TESTING, &adapter->state);
-			dev_open(netdev);
-			set_bit(__E1000_TESTING, &adapter->state);
-		}
+		/* Online tests */
 
 		e_info("online testing starting\n");
-		/* Online tests */
-		if (e1000_link_test(adapter, &data[4]))
-			eth_test->flags |= ETH_TEST_FL_FAILED;
 
-		/* Online tests aren't run; pass by default */
+		/* register, eeprom, intr and loopback tests not run online */
 		data[0] = 0;
 		data[1] = 0;
 		data[2] = 0;
 		data[3] = 0;
 
-		if (!if_running && (adapter->flags & FLAG_HAS_AMT))
-			dev_close(netdev);
+		if (e1000_link_test(adapter, &data[4]))
+			eth_test->flags |= ETH_TEST_FL_FAILED;
 
 		clear_bit(__E1000_TESTING, &adapter->state);
 	}
+
+	if (!if_running) {
+		e1000e_reset(adapter);
+
+		if (adapter->flags & FLAG_HAS_AMT)
+			e1000e_release_hw_control(adapter);
+	}
+
 	msleep_interruptible(4 * 1000);
 }
 
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 98729a6..fa5b604 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1980,15 +1980,15 @@ static void e1000_irq_enable(struct e1000_adapter *adapter)
 }
 
 /**
- * e1000_get_hw_control - get control of the h/w from f/w
+ * e1000e_get_hw_control - get control of the h/w from f/w
  * @adapter: address of board private structure
  *
- * e1000_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit.
+ * e1000e_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit.
  * For ASF and Pass Through versions of f/w this means that
  * the driver is loaded. For AMT version (only with 82573)
  * of the f/w this means that the network i/f is open.
  **/
-static void e1000_get_hw_control(struct e1000_adapter *adapter)
+void e1000e_get_hw_control(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	u32 ctrl_ext;
@@ -2005,16 +2005,16 @@ static void e1000_get_hw_control(struct e1000_adapter *adapter)
 }
 
 /**
- * e1000_release_hw_control - release control of the h/w to f/w
+ * e1000e_release_hw_control - release control of the h/w to f/w
  * @adapter: address of board private structure
  *
- * e1000_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit.
+ * e1000e_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit.
  * For ASF and Pass Through versions of f/w this means that the
  * driver is no longer loaded. For AMT version (only with 82573) i
  * of the f/w this means that the network i/f is closed.
  *
  **/
-static void e1000_release_hw_control(struct e1000_adapter *adapter)
+void e1000e_release_hw_control(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	u32 ctrl_ext;
@@ -2445,7 +2445,7 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
 	     E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
 	    (vid == adapter->mng_vlan_id)) {
 		/* release control to f/w */
-		e1000_release_hw_control(adapter);
+		e1000e_release_hw_control(adapter);
 		return;
 	}
 
@@ -3187,7 +3187,6 @@ void e1000e_reset(struct e1000_adapter *adapter)
 		ew32(PBA, pba);
 	}
 
-
 	/*
 	 * flow control settings
 	 *
@@ -3275,7 +3274,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
 	 * that the network interface is in control
 	 */
 	if (adapter->flags & FLAG_HAS_AMT)
-		e1000_get_hw_control(adapter);
+		e1000e_get_hw_control(adapter);
 
 	ew32(WUC, 0);
 
@@ -3288,6 +3287,13 @@ void e1000e_reset(struct e1000_adapter *adapter)
 	ew32(VET, ETH_P_8021Q);
 
 	e1000e_reset_adaptive(hw);
+
+	if (!netif_running(adapter->netdev) &&
+	    !test_bit(__E1000_TESTING, &adapter->state)) {
+		e1000_power_down_phy(adapter);
+		return;
+	}
+
 	e1000_get_phy_info(hw);
 
 	if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) &&
@@ -3573,7 +3579,7 @@ static int e1000_open(struct net_device *netdev)
 	 * interface is now open and reset the part to a known state.
 	 */
 	if (adapter->flags & FLAG_HAS_AMT) {
-		e1000_get_hw_control(adapter);
+		e1000e_get_hw_control(adapter);
 		e1000e_reset(adapter);
 	}
 
@@ -3637,7 +3643,7 @@ static int e1000_open(struct net_device *netdev)
 	return 0;
 
 err_req_irq:
-	e1000_release_hw_control(adapter);
+	e1000e_release_hw_control(adapter);
 	e1000_power_down_phy(adapter);
 	e1000e_free_rx_resources(adapter);
 err_setup_rx:
@@ -3692,8 +3698,9 @@ static int e1000_close(struct net_device *netdev)
 	 * If AMT is enabled, let the firmware know that the network
 	 * interface is now closed
 	 */
-	if (adapter->flags & FLAG_HAS_AMT)
-		e1000_release_hw_control(adapter);
+	if ((adapter->flags & FLAG_HAS_AMT) &&
+	    !test_bit(__E1000_TESTING, &adapter->state))
+		e1000e_release_hw_control(adapter);
 
 	if ((adapter->flags & FLAG_HAS_ERT) ||
 	    (adapter->hw.mac.type == e1000_pch2lan))
@@ -5212,7 +5219,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
 	 * Release control of h/w to f/w.  If f/w is AMT enabled, this
 	 * would have already happened in close and is redundant.
 	 */
-	e1000_release_hw_control(adapter);
+	e1000e_release_hw_control(adapter);
 
 	pci_disable_device(pdev);
 
@@ -5369,7 +5376,7 @@ static int __e1000_resume(struct pci_dev *pdev)
 	 * under the control of the driver.
 	 */
 	if (!(adapter->flags & FLAG_HAS_AMT))
-		e1000_get_hw_control(adapter);
+		e1000e_get_hw_control(adapter);
 
 	return 0;
 }
@@ -5616,7 +5623,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
 	 * under the control of the driver.
 	 */
 	if (!(adapter->flags & FLAG_HAS_AMT))
-		e1000_get_hw_control(adapter);
+		e1000e_get_hw_control(adapter);
 
 }
 
@@ -5966,7 +5973,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	 * under the control of the driver.
 	 */
 	if (!(adapter->flags & FLAG_HAS_AMT))
-		e1000_get_hw_control(adapter);
+		e1000e_get_hw_control(adapter);
 
 	strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1);
 	err = register_netdev(netdev);
@@ -5985,12 +5992,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 
 err_register:
 	if (!(adapter->flags & FLAG_HAS_AMT))
-		e1000_release_hw_control(adapter);
+		e1000e_release_hw_control(adapter);
 err_eeprom:
 	if (!e1000_check_reset_block(&adapter->hw))
 		e1000_phy_hw_reset(&adapter->hw);
 err_hw_init:
-
 	kfree(adapter->tx_ring);
 	kfree(adapter->rx_ring);
 err_sw_init:
@@ -6056,7 +6062,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
 	 * Release control of h/w to f/w.  If f/w is AMT enabled, this
 	 * would have already happened in close and is redundant.
 	 */
-	e1000_release_hw_control(adapter);
+	e1000e_release_hw_control(adapter);
 
 	e1000e_reset_interrupt_capability(adapter);
 	kfree(adapter->tx_ring);
-- 
1.7.3.4


^ permalink raw reply related

* [net-next 06/12] e1000e: add custom set_d[0|3]_lplu_state function pointer for 82574
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Bruce Allan, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

82574 needs to configure Low Power Link Up (or LPLU) differently than
the other parts in the 8257x family supported by the driver.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/82571.c |   56 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/e1000e/hw.h    |    1 +
 2 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index 11a273e..cb6c7b1 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -78,6 +78,8 @@ static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
 static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
 static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
 static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
+static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active);
+static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active);
 
 /**
  *  e1000_init_phy_params_82571 - Init PHY func ptrs.
@@ -113,6 +115,8 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
 		phy->type		 = e1000_phy_bm;
 		phy->ops.acquire = e1000_get_hw_semaphore_82574;
 		phy->ops.release = e1000_put_hw_semaphore_82574;
+		phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82574;
+		phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
 		break;
 	default:
 		return -E1000_ERR_PHY;
@@ -656,6 +660,58 @@ static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw)
 }
 
 /**
+ *  e1000_set_d0_lplu_state_82574 - Set Low Power Linkup D0 state
+ *  @hw: pointer to the HW structure
+ *  @active: true to enable LPLU, false to disable
+ *
+ *  Sets the LPLU D0 state according to the active flag.
+ *  LPLU will not be activated unless the
+ *  device autonegotiation advertisement meets standards of
+ *  either 10 or 10/100 or 10/100/1000 at all duplexes.
+ *  This is a function pointer entry point only called by
+ *  PHY setup routines.
+ **/
+static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active)
+{
+	u16 data = er32(POEMB);
+
+	if (active)
+		data |= E1000_PHY_CTRL_D0A_LPLU;
+	else
+		data &= ~E1000_PHY_CTRL_D0A_LPLU;
+
+	ew32(POEMB, data);
+	return 0;
+}
+
+/**
+ *  e1000_set_d3_lplu_state_82574 - Sets low power link up state for D3
+ *  @hw: pointer to the HW structure
+ *  @active: boolean used to enable/disable lplu
+ *
+ *  The low power link up (lplu) state is set to the power management level D3
+ *  when active is true, else clear lplu for D3. LPLU
+ *  is used during Dx states where the power conservation is most important.
+ *  During driver activity, SmartSpeed should be enabled so performance is
+ *  maintained.
+ **/
+static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active)
+{
+	u16 data = er32(POEMB);
+
+	if (!active) {
+		data &= ~E1000_PHY_CTRL_NOND0A_LPLU;
+	} else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
+		   (hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) ||
+		   (hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) {
+		data |= E1000_PHY_CTRL_NOND0A_LPLU;
+	}
+
+	ew32(POEMB, data);
+	return 0;
+}
+
+/**
  *  e1000_acquire_nvm_82571 - Request for access to the EEPROM
  *  @hw: pointer to the HW structure
  *
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index ba302a5..e774380 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -83,6 +83,7 @@ enum e1e_registers {
 	E1000_EXTCNF_CTRL  = 0x00F00, /* Extended Configuration Control */
 	E1000_EXTCNF_SIZE  = 0x00F08, /* Extended Configuration Size */
 	E1000_PHY_CTRL     = 0x00F10, /* PHY Control Register in CSR */
+#define E1000_POEMB	E1000_PHY_CTRL	/* PHY OEM Bits */
 	E1000_PBA      = 0x01000, /* Packet Buffer Allocation - RW */
 	E1000_PBS      = 0x01008, /* Packet Buffer Size */
 	E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */
-- 
1.7.3.4


^ permalink raw reply related

* [net-next 07/12] e1000: Add support for the CE4100 reference platform
From: jeffrey.t.kirsher @ 2011-01-07  0:29 UTC (permalink / raw)
  To: davem, davem; +Cc: Dirk Brandewie, netdev, gosp, bphilips, Jeff Kirsher
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Dirk Brandewie <dirk.j.brandewie@intel.com>

This patch adds support for the gigabit phys present on the CE4100 reference
platforms.

Signed-off-by:  Dirk Brandewie <dirk.j.brandewie@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000/e1000_hw.c    |  328 +++++++++++++++++++++++++++++++--------
 drivers/net/e1000/e1000_hw.h    |   59 +++++++-
 drivers/net/e1000/e1000_main.c  |   35 ++++
 drivers/net/e1000/e1000_osdep.h |   19 ++-
 4 files changed, 365 insertions(+), 76 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 77d08e6..aed223b 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -130,10 +130,15 @@ static s32 e1000_set_phy_type(struct e1000_hw *hw)
 		if (hw->mac_type == e1000_82541 ||
 		    hw->mac_type == e1000_82541_rev_2 ||
 		    hw->mac_type == e1000_82547 ||
-		    hw->mac_type == e1000_82547_rev_2) {
+		    hw->mac_type == e1000_82547_rev_2)
 			hw->phy_type = e1000_phy_igp;
-			break;
-		}
+		break;
+	case RTL8211B_PHY_ID:
+		hw->phy_type = e1000_phy_8211;
+		break;
+	case RTL8201N_PHY_ID:
+		hw->phy_type = e1000_phy_8201;
+		break;
 	default:
 		/* Should never have loaded on this device */
 		hw->phy_type = e1000_phy_undefined;
@@ -318,6 +323,9 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_82547GI:
 		hw->mac_type = e1000_82547_rev_2;
 		break;
+	case E1000_DEV_ID_INTEL_CE4100_GBE:
+		hw->mac_type = e1000_ce4100;
+		break;
 	default:
 		/* Should never have loaded on this device */
 		return -E1000_ERR_MAC_TYPE;
@@ -372,6 +380,9 @@ void e1000_set_media_type(struct e1000_hw *hw)
 		case e1000_82542_rev2_1:
 			hw->media_type = e1000_media_type_fiber;
 			break;
+		case e1000_ce4100:
+			hw->media_type = e1000_media_type_copper;
+			break;
 		default:
 			status = er32(STATUS);
 			if (status & E1000_STATUS_TBIMODE) {
@@ -460,6 +471,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
 		/* Reset is performed on a shadow of the control register */
 		ew32(CTRL_DUP, (ctrl | E1000_CTRL_RST));
 		break;
+	case e1000_ce4100:
 	default:
 		ew32(CTRL, (ctrl | E1000_CTRL_RST));
 		break;
@@ -952,6 +964,67 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw)
 }
 
 /**
+ * e1000_copper_link_rtl_setup - Copper link setup for e1000_phy_rtl series.
+ * @hw: Struct containing variables accessed by shared code
+ *
+ * Commits changes to PHY configuration by calling e1000_phy_reset().
+ */
+static s32 e1000_copper_link_rtl_setup(struct e1000_hw *hw)
+{
+	s32 ret_val;
+
+	/* SW reset the PHY so all changes take effect */
+	ret_val = e1000_phy_reset(hw);
+	if (ret_val) {
+		e_dbg("Error Resetting the PHY\n");
+		return ret_val;
+	}
+
+	return E1000_SUCCESS;
+}
+
+static s32 gbe_dhg_phy_setup(struct e1000_hw *hw)
+{
+	s32 ret_val;
+	u32 ctrl_aux;
+
+	switch (hw->phy_type) {
+	case e1000_phy_8211:
+		ret_val = e1000_copper_link_rtl_setup(hw);
+		if (ret_val) {
+			e_dbg("e1000_copper_link_rtl_setup failed!\n");
+			return ret_val;
+		}
+		break;
+	case e1000_phy_8201:
+		/* Set RMII mode */
+		ctrl_aux = er32(CTL_AUX);
+		ctrl_aux |= E1000_CTL_AUX_RMII;
+		ew32(CTL_AUX, ctrl_aux);
+		E1000_WRITE_FLUSH();
+
+		/* Disable the J/K bits required for receive */
+		ctrl_aux = er32(CTL_AUX);
+		ctrl_aux |= 0x4;
+		ctrl_aux &= ~0x2;
+		ew32(CTL_AUX, ctrl_aux);
+		E1000_WRITE_FLUSH();
+		ret_val = e1000_copper_link_rtl_setup(hw);
+
+		if (ret_val) {
+			e_dbg("e1000_copper_link_rtl_setup failed!\n");
+			return ret_val;
+		}
+		break;
+	default:
+		e_dbg("Error Resetting the PHY\n");
+		return E1000_ERR_PHY_TYPE;
+	}
+
+	return E1000_SUCCESS;
+}
+
+/**
  * e1000_copper_link_preconfig - early configuration for copper
  * @hw: Struct containing variables accessed by shared code
  *
@@ -1286,6 +1359,10 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
 	if (hw->autoneg_advertised == 0)
 		hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT;
 
+	/* IFE/RTL8201N PHY only supports 10/100 */
+	if (hw->phy_type == e1000_phy_8201)
+		hw->autoneg_advertised &= AUTONEG_ADVERTISE_10_100_ALL;
+
 	e_dbg("Reconfiguring auto-neg advertisement params\n");
 	ret_val = e1000_phy_setup_autoneg(hw);
 	if (ret_val) {
@@ -1341,7 +1418,7 @@ static s32 e1000_copper_link_postconfig(struct e1000_hw *hw)
 	s32 ret_val;
 	e_dbg("e1000_copper_link_postconfig");
 
-	if (hw->mac_type >= e1000_82544) {
+	if ((hw->mac_type >= e1000_82544) && (hw->mac_type != e1000_ce4100)) {
 		e1000_config_collision_dist(hw);
 	} else {
 		ret_val = e1000_config_mac_to_phy(hw);
@@ -1395,6 +1472,12 @@ static s32 e1000_setup_copper_link(struct e1000_hw *hw)
 		ret_val = e1000_copper_link_mgp_setup(hw);
 		if (ret_val)
 			return ret_val;
+	} else {
+		ret_val = gbe_dhg_phy_setup(hw);
+		if (ret_val) {
+			e_dbg("gbe_dhg_phy_setup failed!\n");
+			return ret_val;
+		}
 	}
 
 	if (hw->autoneg) {
@@ -1461,10 +1544,11 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
 		return ret_val;
 
 	/* Read the MII 1000Base-T Control Register (Address 9). */
-	ret_val =
-	    e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg);
+	ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg);
 	if (ret_val)
 		return ret_val;
+	else if (hw->phy_type == e1000_phy_8201)
+		mii_1000t_ctrl_reg &= ~REG9_SPEED_MASK;
 
 	/* Need to parse both autoneg_advertised and fc and set up
 	 * the appropriate PHY registers.  First we will parse for
@@ -1577,9 +1661,14 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
 
 	e_dbg("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
 
-	ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
-	if (ret_val)
-		return ret_val;
+	if (hw->phy_type == e1000_phy_8201) {
+		mii_1000t_ctrl_reg = 0;
+	} else {
+		ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL,
+		                              mii_1000t_ctrl_reg);
+		if (ret_val)
+			return ret_val;
+	}
 
 	return E1000_SUCCESS;
 }
@@ -1860,7 +1949,7 @@ static s32 e1000_config_mac_to_phy(struct e1000_hw *hw)
 
 	/* 82544 or newer MAC, Auto Speed Detection takes care of
 	 * MAC speed/duplex configuration.*/
-	if (hw->mac_type >= e1000_82544)
+	if ((hw->mac_type >= e1000_82544) && (hw->mac_type != e1000_ce4100))
 		return E1000_SUCCESS;
 
 	/* Read the Device Control Register and set the bits to Force Speed
@@ -1870,27 +1959,49 @@ static s32 e1000_config_mac_to_phy(struct e1000_hw *hw)
 	ctrl |= (E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
 	ctrl &= ~(E1000_CTRL_SPD_SEL | E1000_CTRL_ILOS);
 
-	/* Set up duplex in the Device Control and Transmit Control
-	 * registers depending on negotiated values.
-	 */
-	ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
-	if (ret_val)
-		return ret_val;
+	switch (hw->phy_type) {
+	case e1000_phy_8201:
+		ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data);
+		if (ret_val)
+			return ret_val;
 
-	if (phy_data & M88E1000_PSSR_DPLX)
-		ctrl |= E1000_CTRL_FD;
-	else
-		ctrl &= ~E1000_CTRL_FD;
+		if (phy_data & RTL_PHY_CTRL_FD)
+			ctrl |= E1000_CTRL_FD;
+		else
+			ctrl &= ~E1000_CTRL_FD;
 
-	e1000_config_collision_dist(hw);
+		if (phy_data & RTL_PHY_CTRL_SPD_100)
+			ctrl |= E1000_CTRL_SPD_100;
+		else
+			ctrl |= E1000_CTRL_SPD_10;
 
-	/* Set up speed in the Device Control register depending on
-	 * negotiated values.
-	 */
-	if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS)
-		ctrl |= E1000_CTRL_SPD_1000;
-	else if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_100MBS)
-		ctrl |= E1000_CTRL_SPD_100;
+		e1000_config_collision_dist(hw);
+		break;
+	default:
+		/* Set up duplex in the Device Control and Transmit Control
+		 * registers depending on negotiated values.
+		 */
+		ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS,
+		                             &phy_data);
+		if (ret_val)
+			return ret_val;
+
+		if (phy_data & M88E1000_PSSR_DPLX)
+			ctrl |= E1000_CTRL_FD;
+		else
+			ctrl &= ~E1000_CTRL_FD;
+
+		e1000_config_collision_dist(hw);
+
+		/* Set up speed in the Device Control register depending on
+		 * negotiated values.
+		 */
+		if ((phy_data & M88E1000_PSSR_SPEED) == M88E1000_PSSR_1000MBS)
+			ctrl |= E1000_CTRL_SPD_1000;
+		else if ((phy_data & M88E1000_PSSR_SPEED) ==
+		         M88E1000_PSSR_100MBS)
+			ctrl |= E1000_CTRL_SPD_100;
+	}
 
 	/* Write the configured values back to the Device Control Reg. */
 	ew32(CTRL, ctrl);
@@ -2401,7 +2512,8 @@ s32 e1000_check_for_link(struct e1000_hw *hw)
 		 * speed/duplex on the MAC to the current PHY speed/duplex
 		 * settings.
 		 */
-		if (hw->mac_type >= e1000_82544)
+		if ((hw->mac_type >= e1000_82544) &&
+		    (hw->mac_type != e1000_ce4100))
 			e1000_config_collision_dist(hw);
 		else {
 			ret_val = e1000_config_mac_to_phy(hw);
@@ -2738,7 +2850,7 @@ static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
 {
 	u32 i;
 	u32 mdic = 0;
-	const u32 phy_addr = 1;
+	const u32 phy_addr = (hw->mac_type == e1000_ce4100) ? hw->phy_addr : 1;
 
 	e_dbg("e1000_read_phy_reg_ex");
 
@@ -2752,28 +2864,61 @@ static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
 		 * Control register.  The MAC will take care of interfacing with the
 		 * PHY to retrieve the desired data.
 		 */
-		mdic = ((reg_addr << E1000_MDIC_REG_SHIFT) |
-			(phy_addr << E1000_MDIC_PHY_SHIFT) |
-			(E1000_MDIC_OP_READ));
+		if (hw->mac_type == e1000_ce4100) {
+			mdic = ((reg_addr << E1000_MDIC_REG_SHIFT) |
+				(phy_addr << E1000_MDIC_PHY_SHIFT) |
+				(INTEL_CE_GBE_MDIC_OP_READ) |
+				(INTEL_CE_GBE_MDIC_GO));
 
-		ew32(MDIC, mdic);
+			writel(mdic, E1000_MDIO_CMD);
 
-		/* Poll the ready bit to see if the MDI read completed */
-		for (i = 0; i < 64; i++) {
-			udelay(50);
-			mdic = er32(MDIC);
-			if (mdic & E1000_MDIC_READY)
-				break;
-		}
-		if (!(mdic & E1000_MDIC_READY)) {
-			e_dbg("MDI Read did not complete\n");
-			return -E1000_ERR_PHY;
-		}
-		if (mdic & E1000_MDIC_ERROR) {
-			e_dbg("MDI Error\n");
-			return -E1000_ERR_PHY;
+			/* Poll the ready bit to see if the MDI read
+			 * completed
+			 */
+			for (i = 0; i < 64; i++) {
+				udelay(50);
+				mdic = readl(E1000_MDIO_CMD);
+				if (!(mdic & INTEL_CE_GBE_MDIC_GO))
+					break;
+			}
+
+			if (mdic & INTEL_CE_GBE_MDIC_GO) {
+				e_dbg("MDI Read did not complete\n");
+				return -E1000_ERR_PHY;
+			}
+
+			mdic = readl(E1000_MDIO_STS);
+			if (mdic & INTEL_CE_GBE_MDIC_READ_ERROR) {
+				e_dbg("MDI Read Error\n");
+				return -E1000_ERR_PHY;
+			}
+			*phy_data = (u16) mdic;
+		} else {
+			mdic = ((reg_addr << E1000_MDIC_REG_SHIFT) |
+				(phy_addr << E1000_MDIC_PHY_SHIFT) |
+				(E1000_MDIC_OP_READ));
+
+			ew32(MDIC, mdic);
+
+			/* Poll the ready bit to see if the MDI read
+			 * completed
+			 */
+			for (i = 0; i < 64; i++) {
+				udelay(50);
+				mdic = er32(MDIC);
+				if (mdic & E1000_MDIC_READY)
+					break;
+			}
+			if (!(mdic & E1000_MDIC_READY)) {
+				e_dbg("MDI Read did not complete\n");
+				return -E1000_ERR_PHY;
+			}
+			if (mdic & E1000_MDIC_ERROR) {
+				e_dbg("MDI Error\n");
+				return -E1000_ERR_PHY;
+			}
+			*phy_data = (u16) mdic;
 		}
-		*phy_data = (u16) mdic;
 	} else {
 		/* We must first send a preamble through the MDIO pin to signal the
 		 * beginning of an MII instruction.  This is done by sending 32
@@ -2840,7 +2985,7 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
 {
 	u32 i;
 	u32 mdic = 0;
-	const u32 phy_addr = 1;
+	const u32 phy_addr = (hw->mac_type == e1000_ce4100) ? hw->phy_addr : 1;
 
 	e_dbg("e1000_write_phy_reg_ex");
 
@@ -2850,27 +2995,54 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr,
 	}
 
 	if (hw->mac_type > e1000_82543) {
-		/* Set up Op-code, Phy Address, register address, and data intended
-		 * for the PHY register in the MDI Control register.  The MAC will take
-		 * care of interfacing with the PHY to send the desired data.
+		/* Set up Op-code, Phy Address, register address, and data
+		 * intended for the PHY register in the MDI Control register.
+		 * The MAC will take care of interfacing with the PHY to send
+		 * the desired data.
 		 */
-		mdic = (((u32) phy_data) |
-			(reg_addr << E1000_MDIC_REG_SHIFT) |
-			(phy_addr << E1000_MDIC_PHY_SHIFT) |
-			(E1000_MDIC_OP_WRITE));
+		if (hw->mac_type == e1000_ce4100) {
+			mdic = (((u32) phy_data) |
+				(reg_addr << E1000_MDIC_REG_SHIFT) |
+				(phy_addr << E1000_MDIC_PHY_SHIFT) |
+				(INTEL_CE_GBE_MDIC_OP_WRITE) |
+				(INTEL_CE_GBE_MDIC_GO));
 
-		ew32(MDIC, mdic);
+			writel(mdic, E1000_MDIO_CMD);
 
-		/* Poll the ready bit to see if the MDI read completed */
-		for (i = 0; i < 641; i++) {
-			udelay(5);
-			mdic = er32(MDIC);
-			if (mdic & E1000_MDIC_READY)
-				break;
-		}
-		if (!(mdic & E1000_MDIC_READY)) {
-			e_dbg("MDI Write did not complete\n");
-			return -E1000_ERR_PHY;
+			/* Poll the ready bit to see if the MDI read
+			 * completed
+			 */
+			for (i = 0; i < 640; i++) {
+				udelay(5);
+				mdic = readl(E1000_MDIO_CMD);
+				if (!(mdic & INTEL_CE_GBE_MDIC_GO))
+					break;
+			}
+			if (mdic & INTEL_CE_GBE_MDIC_GO) {
+				e_dbg("MDI Write did not complete\n");
+				return -E1000_ERR_PHY;
+			}
+		} else {
+			mdic = (((u32) phy_data) |
+				(reg_addr << E1000_MDIC_REG_SHIFT) |
+				(phy_addr << E1000_MDIC_PHY_SHIFT) |
+				(E1000_MDIC_OP_WRITE));
+
+			ew32(MDIC, mdic);
+
+			/* Poll the ready bit to see if the MDI read
+			 * completed
+			 */
+			for (i = 0; i < 641; i++) {
+				udelay(5);
+				mdic = er32(MDIC);
+				if (mdic & E1000_MDIC_READY)
+					break;
+			}
+			if (!(mdic & E1000_MDIC_READY)) {
+				e_dbg("MDI Write did not complete\n");
+				return -E1000_ERR_PHY;
+			}
 		}
 	} else {
 		/* We'll need to use the SW defined pins to shift the write command
@@ -3048,6 +3220,11 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw)
 		if (hw->phy_id == M88E1011_I_PHY_ID)
 			match = true;
 		break;
+	case e1000_ce4100:
+		if ((hw->phy_id == RTL8211B_PHY_ID) ||
+		    (hw->phy_id == RTL8201N_PHY_ID))
+			match = true;
+		break;
 	case e1000_82541:
 	case e1000_82541_rev_2:
 	case e1000_82547:
@@ -3291,6 +3468,9 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info)
 
 	if (hw->phy_type == e1000_phy_igp)
 		return e1000_phy_igp_get_info(hw, phy_info);
+	else if ((hw->phy_type == e1000_phy_8211) ||
+	         (hw->phy_type == e1000_phy_8201))
+		return E1000_SUCCESS;
 	else
 		return e1000_phy_m88_get_info(hw, phy_info);
 }
@@ -3742,6 +3922,12 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
 
 	e_dbg("e1000_read_eeprom");
 
+	if (hw->mac_type == e1000_ce4100) {
+		GBE_CONFIG_FLASH_READ(GBE_CONFIG_BASE_VIRT, offset, words,
+		                      data);
+		return E1000_SUCCESS;
+	}
+
 	/* If eeprom is not yet detected, do so now */
 	if (eeprom->word_size == 0)
 		e1000_init_eeprom_params(hw);
@@ -3904,6 +4090,12 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
 
 	e_dbg("e1000_write_eeprom");
 
+	if (hw->mac_type == e1000_ce4100) {
+		GBE_CONFIG_FLASH_WRITE(GBE_CONFIG_BASE_VIRT, offset, words,
+		                       data);
+		return E1000_SUCCESS;
+	}
+
 	/* If eeprom is not yet detected, do so now */
 	if (eeprom->word_size == 0)
 		e1000_init_eeprom_params(hw);
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index ecd9f6c..f5514a0 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -52,6 +52,7 @@ typedef enum {
 	e1000_82545,
 	e1000_82545_rev_3,
 	e1000_82546,
+	e1000_ce4100,
 	e1000_82546_rev_3,
 	e1000_82541,
 	e1000_82541_rev_2,
@@ -209,9 +210,11 @@ typedef enum {
 } e1000_1000t_rx_status;
 
 typedef enum {
-    e1000_phy_m88 = 0,
-    e1000_phy_igp,
-    e1000_phy_undefined = 0xFF
+	e1000_phy_m88 = 0,
+	e1000_phy_igp,
+	e1000_phy_8211,
+	e1000_phy_8201,
+	e1000_phy_undefined = 0xFF
 } e1000_phy_type;
 
 typedef enum {
@@ -442,6 +445,7 @@ void e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value);
 #define E1000_DEV_ID_82547EI             0x1019
 #define E1000_DEV_ID_82547EI_MOBILE      0x101A
 #define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
+#define E1000_DEV_ID_INTEL_CE4100_GBE    0x2E6E
 
 #define NODE_ADDRESS_SIZE 6
 #define ETH_LENGTH_OF_ADDRESS 6
@@ -808,6 +812,16 @@ struct e1000_ffvt_entry {
 #define E1000_CTRL_EXT 0x00018	/* Extended Device Control - RW */
 #define E1000_FLA      0x0001C	/* Flash Access - RW */
 #define E1000_MDIC     0x00020	/* MDI Control - RW */
+
+extern void __iomem *ce4100_gbe_mdio_base_virt;
+#define INTEL_CE_GBE_MDIO_RCOMP_BASE    (ce4100_gbe_mdio_base_virt)
+#define E1000_MDIO_STS  (INTEL_CE_GBE_MDIO_RCOMP_BASE + 0)
+#define E1000_MDIO_CMD  (INTEL_CE_GBE_MDIO_RCOMP_BASE + 4)
+#define E1000_MDIO_DRV  (INTEL_CE_GBE_MDIO_RCOMP_BASE + 8)
+#define E1000_MDC_CMD   (INTEL_CE_GBE_MDIO_RCOMP_BASE + 0xC)
+#define E1000_RCOMP_CTL (INTEL_CE_GBE_MDIO_RCOMP_BASE + 0x20)
+#define E1000_RCOMP_STS (INTEL_CE_GBE_MDIO_RCOMP_BASE + 0x24)
+
 #define E1000_SCTL     0x00024	/* SerDes Control - RW */
 #define E1000_FEXTNVM  0x00028	/* Future Extended NVM register */
 #define E1000_FCAL     0x00028	/* Flow Control Address Low - RW */
@@ -820,6 +834,34 @@ struct e1000_ffvt_entry {
 #define E1000_IMS      0x000D0	/* Interrupt Mask Set - RW */
 #define E1000_IMC      0x000D8	/* Interrupt Mask Clear - WO */
 #define E1000_IAM      0x000E0	/* Interrupt Acknowledge Auto Mask */
+
+/* Auxiliary Control Register. This register is CE4100 specific,
+ * RMII/RGMII function is switched by this register - RW
+ * Following are bits definitions of the Auxiliary Control Register
+ */
+#define E1000_CTL_AUX  0x000E0
+#define E1000_CTL_AUX_END_SEL_SHIFT     10
+#define E1000_CTL_AUX_ENDIANESS_SHIFT   8
+#define E1000_CTL_AUX_RGMII_RMII_SHIFT  0
+
+/* descriptor and packet transfer use CTL_AUX.ENDIANESS */
+#define E1000_CTL_AUX_DES_PKT   (0x0 << E1000_CTL_AUX_END_SEL_SHIFT)
+/* descriptor use CTL_AUX.ENDIANESS, packet use default */
+#define E1000_CTL_AUX_DES       (0x1 << E1000_CTL_AUX_END_SEL_SHIFT)
+/* descriptor use default, packet use CTL_AUX.ENDIANESS */
+#define E1000_CTL_AUX_PKT       (0x2 << E1000_CTL_AUX_END_SEL_SHIFT)
+/* all use CTL_AUX.ENDIANESS */
+#define E1000_CTL_AUX_ALL       (0x3 << E1000_CTL_AUX_END_SEL_SHIFT)
+
+#define E1000_CTL_AUX_RGMII     (0x0 << E1000_CTL_AUX_RGMII_RMII_SHIFT)
+#define E1000_CTL_AUX_RMII      (0x1 << E1000_CTL_AUX_RGMII_RMII_SHIFT)
+
+/* LW little endian, Byte big endian */
+#define E1000_CTL_AUX_LWLE_BBE  (0x0 << E1000_CTL_AUX_ENDIANESS_SHIFT)
+#define E1000_CTL_AUX_LWLE_BLE  (0x1 << E1000_CTL_AUX_ENDIANESS_SHIFT)
+#define E1000_CTL_AUX_LWBE_BBE  (0x2 << E1000_CTL_AUX_ENDIANESS_SHIFT)
+#define E1000_CTL_AUX_LWBE_BLE  (0x3 << E1000_CTL_AUX_ENDIANESS_SHIFT)
+
 #define E1000_RCTL     0x00100	/* RX Control - RW */
 #define E1000_RDTR1    0x02820	/* RX Delay Timer (1) - RW */
 #define E1000_RDBAL1   0x02900	/* RX Descriptor Base Address Low (1) - RW */
@@ -1011,6 +1053,7 @@ struct e1000_ffvt_entry {
  * in more current versions of the 8254x. Despite the difference in location,
  * the registers function in the same manner.
  */
+#define E1000_82542_CTL_AUX  E1000_CTL_AUX
 #define E1000_82542_CTRL     E1000_CTRL
 #define E1000_82542_CTRL_DUP E1000_CTRL_DUP
 #define E1000_82542_STATUS   E1000_STATUS
@@ -1571,6 +1614,11 @@ struct e1000_hw {
 #define E1000_MDIC_INT_EN    0x20000000
 #define E1000_MDIC_ERROR     0x40000000
 
+#define INTEL_CE_GBE_MDIC_OP_WRITE      0x04000000
+#define INTEL_CE_GBE_MDIC_OP_READ       0x00000000
+#define INTEL_CE_GBE_MDIC_GO            0x80000000
+#define INTEL_CE_GBE_MDIC_READ_ERROR    0x80000000
+
 #define E1000_KUMCTRLSTA_MASK           0x0000FFFF
 #define E1000_KUMCTRLSTA_OFFSET         0x001F0000
 #define E1000_KUMCTRLSTA_OFFSET_SHIFT   16
@@ -2871,6 +2919,11 @@ struct e1000_host_command_info {
 #define M88E1111_I_PHY_ID  0x01410CC0
 #define L1LXT971A_PHY_ID   0x001378E0
 
+#define RTL8211B_PHY_ID    0x001CC910
+#define RTL8201N_PHY_ID    0x8200
+#define RTL_PHY_CTRL_FD    0x0100 /* Full duplex.0=half; 1=full */
+#define RTL_PHY_CTRL_SPD_100    0x200000 /* Force 100Mb */
+
 /* Bits...
  * 15-5: page
  * 4-0: register offset
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 340e12d..4ff88a6 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -28,6 +28,12 @@
 
 #include "e1000.h"
 #include <net/ip6_checksum.h>
+#include <linux/io.h>
+
+/* Intel Media SOC GbE MDIO physical base address */
+static unsigned long ce4100_gbe_mdio_base_phy;
+/* Intel Media SOC GbE MDIO virtual base address */
+void __iomem *ce4100_gbe_mdio_base_virt;
 
 char e1000_driver_name[] = "e1000";
 static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
@@ -79,6 +85,7 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
 	INTEL_E1000_ETHERNET_DEVICE(0x108A),
 	INTEL_E1000_ETHERNET_DEVICE(0x1099),
 	INTEL_E1000_ETHERNET_DEVICE(0x10B5),
+	INTEL_E1000_ETHERNET_DEVICE(0x2E6E),
 	/* required last entry */
 	{0,}
 };
@@ -459,6 +466,7 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)
 		case e1000_82545:
 		case e1000_82545_rev_3:
 		case e1000_82546:
+		case e1000_ce4100:
 		case e1000_82546_rev_3:
 		case e1000_82541:
 		case e1000_82541_rev_2:
@@ -573,6 +581,7 @@ void e1000_reset(struct e1000_adapter *adapter)
 	case e1000_82545:
 	case e1000_82545_rev_3:
 	case e1000_82546:
+	case e1000_ce4100:
 	case e1000_82546_rev_3:
 		pba = E1000_PBA_48K;
 		break;
@@ -894,6 +903,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	static int global_quad_port_a = 0; /* global ksp3 port a indication */
 	int i, err, pci_using_dac;
 	u16 eeprom_data = 0;
+	u16 tmp = 0;
 	u16 eeprom_apme_mask = E1000_EEPROM_APME;
 	int bars, need_ioport;
 
@@ -996,6 +1006,14 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 		goto err_sw_init;
 
 	err = -EIO;
+	if (hw->mac_type == e1000_ce4100) {
+		ce4100_gbe_mdio_base_phy = pci_resource_start(pdev, BAR_1);
+		ce4100_gbe_mdio_base_virt = ioremap(ce4100_gbe_mdio_base_phy,
+		                                pci_resource_len(pdev, BAR_1));
+
+		if (!ce4100_gbe_mdio_base_virt)
+			goto err_mdio_ioremap;
+	}
 
 	if (hw->mac_type >= e1000_82543) {
 		netdev->features = NETIF_F_SG |
@@ -1135,6 +1153,20 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	adapter->wol = adapter->eeprom_wol;
 	device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
 
+	/* Auto detect PHY address */
+	if (hw->mac_type == e1000_ce4100) {
+		for (i = 0; i < 32; i++) {
+			hw->phy_addr = i;
+			e1000_read_phy_reg(hw, PHY_ID2, &tmp);
+			if (tmp == 0 || tmp == 0xFF) {
+				if (i == 31)
+					goto err_eeprom;
+				continue;
+			} else
+				break;
+		}
+	}
+
 	/* reset the hardware with the new settings */
 	e1000_reset(adapter);
 
@@ -1171,6 +1203,8 @@ err_eeprom:
 	kfree(adapter->rx_ring);
 err_dma:
 err_sw_init:
+err_mdio_ioremap:
+	iounmap(ce4100_gbe_mdio_base_virt);
 	iounmap(hw->hw_addr);
 err_ioremap:
 	free_netdev(netdev);
@@ -1409,6 +1443,7 @@ static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start,
 	/* First rev 82545 and 82546 need to not allow any memory
 	 * write location to cross 64k boundary due to errata 23 */
 	if (hw->mac_type == e1000_82545 ||
+	    hw->mac_type == e1000_ce4100 ||
 	    hw->mac_type == e1000_82546) {
 		return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
 	}
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index edd1c75..55c1711 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -34,12 +34,21 @@
 #ifndef _E1000_OSDEP_H_
 #define _E1000_OSDEP_H_
 
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
 #include <asm/io.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
+
+#define CONFIG_RAM_BASE         0x60000
+#define GBE_CONFIG_OFFSET       0x0
+
+#define GBE_CONFIG_RAM_BASE \
+	((unsigned int)(CONFIG_RAM_BASE + GBE_CONFIG_OFFSET))
+
+#define GBE_CONFIG_BASE_VIRT    phys_to_virt(GBE_CONFIG_RAM_BASE)
+
+#define GBE_CONFIG_FLASH_WRITE(base, offset, count, data) \
+	(iowrite16_rep(base + offset, data, count))
+
+#define GBE_CONFIG_FLASH_READ(base, offset, count, data) \
+	(ioread16_rep(base + (offset << 1), data, count))
 
 #define er32(reg)							\
 	(readl(hw->hw_addr + ((hw->mac_type >= e1000_82543)		\
-- 
1.7.3.4


^ permalink raw reply related


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