]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 years agoblock: Fix bad range check in bio_sector_offset
Martin K. Petersen [Wed, 13 Jun 2012 04:04:30 +0000 (00:04 -0400)]
block: Fix bad range check in bio_sector_offset

DM would occasionally end up splitting data integrity-enabled requests
incorrectly. The culprit was a bad range check in bio_sector_offset.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
13 years agoSPEC: v2.6.39-200.18.0
Maxim Uvarov [Fri, 8 Jun 2012 07:29:29 +0000 (11:29 +0400)]
SPEC: v2.6.39-200.18.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'uek-2.6.39-200-e1000e' of git://ca-git.us.oracle.com/linux-joejin-publi...
Maxim Uvarov [Fri, 8 Jun 2012 07:24:26 +0000 (11:24 +0400)]
Merge branch 'uek-2.6.39-200-e1000e' of git://ca-git.us.oracle.com/linux-joejin-public into uek-2.6.39-200

13 years agoe1000e: disable rxhash when try to enable jumbo frame also rxhash and rxcsum have...
Joe Jin [Thu, 7 Jun 2012 23:35:58 +0000 (07:35 +0800)]
e1000e: disable rxhash when try to enable jumbo frame also rxhash and rxcsum have enabled

commit ffd3d6 check if both rxhash and rxcsum enabled when enable jumbo
frames and disallowed all of them enabled at the same time.
Since jumbo frame widely be used in real world, and el5 did not supported
enable/disable rxhash, so we changed default behavior to disable rxhash
when try to enable jumbo frames also rxhash and rxcsum have enabled.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
Acked-by: Adnan Misherfi <adnan.misherfi@oracle.com>
13 years agoSPEC: v2.6.39-200.17.0
Maxim Uvarov [Wed, 6 Jun 2012 18:21:04 +0000 (22:21 +0400)]
SPEC: v2.6.39-200.17.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agomm: reduce the amount of work done when updating min_free_kbytes
Mel Gorman [Tue, 10 Jan 2012 23:07:14 +0000 (15:07 -0800)]
mm: reduce the amount of work done when updating min_free_kbytes

Orabug: 14073214
When min_free_kbytes is updated, some pageblocks are marked
MIGRATE_RESERVE.  Ordinarily, this work is unnoticable as it happens early
in boot but on large machines with 1TB of memory, this has been reported
to delay boot times, probably due to the NUMA distances involved.

The bulk of the work is due to calling calling pageblock_is_reserved() an
unnecessary amount of times and accessing far more struct page metadata
than is necessary.  This patch significantly reduces the amount of work
done by setup_zone_migrate_reserve() improving boot times on 1TB machines.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 938929f14cb595f43cd1a4e63e22d36cab1e4a1f)

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
13 years agoocfs2: clear unaligned io flag when dio fails
Junxiao Bi [Thu, 31 May 2012 01:57:17 +0000 (09:57 +0800)]
ocfs2: clear unaligned io flag when dio fails

Orabug: 14063941
The unaligned io flag is set in the kiocb when an unaligned
dio is issued, it should be cleared even when the dio fails,
or it may affect the following io which are using the same
kiocb.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
13 years agoaio: make kiocb->private NUll in init_sync_kiocb()
Junxiao Bi [Thu, 31 May 2012 01:29:01 +0000 (09:29 +0800)]
aio: make kiocb->private NUll in init_sync_kiocb()

Orabug: 14063941
Ocfs2 uses kiocb.*private as a flag of unsigned long size. In
commit a11f7e6 ocfs2: serialize unaligned aio, the unaligned
io flag is involved in it to serialize the unaligned aio. As
*private is not initialized in init_sync_kiocb() of do_sync_write(),
this unaligned io flag may be unexpectly set in an aligned dio.
And this will cause OCFS2_I(inode)->ip_unaligned_aio decreased
to -1 in ocfs2_dio_end_io(), thus the following unaligned dio
will hang forever at ocfs2_aiodio_wait() in ocfs2_file_write_iter().

We can't initialized this flag in ocfs2_file_write_iter() since
it may be invoked several times by do_sync_write(). So we initialize
it in init_sync_kiocb(), it's also useful for other similiar use of
it in the future.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
13 years agovmxnet3: cap copy length at size of skb to prevent dropped frames on tx
Neil Horman [Thu, 16 Feb 2012 01:48:56 +0000 (01:48 +0000)]
vmxnet3: cap copy length at size of skb to prevent dropped frames on tx

Orabug: 14159701
I was recently shown that vmxnet3 devices on transmit, will drop very small udp
frames consistently.  This is due to a regression introduced by commit
39d4a96fd7d2926e46151adbd18b810aeeea8ec0.  This commit attempts to introduce an
optimization to the tx path, indicating that the underlying hardware behaves
optimally when at least 54 bytes of header data are available for direct access.
This causes problems however, if the entire frame is less than 54 bytes long.
The subsequent pskb_may_pull in vmxnet3_parse_and_copy_hdr fails, causing an
error return code, which leads to vmxnet3_tq_xmit dropping the frame.

Fix it by placing a cap on the copy length.  For frames longer than 54 bytes, we
do the pull as we normally would.  If the frame is shorter than that, copy the
whole frame, but no more.  This ensures that we still get the optimization for
qualifying frames, but don't do any damange for frames that are too short.

Also, since I'm unable to do this, it wuold be great if vmware could follow up
this patch with some additional code commentary as to why 54 bytes is an optimal
pull length for a virtual NIC driver.  The comment that introduced this was
vague on that.  Thanks!

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Max Matveev <mmatveev@redhat.com>
CC: Max Matveev <mmatveev@redhat.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Shreyas Bhatewara <sbhatewara@vmware.com>
CC: "VMware, Inc." <pv-drivers@vmware.com>
Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
13 years agomm/mempolicy.c: refix mbind_range() vma issue
KOSAKI Motohiro [Wed, 28 Dec 2011 23:57:11 +0000 (15:57 -0800)]
mm/mempolicy.c: refix mbind_range() vma issue

Orabug: 14149364
commit 8aacc9f550 ("mm/mempolicy.c: fix pgoff in mbind vma merge") is the
slightly incorrect fix.

Why? Think following case.

1. map 4 pages of a file at offset 0

   [0123]

2. map 2 pages just after the first mapping of the same file but with
   page offset 2

   [0123][23]

3. mbind() 2 pages from the first mapping at offset 2.
   mbind_range() should treat new vma is,

   [0123][23]
     |23|
     mbind vma

   but it does

   [0123][23]
     |01|
     mbind vma

   Oops. then, it makes wrong vma merge and splitting ([01][0123] or similar).

This patch fixes it.

[testcase]
  test result - before the patch

case4: 126: test failed. expect '2,4', actual '2,2,2'
        case5: passed
case6: passed
case7: passed
case8: passed
case_n: 246: test failed. expect '4,2', actual '1,4'

------------[ cut here ]------------
kernel BUG at mm/filemap.c:135!
invalid opcode: 0000 [#4] SMP DEBUG_PAGEALLOC

(snip long bug on messages)

  test result - after the patch

case4: passed
        case5: passed
case6: passed
case7: passed
case8: passed
case_n: passed

  source:  mbind_vma_test.c
============================================================
 #include <numaif.h>
 #include <numa.h>
 #include <sys/mman.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>

static unsigned long pagesize;
void* mmap_addr;
struct bitmask *nmask;
char buf[1024];
FILE *file;
char retbuf[10240] = "";
int mapped_fd;

char *rubysrc = "ruby -e '\
  pid = %d; \
  vstart = 0x%llx; \
  vend = 0x%llx; \
  s = `pmap -q #{pid}`; \
  rary = []; \
  s.each_line {|line|; \
    ary=line.split(\" \"); \
    addr = ary[0].to_i(16); \
    if(vstart <= addr && addr < vend) then \
      rary.push(ary[1].to_i()/4); \
    end; \
  }; \
  print rary.join(\",\"); \
'";

void init(void)
{
void* addr;
char buf[128];

nmask = numa_allocate_nodemask();
numa_bitmask_setbit(nmask, 0);

pagesize = getpagesize();

sprintf(buf, "%s", "mbind_vma_XXXXXX");
mapped_fd = mkstemp(buf);
if (mapped_fd == -1)
perror("mkstemp "), exit(1);
unlink(buf);

if (lseek(mapped_fd, pagesize*8, SEEK_SET) < 0)
perror("lseek "), exit(1);
if (write(mapped_fd, "\0", 1) < 0)
perror("write "), exit(1);

addr = mmap(NULL, pagesize*8, PROT_NONE,
    MAP_SHARED, mapped_fd, 0);
if (addr == MAP_FAILED)
perror("mmap "), exit(1);

if (mprotect(addr+pagesize, pagesize*6, PROT_READ|PROT_WRITE) < 0)
perror("mprotect "), exit(1);

mmap_addr = addr + pagesize;

/* make page populate */
memset(mmap_addr, 0, pagesize*6);
}

void fin(void)
{
void* addr = mmap_addr - pagesize;
munmap(addr, pagesize*8);

memset(buf, 0, sizeof(buf));
memset(retbuf, 0, sizeof(retbuf));
}

void mem_bind(int index, int len)
{
int err;

err = mbind(mmap_addr+pagesize*index, pagesize*len,
    MPOL_BIND, nmask->maskp, nmask->size, 0);
if (err)
perror("mbind "), exit(err);
}

void mem_interleave(int index, int len)
{
int err;

err = mbind(mmap_addr+pagesize*index, pagesize*len,
    MPOL_INTERLEAVE, nmask->maskp, nmask->size, 0);
if (err)
perror("mbind "), exit(err);
}

void mem_unbind(int index, int len)
{
int err;

err = mbind(mmap_addr+pagesize*index, pagesize*len,
    MPOL_DEFAULT, NULL, 0, 0);
if (err)
perror("mbind "), exit(err);
}

void Assert(char *expected, char *value, char *name, int line)
{
if (strcmp(expected, value) == 0) {
fprintf(stderr, "%s: passed\n", name);
return;
}
else {
fprintf(stderr, "%s: %d: test failed. expect '%s', actual '%s'\n",
name, line,
expected, value);
// exit(1);
}
}

/*
      AAAA
    PPPPPPNNNNNN
    might become
    PPNNNNNNNNNN
    case 4 below
*/
void case4(void)
{
init();
sprintf(buf, rubysrc, getpid(), mmap_addr, mmap_addr+pagesize*6);

mem_bind(0, 4);
mem_unbind(2, 2);

file = popen(buf, "r");
fread(retbuf, sizeof(retbuf), 1, file);
Assert("2,4", retbuf, "case4", __LINE__);

fin();
}

/*
       AAAA
 PPPPPPNNNNNN
 might become
 PPPPPPPPPPNN
 case 5 below
*/
void case5(void)
{
init();
sprintf(buf, rubysrc, getpid(), mmap_addr, mmap_addr+pagesize*6);

mem_bind(0, 2);
mem_bind(2, 2);

file = popen(buf, "r");
fread(retbuf, sizeof(retbuf), 1, file);
Assert("4,2", retbuf, "case5", __LINE__);

fin();
}

/*
    AAAA
PPPPNNNNXXXX
might become
PPPPPPPPPPPP 6
*/
void case6(void)
{
init();
sprintf(buf, rubysrc, getpid(), mmap_addr, mmap_addr+pagesize*6);

mem_bind(0, 2);
mem_bind(4, 2);
mem_bind(2, 2);

file = popen(buf, "r");
fread(retbuf, sizeof(retbuf), 1, file);
Assert("6", retbuf, "case6", __LINE__);

fin();
}

/*
    AAAA
PPPPNNNNXXXX
might become
PPPPPPPPXXXX 7
*/
void case7(void)
{
init();
sprintf(buf, rubysrc, getpid(), mmap_addr, mmap_addr+pagesize*6);

mem_bind(0, 2);
mem_interleave(4, 2);
mem_bind(2, 2);

file = popen(buf, "r");
fread(retbuf, sizeof(retbuf), 1, file);
Assert("4,2", retbuf, "case7", __LINE__);

fin();
}

/*
    AAAA
PPPPNNNNXXXX
might become
PPPPNNNNNNNN 8
*/
void case8(void)
{
init();
sprintf(buf, rubysrc, getpid(), mmap_addr, mmap_addr+pagesize*6);

mem_bind(0, 2);
mem_interleave(4, 2);
mem_interleave(2, 2);

file = popen(buf, "r");
fread(retbuf, sizeof(retbuf), 1, file);
Assert("2,4", retbuf, "case8", __LINE__);

fin();
}

void case_n(void)
{
init();
sprintf(buf, rubysrc, getpid(), mmap_addr, mmap_addr+pagesize*6);

/* make redundunt mappings [0][1234][34][7] */
mmap(mmap_addr + pagesize*4, pagesize*2, PROT_READ|PROT_WRITE,
     MAP_FIXED|MAP_SHARED, mapped_fd, pagesize*3);

/* Expect to do nothing. */
mem_unbind(2, 2);

file = popen(buf, "r");
fread(retbuf, sizeof(retbuf), 1, file);
Assert("4,2", retbuf, "case_n", __LINE__);

fin();
}

int main(int argc, char** argv)
{
case4();
case5();
case6();
case7();
case8();
case_n();

return 0;
}
=============================================================

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Caspar Zhang <caspar@casparzhang.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: <stable@vger.kernel.org> [3.1.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit e26a51148f3ebd859bca8bf2e0f212839b447f62)

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
13 years agomm/mempolicy.c: fix pgoff in mbind vma merge
Caspar Zhang [Wed, 14 Sep 2011 23:20:58 +0000 (16:20 -0700)]
mm/mempolicy.c: fix pgoff in mbind vma merge

Orabug:14149364
commit 9d8cebd4bcd7 ("mm: fix mbind vma merge problem") didn't really
fix the mbind vma merge problem due to wrong pgoff value passing to
vma_merge(), which made vma_merge() always return NULL.

Before the patch applied, we are getting a result like:

  addr = 0x7fa58f00c000
  [snip]
  7fa58f00c000-7fa58f00d000 rw-p 00000000 00:00 0
  7fa58f00d000-7fa58f00e000 rw-p 00000000 00:00 0
  7fa58f00e000-7fa58f00f000 rw-p 00000000 00:00 0

here 7fa58f00c000->7fa58f00f000 we get 3 VMAs which are expected to be
merged described as described in commit 9d8cebd.

Re-testing the patched kernel with the reproducer provided in commit
9d8cebd, we get the correct result:

  addr = 0x7ffa5aaa2000
  [snip]
  7ffa5aaa2000-7ffa5aaa6000 rw-p 00000000 00:00 0
  7fffd556f000-7fffd5584000 rw-p 00000000 00:00 0                          [stack]

Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 8aacc9f550feb09c8b26470498345c192996a68e)

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
13 years agoSPEC: v2.6.39-200.16.0
Maxim Uvarov [Tue, 5 Jun 2012 19:25:22 +0000 (23:25 +0400)]
SPEC: v2.6.39-200.16.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'stable/for-200' of git://ca-git.us.oracle.com/linux-konrad-public into...
Maxim Uvarov [Tue, 5 Jun 2012 18:53:08 +0000 (22:53 +0400)]
Merge branch 'stable/for-200' of git://ca-git.us.oracle.com/linux-konrad-public into uek-2.6.39-200

13 years agoSPEC: v2.6.39-200.15.0
Maxim Uvarov [Fri, 1 Jun 2012 11:16:10 +0000 (15:16 +0400)]
SPEC: v2.6.39-200.15.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoxen: expose host uuid via sysfs.
Zhigang Wang [Mon, 7 May 2012 20:51:10 +0000 (16:51 -0400)]
xen: expose host uuid via sysfs.

When 'expose_host_uuid = 1' is specified in vm.cfg, xen will write the physical
host uuid to xenstore. This patch expose the host uuid to userspace via sysfs:

  $ cat /sys/hypervisor/host_uuid
  d51ac6d5-f8f1-416f-b089-17da51beb70d

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
13 years agoxen/gntdev: Fix merge error.
Konrad Rzeszutek Wilk [Fri, 11 May 2012 20:29:09 +0000 (16:29 -0400)]
xen/gntdev: Fix merge error.

Somehow a merge error ensued were an important part of
 "xen/gnt{dev,alloc}: reserve event channels for notify"
went missing.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoSPEC: v2.6.39-200.14.0
Maxim Uvarov [Wed, 30 May 2012 06:08:38 +0000 (10:08 +0400)]
SPEC: v2.6.39-200.14.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoSPEC: upgrade preserve rhck as a boot kernel
Kevin Lyons [Wed, 30 May 2012 05:56:07 +0000 (09:56 +0400)]
SPEC: upgrade preserve rhck as a boot kernel

Orabug: 14065209
OL6.0 to OL 6.1 and OL 6.1 to OL 6.1 upgrade forcefully
installs UEK which becomes a default kernel.  If customer
runs RHCK , it should be left as a default boot kernel.

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agohxge: update driver to 1.3.4
Maxim Uvarov [Wed, 30 May 2012 05:42:41 +0000 (09:42 +0400)]
hxge: update driver to 1.3.4

Orabug: 14134149
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'uek-2.6.39-200' of ca-git.us.oracle.com:linux-muvarov-public into uek...
Maxim Uvarov [Wed, 30 May 2012 05:35:09 +0000 (09:35 +0400)]
Merge branch 'uek-2.6.39-200' of ca-git.us.oracle.com:linux-muvarov-public into uek-2.6.39-200

Network and SCSI drivers update. Were tested under tag
v2.6.39-200.12.0#rc_v1.
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoSPEC: v2.6.39-200.13.0
Maxim Uvarov [Mon, 28 May 2012 16:41:55 +0000 (20:41 +0400)]
SPEC: v2.6.39-200.13.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agodrm/i915: fix integer overflow in i915_gem_do_execbuffer()
Xi Wang [Mon, 23 Apr 2012 08:06:42 +0000 (04:06 -0400)]
drm/i915: fix integer overflow in i915_gem_do_execbuffer()

Orabug: 14107456
This fixes CVE-2012-2384.
Commit 44afb3a04391a74309d16180d1e4f8386fdfa745 upstream.

On 32-bit systems, a large args->num_cliprects from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.

This vulnerability was introduced in commit 432e58ed ("drm/i915: Avoid
allocation for execbuffer object list").

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
13 years agodrm/i915: fix integer overflow in i915_gem_execbuffer2()
Xi Wang [Mon, 23 Apr 2012 08:06:41 +0000 (04:06 -0400)]
drm/i915: fix integer overflow in i915_gem_execbuffer2()

Orabug: 14107445
This fixes CVE-2012-2383.
Commit ed8cd3b2cd61004cab85380c52b1817aca1ca49b upstream.

On 32-bit systems, a large args->buffer_count from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.

This vulnerability was introduced in commit 8408c282 ("drm/i915:
First try a normal large kmalloc for the temporary exec buffers").

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
13 years agoSPEC: v2.6.39-200.12.0
Maxim Uvarov [Wed, 23 May 2012 21:40:26 +0000 (14:40 -0700)]
SPEC: v2.6.39-200.12.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'stable-bz14091238' of git://ca-git.us.oracle.com/linux-konrad-public...
Maxim Uvarov [Wed, 23 May 2012 21:37:50 +0000 (14:37 -0700)]
Merge branch 'stable-bz14091238' of git://ca-git.us.oracle.com/linux-konrad-public into uek-2.6.39-200_v2.6.39-200.11.0

13 years agoRevert "x86, efi: Pass a minimal map to SetVirtualAddressMap()"
Maxim Uvarov [Fri, 18 May 2012 21:14:59 +0000 (14:14 -0700)]
Revert "x86, efi: Pass a minimal map to SetVirtualAddressMap()"

Orabug: 14076004
This reverts commit 7cb00b72876ea2451eb79d468da0e8fb9134aa8a.

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoconfig: turn on CONFIG_HVC_XEN_FRONTEND
Maxim Uvarov [Mon, 21 May 2012 18:39:16 +0000 (11:39 -0700)]
config: turn on CONFIG_HVC_XEN_FRONTEND

Orabug: 14064174
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoSPEC: v2.6.39-200.12.0
Maxim Uvarov [Fri, 18 May 2012 21:25:17 +0000 (14:25 -0700)]
SPEC: v2.6.39-200.12.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoxen/hvc: Check HVM_PARAM_CONSOLE_[EVTCHN|PFN] for correctness.
Konrad Rzeszutek Wilk [Wed, 23 May 2012 16:56:59 +0000 (12:56 -0400)]
xen/hvc: Check HVM_PARAM_CONSOLE_[EVTCHN|PFN] for correctness.

We need to make sure that those parameters are setup to be correct.
As such the value of 0 is deemed invalid and we find that we
bail out. The hypervisor sets by default all of them to be zero
and when the hypercall is done does a simple:

 a.value = d->arch.hvm_domain.params[a.index];

Which means that if the Xen toolstack forgot to setup the proper
HVM_PARAM_CONSOLE_EVTCHN, we would get the default value of 0
and use that.

CC: stable@kernel.org
Fixes-Oracle-Bug: 14091238
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/hvc: Fix error cases around HVM_PARAM_CONSOLE_PFN
Konrad Rzeszutek Wilk [Wed, 23 May 2012 16:55:38 +0000 (12:55 -0400)]
xen/hvc: Fix error cases around HVM_PARAM_CONSOLE_PFN

We weren't resetting the parameter to be passed in to a
known default. Nor were we checking the return value of
hvm_get_parameter.

CC: stable@kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/hvc: Collapse error logic.
Konrad Rzeszutek Wilk [Wed, 23 May 2012 16:53:11 +0000 (12:53 -0400)]
xen/hvc: Collapse error logic.

All of the error paths are doing the same logic. In which
case we might as well collapse them in one path.

CC: stable@kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoRevert "bnx2x: correction to firmware interface"
Joe Jin [Tue, 22 May 2012 07:14:40 +0000 (15:14 +0800)]
Revert "bnx2x: correction to firmware interface"

This reverts commit 24bf806e55c655a30ebdd892c4b1cc93142b3e36.

13 years agocnic: fix bnx2fc_constants.h path
Maxim Uvarov [Tue, 22 May 2012 23:22:51 +0000 (16:22 -0700)]
cnic: fix bnx2fc_constants.h path

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agobnx2x: PFC fix
Yaniv Rosner [Tue, 22 May 2012 22:30:59 +0000 (15:30 -0700)]
bnx2x: PFC fix

Fix a problem in which PFC frames are not honored, due to incorrect link
attributes synchronization following PMF migration, and verify PFC XON is not
stuck from previous link change.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocnic: Fix parity error code conflict
Michael Chan [Tue, 22 May 2012 22:21:12 +0000 (15:21 -0700)]
cnic: Fix parity error code conflict

The recently added parity error handling used an error code that was
already defined for a different error.  This could lead to bnx2x
firmware assert.  We need to fix this with new error codes that are
defined for parity error only.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Clear MDC/MDIO warning message
Yaniv Rosner [Tue, 22 May 2012 22:04:17 +0000 (15:04 -0700)]
bnx2x: Clear MDC/MDIO warning message

This patch clears a warning message of "MDC/MDIO access timeout" which may
appear when interface is loaded due to missing clock setting before resetting
the LED, and starting periodic function too early.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Fix BCM578x0-SFI pre-emphasis settings
Yaniv Rosner [Tue, 22 May 2012 21:59:44 +0000 (14:59 -0700)]
bnx2x: Fix BCM578x0-SFI pre-emphasis settings

Fix 578x0-SFI pre-emphasis settings per HW recommendations to achieve better
link strength.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Fix BCM57810-KR AN speed transition
Yaniv Rosner [Tue, 22 May 2012 21:20:50 +0000 (14:20 -0700)]
bnx2x: Fix BCM57810-KR AN speed transition

BCM57810-KR link may not come up in 1G after running loopback test, so set
the relevant registers to their default values before starting KR autoneg.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocnic: Re-init dev->stats_addr after chip reset
Michael Chan [Wed, 4 Jan 2012 12:12:27 +0000 (12:12 +0000)]
cnic: Re-init dev->stats_addr after chip reset

because bnx2x frees the old and allocates new memory during chip reset.

(cherry picked from commit a9e0a4f2ca5e97ae2cff0bda72b9645e047c1a3d)
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoconfig: turn on CONFIG_HVC_XEN_FRONTEND
Maxim Uvarov [Mon, 21 May 2012 18:39:16 +0000 (11:39 -0700)]
config: turn on CONFIG_HVC_XEN_FRONTEND

Orabug: 14064174
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoixgbe: Don't set ip checksum if did not enable tso.
Joe Jin [Mon, 21 May 2012 01:30:57 +0000 (09:30 +0800)]
ixgbe: Don't set ip checksum if did not enable tso.

After apply commit c108d12 - "ixgbe: Modify setup of descriptor flags to
avoid conditional jumps", X540-AT2 did not worked properly, it caused by
inconsistent olinfo_status, when enable ip checksum, make sure tso be
supported.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoMerge branch 'uek2-for-ol6u3' of git://ca-git.us.oracle.com/linux-joejin-public into...
Maxim Uvarov [Fri, 18 May 2012 21:19:16 +0000 (14:19 -0700)]
Merge branch 'uek2-for-ol6u3' of git://ca-git.us.oracle.com/linux-joejin-public into uek-2.6.39-200

13 years agoRevert "x86, efi: Pass a minimal map to SetVirtualAddressMap()"
Maxim Uvarov [Fri, 18 May 2012 21:14:59 +0000 (14:14 -0700)]
Revert "x86, efi: Pass a minimal map to SetVirtualAddressMap()"

Orabug: 14076004
This reverts commit 7cb00b72876ea2451eb79d468da0e8fb9134aa8a.

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agor8169: add firmware files
Joe Jin [Fri, 18 May 2012 07:02:55 +0000 (15:02 +0800)]
r8169: add firmware files

Add firmware files for r8169.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe1000e: fix build warning.
Joe Jin [Fri, 18 May 2012 03:56:48 +0000 (11:56 +0800)]
e1000e: fix build warning.

The waring introduced by commit ffd3d6, for different declare
of get_rxnfc().

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: file build warning
Joe Jin [Fri, 18 May 2012 03:47:37 +0000 (11:47 +0800)]
bnx2x: file build warning

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago8139too: Add 64bit statistics
Junchang Wang [Mon, 5 Mar 2012 17:13:05 +0000 (17:13 +0000)]
8139too: Add 64bit statistics

Switch to use ndo_get_stats64 to get 64bit statistics.
Two sync entries are used (one for Rx and one for Tx).

(cherry picked from commit 9184a22701ed257974e7950be11da4cbd3116c63)
Signed-off-by: Junchang Wang <junchangwang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agonet: export netdev_stats_to_stats64
Eric Dumazet [Mon, 5 Mar 2012 04:50:09 +0000 (04:50 +0000)]
net: export netdev_stats_to_stats64

Some drivers use internal netdev stats member to store part of their
stats, yet advertize ndo_get_stats64() to implement some 64bit fields.

Allow them to use netdev_stats_to_stats64() helper to make the copy of
netdev stats before they compute their 64bit counters.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 77a1abf54f4b003ad6e59c535045b2ad89fedfeb)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: enable transmit time stamping.
Joe Jin [Fri, 18 May 2012 03:35:23 +0000 (11:35 +0800)]
r8169: enable transmit time stamping.

This patch has been tested on a machine with the Realtek
RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05).

Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: Francois Romieu <romieu@fr.zoreil.com>
(backported from commit 5047fb5d1dfcc92cf2133f246c1fe7b447ec4e5f)
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: stop using net_device.{base_addr, irq}.
Francois Romieu [Sat, 10 Mar 2012 09:42:12 +0000 (10:42 +0100)]
r8169: stop using net_device.{base_addr, irq}.

The driver does not need this leftover of the ISA drivers era.

(cherry picked from commit 92a7c4e7183bcd29e2366f1ee784ad395c291134)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: move the driver removal method to the end of the driver file.
Francois Romieu [Thu, 8 Mar 2012 08:54:01 +0000 (09:54 +0100)]
r8169: move the driver removal method to the end of the driver file.

(cherry picked from commit e27566ed370da09e3b812d3d76dce002915a5bdd)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix unsigned int wraparound with TSO
Julien Ducourthial [Tue, 8 May 2012 22:00:06 +0000 (00:00 +0200)]
r8169: fix unsigned int wraparound with TSO

The r8169 may get stuck or show bad behaviour after activating TSO :
the net_device is not stopped when it has no more TX descriptors.
This problem comes from TX_BUFS_AVAIL which may reach -1 when all
transmit descriptors are in use. The patch simply tries to keep positive
values.

Tested with 8111d(onboard) on a D510MO, and with 8111e(onboard) on a
Zotac 890GXITX.

(cherry picked from commit 477206a018f902895bfcd069dd820bfe94c187b1)
Signed-off-by: Julien Ducourthial <jducourt@free.fr>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago8139cp: set intr mask after its handler is registered
Jason Wang [Wed, 11 Apr 2012 22:10:54 +0000 (22:10 +0000)]
8139cp: set intr mask after its handler is registered

We set intr mask before its handler is registered, this does not work well when
8139cp is sharing irq line with other devices. As the irq could be enabled by
the device before 8139cp's hander is registered which may lead unhandled
irq. Fix this by introducing an helper cp_irq_enable() and call it after
request_irq().

(cherry picked from commit a8c9cb106fe79c28d6b7f1397652cadd228715ff)
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: enable napi on resume.
Artem Savkov [Tue, 3 Apr 2012 10:29:11 +0000 (10:29 +0000)]
r8169: enable napi on resume.

NAPI is disabled during suspend and needs to be enabled on resume. Without
this the driver locks up during resume in rtl_reset_work() trying to disable
NAPI again.

(cherry picked from commit cff4c16296754888b6fd8c886bc860a888e20257)
Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: runtime resume before shutdown.
françois romieu [Tue, 6 Mar 2012 01:14:12 +0000 (01:14 +0000)]
r8169: runtime resume before shutdown.

With runtime PM, if the ethernet cable is disconnected, the device is
transitioned to D3 state to conserve energy. If the system is shutdown
in this state, any register accesses in rtl_shutdown are dropped on
the floor. As the device was programmed by .runtime_suspend() to wake
on link changes, it is thus brought back up as soon as the link recovers.

Resuming every suspended device through the driver core would slow things
down and it is not clear how many devices really need it now.

Original report and D0 transition patch by Sameer Nanda. Patch has been
changed to comply with advices by Rafael J. Wysocki and the PM folks.

Reported-by: Sameer Nanda <snanda@chromium.org>
(cherry picked from commit 2a15cd2ff488a9fdb55e5e34060f499853b27c77)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Hayes Wang <hayeswang@realtek.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: add 64bit statistics.
Junchang Wang [Sun, 4 Mar 2012 22:30:32 +0000 (23:30 +0100)]
r8169: add 64bit statistics.

Switch to use ndo_get_stats64 to get 64bit statistics.
Two sync entries are used (one for Rx and one for Tx).

(cherry picked from commit 8027aa245bbd125350f6a78c5a78771d143aba55)
Signed-off-by: Junchang Wang <junchangwang@gmail.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: corrupted IP fragments fix for large mtu.
françois romieu [Fri, 2 Mar 2012 04:43:14 +0000 (04:43 +0000)]
r8169: corrupted IP fragments fix for large mtu.

Noticed with the 8168d (-vb-gr, aka RTL_GIGA_MAC_VER_26).

ConfigX registers should only be written while the Config9346 lock
is held.

(cherry picked from commit 9c5028e9da1255dd2b99762d8627b88b29f68cce)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Reported-by: Nick Bowler <nbowler@elliptictech.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: spinlock redux.
Francois Romieu [Tue, 31 Jan 2012 10:20:34 +0000 (11:20 +0100)]
r8169: spinlock redux.

rtl8169_get_regs operates under RTNL and rtl task mutex whereas
rtl_set_rx_mode is either called under RTNL or rtl task mutex protection.

(cherry picked from commit 6c05d25267ebb371c4311de6904f740342e82f7c)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: avoid a useless work scheduling.
Francois Romieu [Tue, 31 Jan 2012 10:09:21 +0000 (11:09 +0100)]
r8169: avoid a useless work scheduling.

(cherry picked from commit 934714d088f35b81edafdce89397969baf77fb8a)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: move task enable boolean to bitfield.
Francois Romieu [Tue, 31 Jan 2012 09:56:44 +0000 (10:56 +0100)]
r8169: move task enable boolean to bitfield.

Simpler, more consistent, with negligible cost in non-critical paths.

(cherry picked from commit 6c4a70c5f286077e78b294b3f3a93dc45c40db89)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: bh locking redux and task scheduling.
Francois Romieu [Tue, 31 Jan 2012 09:47:34 +0000 (10:47 +0100)]
r8169: bh locking redux and task scheduling.

- atomic bit operations are globally visible
- pending status is always cleared before execution
- scheduled works are either idempotent or only required to happen once
  after a series of originating events, say link events for instance

(cherry picked from commit 98ddf986fca17840e46e070354b7e2cd2169da15)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix early queue wake-up.
Francois Romieu [Mon, 30 Jan 2012 23:00:19 +0000 (00:00 +0100)]
r8169: fix early queue wake-up.

With infinite gratitude to Eric Dumazet for allowing me to identify
the error.

(cherry picked from commit ae1f23fb433ac0aaff8aeaa5a7b14348e9aa8277)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: remove work from irq handler.
Joe Jin [Fri, 18 May 2012 03:27:31 +0000 (11:27 +0800)]
r8169: remove work from irq handler.

The irq handler was a mess.

See 7ab87ff4c770eed71e3777936299292739fcd0fe ("via-rhine: move work from
irq handler to softirq and beyond") for similar changes. One can notice:
- all non-napi tasks are explicitely scheduled trough a single work queue.
- hiding software tx queue start behind the rtl_hw_start method is mildly
  natural. Move it in the caller where needed.
- as can be seen from the heavy use of bh disabling locks, the driver is
  not safe for irq context messages with netconsole. It is still quite
  usable for general messaging though. Tested ok with concurrent registers
  dump (ethtool -d) + background traffic + "echo t > /proc/sysrq-trigger".

Tested with old PCI chipset, PCIe 8168 and 810x:
- XID 0c900800 RTL8168evl/8111evl
- XID 18000000 RTL8168b/8111b
- XID 98000000 RTL8169sc/8110sc
- XID 083000c0 RTL8168d/8111d
- XID 081000c0 RTL8168d/8111d
- XID 00b00000 RTL8105e
- XID 04a00000 RTL8102e

As a side note, the comments in f11a377b3f4e897d11f0e8d1fc688667e2f19708
("r8169: avoid losing MSI interrupts") does not seem completely clear: if
I hack the driver further to stop acking the irq link event bit, MSI
interrupts keep being delivered (RTL8168b/8111b, XID 18000000).

(backported from commit da78dbff2e05630921c551dbbc70a4b7981a8fff)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: missing barriers.
Francois Romieu [Fri, 27 Jan 2012 14:05:38 +0000 (15:05 +0100)]
r8169: missing barriers.

(cherry picked from commit 1e874e041fc7c222cbd85b20c4406070be1f687a)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: irq mask helpers.
Francois Romieu [Thu, 26 Jan 2012 11:59:08 +0000 (12:59 +0100)]
r8169: irq mask helpers.

(cherry picked from commit 9085cdfa2f9f04d8678465748e2cced6e3f02e26)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: factor out IntrMask writes.
Francois Romieu [Thu, 26 Jan 2012 11:50:01 +0000 (12:50 +0100)]
r8169: factor out IntrMask writes.

(cherry picked from commit 3e990ff5f119c2f9b142f3e2548dc90ca9b7dfa1)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: stop delaying workqueue.
Francois Romieu [Thu, 26 Jan 2012 10:23:32 +0000 (11:23 +0100)]
r8169: stop delaying workqueue.

Though motivated by the move of the driver to a single work queue of
sequential events and removal of hard irq processing, it looks safe as
a standalone change.

(cherry picked from commit 4422bcd4907d1bbb9f63e049e3c3819132c047a1)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: remove rtl8169_reinit_task.
Francois Romieu [Thu, 26 Jan 2012 08:59:50 +0000 (09:59 +0100)]
r8169: remove rtl8169_reinit_task.

I see no good reason to keep both rtl8169_reinit_task and rtl8169_reset_task:
- rtl8169_reinit_task adds a software failure point which does relate to
  any hardware state
- they handle hardware the same. Remember that rtl8169_reinit_task was
  introduced in the 8169 only era to handle PCI errors way before the 8168
  asked for pll and firmware ops and compare :

      rtl8169_reinit_task     |    rtl8169_reset_task
  ----------------------------+--------------------------
  rtl8169_wait_for_quiescence | rtl8169_hw_reset
  rtl8169_update_counters     | rtl8169_wait_for_quiescence
  rtl8169_hw_reset            | rtl_hw_start
  rtl8169_rx_missed           | rtl8169_check_link_status
  rtl_pll_power_down          |
  rtl_request_firmware        |
  rtl8169_init_phy            |
  rtl_pll_power_up            |
  rtl_hw_start                |
  rtl8169_check_link_status   |

(cherry picked from commit 209e5ac83b4d038ffb52cabc793f75031602a031)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: remove hardcoded PCIe registers accesses.
Francois Romieu [Thu, 22 Dec 2011 17:59:37 +0000 (18:59 +0100)]
r8169: remove hardcoded PCIe registers accesses.

(cherry picked from commit 4512ff9f361a2786a18cb805d1f64b8d8719f121)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago8139cp: fix missing napi_gro_flush.
françois romieu [Sun, 8 Jan 2012 13:41:33 +0000 (13:41 +0000)]
8139cp: fix missing napi_gro_flush.

The driver uses __napi_complete and napi_gro_receive. Without it, the
driver hits the BUG_ON(n->gro_list) assertion hard in __napi_complete.

(cherry picked from commit b189e810619a676e6b931a942a3e8387f3d39c21)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Marin Glibic <zhilla2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago8139cp/8139too: do not read into reserved registers
Jason Wang [Fri, 30 Dec 2011 23:44:33 +0000 (23:44 +0000)]
8139cp/8139too: do not read into reserved registers

delay_eeprom() use long read for Cfg9346 register(offset 0x50) which may read
into the area of reserved register(offset 0x53). Use byte read instead.

(cherry picked from commit 7d03f5a48e4d90854275b06433626243b3b3db17)
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix Config2 MSIEnable bit setting.
françois romieu [Thu, 15 Dec 2011 08:37:43 +0000 (08:37 +0000)]
r8169: fix Config2 MSIEnable bit setting.

The MSIEnable bit is only available for the 8169.

Avoid Config2 writes for the post-8169 8168 and 810x.

Reported-by: Su Kang Yin <cantona@cantona.net>
(cherry picked from commit 2ca6cf06d988fea21e812a86be79353352677c9c)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
françois romieu [Sun, 4 Dec 2011 20:30:52 +0000 (20:30 +0000)]
r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.

Since 92fc43b4159b518f5baae57301f26d770b0834c9, rtl8169_tx_timeout ends up
resetting Rx and Tx indexes and thus racing with the NAPI handler via
-> rtl8169_hw_reset
   -> rtl_hw_reset
      -> rtl8169_init_ring_indexes

What about returning to the original state ?

rtl_hw_reset is only used by rtl8169_hw_reset and rtl8169_init_one.

The latter does not need rtl8169_init_ring_indexes because the indexes
still contain their original values from the newly allocated network
device private data area (i.e. 0).

rtl8169_hw_reset is used by:
1. rtl8169_down
   Helper for rtl8169_close. rtl8169_open explicitely inits the indexes
   anyway.
2. rtl8169_pcierr_interrupt
   Indexes are set by rtl8169_reinit_task.
3. rtl8169_interrupt
   rtl8169_hw_reset is needed when the device goes down. See 1.
4. rtl_shutdown
   System shutdown handler. Indexes are irrelevant.
5. rtl8169_reset_task
   Indexes must be set before rtl_hw_start is called.
6. rtl8169_tx_timeout
   Indexes should not be set. This is the job of rtl8169_reset_task anyway.

The removal of rtl8169_hw_reset in rtl8169_tx_timeout and its move in
rtl8169_reset_task do not change the analysis.

(cherry picked from commit c7c2c39be8ed4e503e987151f4599455060e219a)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: Rx FIFO overflow fixes.
françois romieu [Sun, 4 Dec 2011 20:30:45 +0000 (20:30 +0000)]
r8169: Rx FIFO overflow fixes.

Realtek has specified that the post 8168c gigabit chips and the post
8105e fast ethernet chips recover automatically from a Rx FIFO overflow.
The driver does not need to clear the RxFIFOOver bit of IntrStatus and
it should rather avoid messing it.

The implementation deserves some explanation:
1. events outside of the intr_event bit mask are now ignored. It enforces
   a no-processing policy for the events that either should not be there
   or should be ignored.

2. RxFIFOOver was already ignored in rtl_cfg_infos[RTL_CFG_1] for the
   whole 8168 line of chips with two exceptions:
   - RTL_GIGA_MAC_VER_22 since b5ba6d12bdac21bc0620a5089e0f24e362645efd
     ("use RxFIFO overflow workaround for 8168c chipset.").
     This one should now be correctly handled.
   - RTL_GIGA_MAC_VER_11 (8168b) which requires a different Rx FIFO
     overflow processing.

   Though it does not conform to Realtek suggestion above, the updated
   driver includes no change for RTL_GIGA_MAC_VER_12 and RTL_GIGA_MAC_VER_17.
   Both are 8168b. RTL_GIGA_MAC_VER_12 is common and a bit old so I'd rather
   wait for experimental evidence that the change suggested by Realtek really
   helps or does not hurt in unexpected ways.

   Removed case statements in rtl8169_interrupt are only 8168 relevant.

3. RxFIFOOver is masked for post 8105e 810x chips, namely the sole 8105e
   (RTL_GIGA_MAC_VER_30) itself.

(cherry picked from commit 811fd3010cf512f2e23e6c4c912aad54516dc706)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocorral some wayward N/A fw_version dust bunnies
Rick Jones [Tue, 22 Nov 2011 14:06:26 +0000 (14:06 +0000)]
corral some wayward N/A fw_version dust bunnies

Round-up some wayward "N/A" fw_version dust bunnies as part of that
clean-up.

(cherry picked from commit 8ac72d167198f52cba8637cc9bec89339b8e4e64)
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethernet: Convert MAC_ADDR_LEN uses to ETH_ALEN
Joe Jin [Fri, 18 May 2012 03:10:25 +0000 (11:10 +0800)]
ethernet: Convert MAC_ADDR_LEN uses to ETH_ALEN

Reduce the number of #defines, use the normal #define from if_ether.h

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(backported from commit 6a3c910ca04ecd69b16dae47b26097a92c533828)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agosweep the floors and convert some .get_drvinfo routines to strlcpy
Joe Jin [Fri, 18 May 2012 03:04:27 +0000 (11:04 +0800)]
sweep the floors and convert some .get_drvinfo routines to strlcpy

Per the mention made by Ben Hutchings that strlcpy is now the preferred
string copy routine for a .get_drvinfo routine, do a bit of floor
sweeping and convert some of the as-yet unconverted ethernet drivers to
it.

(backported from commit 68aad78c5023b8aa82da99b47f9d8cf40e8ca453)
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: check firmware content sooner.
Francois Romieu [Fri, 17 Jun 2011 22:10:29 +0000 (00:10 +0200)]
r8169: check firmware content sooner.

Firmware checking is only performed when the firmware is loaded
instead of each time the driver inits the phy.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit fd112f2e15ba85d387de446a81aeb11e46ecc55d)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: support new firmware format.
Hayes Wang [Sat, 18 Jun 2011 09:37:48 +0000 (11:37 +0200)]
r8169: support new firmware format.

The new firmware format adds versioning as firmware for a specific
chipset appears to be subject to change. Current "legacy" format is
still supported.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 960aee6c7d5951ac20c0227ad73bad56392f0afc)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: explicit firmware format check.
Francois Romieu [Fri, 17 Jun 2011 15:16:24 +0000 (17:16 +0200)]
r8169: explicit firmware format check.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 1c361efb226d609a07403057a71557faf500b17a)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: move the firmware down into the device private data.
Francois Romieu [Fri, 17 Jun 2011 15:00:05 +0000 (17:00 +0200)]
r8169: move the firmware down into the device private data.

No functional difference.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit b6ffd97f5bcfd12df88ece6bc6df7a761ac5a049)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: increase the delay parameter of pm_schedule_suspend
hayeswang [Mon, 7 Nov 2011 20:44:37 +0000 (20:44 +0000)]
r8169: increase the delay parameter of pm_schedule_suspend

The link down would occur when reseting PHY. And it would take about 2 ~ 5 seconds
from link down to link up. If the delay of pm_schedule_suspend is not long enough,
the device would enter runtime_suspend before link up. After link up, the device
would wake up and reset PHY again. Then, you would find the driver keep in a loop
of runtime_suspend and rumtime_resume.

(cherry picked from commit 10953db8e1a278742ef7e64a3d1491802bcfa98b)
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix wrong eee setting for rlt8111evl
hayeswang [Thu, 13 Oct 2011 20:14:37 +0000 (20:14 +0000)]
r8169: fix wrong eee setting for rlt8111evl

Correct the wrong parameter for setting EEE for RTL8111E-VL.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1b23a3e3d1b969e285c57a2d38f3739283ecfb80)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix driver shutdown WoL regression.
françois romieu [Fri, 14 Oct 2011 00:57:45 +0000 (00:57 +0000)]
r8169: fix driver shutdown WoL regression.

Due to commit 92fc43b4159b518f5baae57301f26d770b0834c9 ("r8169: modify the
flow of the hw reset."), rtl8169_hw_reset stomps during driver shutdown on
RxConfig bits which are needed for WOL on some versions of the hardware.

As these bits were formerly set from the r81{0x, 68}_pll_power_down methods,
factor them out for use in the driver shutdown (rtl_shutdown) handler.

I favored __rtl8169_get_wol() -hardware state indication- over
RTL_FEATURE_WOL as the latter has become a good candidate for removal.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes <hayeswang@realtek.com>
Tested-by: Marc Ballarin <ballarin.marc@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 649b3b8c4e8681de443b4dc9e387c3036369e02e)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoAdd ethtool -g support to 8139cp
Rick Jones [Fri, 7 Oct 2011 06:42:21 +0000 (06:42 +0000)]
Add ethtool -g support to 8139cp

Add support for reporting ring sizes via ethtool -g to the 8139cp driver.

(cherry picked from commit 1d0861acfb24d0ca0661ff5a156b992b2c589458)
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agosc92031: use standard #defines from mii.h.
françois romieu [Fri, 30 Sep 2011 00:38:02 +0000 (00:38 +0000)]
sc92031: use standard #defines from mii.h.

(cherry picked from commit 3235de1684ae88e5e380de254a2a674dcd558acc)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: jumbo fixes.
Francois Romieu [Tue, 3 May 2011 14:38:29 +0000 (16:38 +0200)]
r8169: jumbo fixes.

- fix features : jumbo frames and checksumming can not be used at the
  same time.

- introduce hw_jumbo_{enable / disable} helpers. Their content has been
  creatively extracted from Realtek's own drivers. As an illustration,
  it would be nice to know how/if the MaxTxPacketSize register operates
  when the device can work with a 9k jumbo frame as its documentation
  (8168c) can not be applied beyond ~7k.

- rtl_tx_performance_tweak is moved forward. No change.

(cherry picked from commit d58d46b5d85139d18eb939aa7279c160bab70484)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: expand received packet length indication.
Francois Romieu [Tue, 12 Jul 2011 06:24:28 +0000 (08:24 +0200)]
r8169: expand received packet length indication.

8168d and above allow jumbo frames beyond 8k. Bump the received
packet length check before enabling jumbo frames on these chipsets.

Frame length indication covers bits 0..13 of the first Rx descriptor
32 bits for the 8169 and 8168. I only have authoritative documentation
for the allowed use of the extra (13) bit with the 8169 and 8168c.
Realtek's drivers use the same mask for the 816x and the fast ethernet
only 810x.

(cherry picked from commit deb9d93c89d311714a60809b28160e538e1cbb43)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: support new chips of RTL8111F
Hayes Wang [Tue, 6 Sep 2011 08:55:18 +0000 (16:55 +0800)]
r8169: support new chips of RTL8111F

Support new chips of RTL8111F.

(cherry picked from commit c2218925f3a653ac6c39e62eb0e10232d2b44dab)
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: do not enable the TBI for anything but the original 8169.
Francois Romieu [Thu, 1 Sep 2011 16:42:09 +0000 (18:42 +0200)]
r8169: do not enable the TBI for anything but the original 8169.

The TBI bit in PHYStatus is reserved on anything but the oldest 8169.

Nobody complained after I disabled it for the 8168 and the 810x (see
66ec5d4fb1ce6f0bd9df4bc4b758f0916d9f37ab).

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit 2544bfc0eb2581e0eedbdfea1468b3866223d47e)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: remove erroneous processing of always set bit.
Francois Romieu [Thu, 25 Aug 2011 16:47:24 +0000 (18:47 +0200)]
r8169: remove erroneous processing of always set bit.

When set, RxFOVF (resp. RxBOVF) is always 1 (resp. 0).

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes <hayeswang@realtek.com>
(cherry picked from commit e03f33af79f0772156e1a1a1e36bdddf8012b2e4)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix WOL setting for 8105 and 8111evl
Hayes Wang [Tue, 6 Sep 2011 08:55:14 +0000 (16:55 +0800)]
r8169: fix WOL setting for 8105 and 8111evl

rtl8105, rtl8111E, and rtl8111evl need enable RxConfig bit 1 ~ 3
for supporting wake on lan.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit 106633897e086e1b47126996aac1a427eb80eb1b)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: add MODULE_FIRMWARE for the firmware of 8111evl
Hayes Wang [Tue, 6 Sep 2011 08:55:17 +0000 (16:55 +0800)]
r8169: add MODULE_FIRMWARE for the firmware of 8111evl

Add MODULE_FIRMWARE for the firmware of RTL8111E-VL

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit bbb8af75d0a6a5138ff00fe0b1b95c4824effd55)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: fix the reset setting for 8111evl
Hayes Wang [Tue, 6 Sep 2011 08:55:16 +0000 (16:55 +0800)]
r8169: fix the reset setting for 8111evl

rtl8111evl should stop any TLP requirement before resetting by
enabling register 0x37 bit 7.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit c2b0c1e7fb69b54e704cb2dae5a80cc78a8cb0b2)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: define the early size for 8111evl
Hayes Wang [Tue, 6 Sep 2011 08:55:15 +0000 (16:55 +0800)]
r8169: define the early size for 8111evl

For RTL8111EVL, the register of MaxTxPacketSize doesn't acctually
limit the tx size. It influnces the feature of early tx.

(cherry picked from commit 3090bd9a3102331ed981280ef05ee5433ce978d7)
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: convert to SKB paged frag API.
Ian Campbell [Wed, 31 Aug 2011 00:47:06 +0000 (00:47 +0000)]
r8169: convert to SKB paged frag API.

(cherry picked from commit 929f61896e194f45696ba52852ccbfd5edd04df1)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago8139cp: convert to SKB paged frag API.
Ian Campbell [Mon, 29 Aug 2011 23:18:18 +0000 (23:18 +0000)]
8139cp: convert to SKB paged frag API.

(cherry picked from commit deb8a069e39b272c0a37bfa7a5f52d49600963a4)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agonet: remove use of ndo_set_multicast_list in realtek drivers
Joe Jin [Fri, 18 May 2012 02:10:06 +0000 (10:10 +0800)]
net: remove use of ndo_set_multicast_list in realtek drivers

replace it by ndo_set_rx_mode for realtek devices

(backported from commit afc4b13df143122f99a0eb10bfefb216c2806de0)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169 : MAC address change fix for the 8168e-vl.
françois romieu [Tue, 2 Aug 2011 03:53:43 +0000 (03:53 +0000)]
r8169 : MAC address change fix for the 8168e-vl.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=39252

Hayes suggested that the usual MAC{0, 4} register writes be completed
with writes to extended GigaMAC registers :
- 0xe0 .. 0xe5
- 0xf2 .. 0xf7

Registers 0xf0 and 0xf1 should be set to 0.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c28aa38567101bad4e020f4392df41d0bf6c165c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agor8169: use pci_dev->subsystem_{vendor|device}
Sergei Shtylyov [Fri, 22 Jul 2011 05:37:24 +0000 (05:37 +0000)]
r8169: use pci_dev->subsystem_{vendor|device}

The driver reads PCI subsystem IDs from the PCI configuration registers while
they are already stored by the PCI subsystem in the 'subsystem_{vendor|device}'
fields of 'struct pci_dev'...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ccbae55e1c6dc18e95d72c044cf9345ea08abf7b)

Signed-off-by: Joe Jin <joe.jin@oracle.com>