openwrt/staging/blogic.git
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.32
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.32

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.31
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.31

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.29
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.29

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.28
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.28

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.27
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.27

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.26
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.26

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.25
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.25

There is one change needed here to get compilation
working on v2.6.24, strict_strtoull is now being
redefined and because of a change that went into
v2.6.38.4 kstrtoul() was added there and the old
strict_strtoul was made a define from it. To help
aid the older kernels such as 2.6.24 that need
the old strict_strtoul we simply check if strict_strtoull
is defined, then we know you're on >= 2.6.38.4 and
don't need kstrtoul() and friends.

If strict_strtoull ever needs to be backported for
older kernels we'll have to revisit this check.

It is worth documenting here why this change went into
v2.6.38.4 and not the orignal v2.6.38 release, so
the commit is provided.

commit 280a1c38c907ab1e2617bdcef66de6bc70897253
Author: Alexey Dobriyan <adobriyan@gmail.com>

    kstrto*: converting strings to integers done (hopefully) right

    commit 33ee3b2e2eb9b4b6c64dcf9ed66e2ac3124e748c upstream.

    1. simple_strto*() do not contain overflow checks and crufty,
       libc way to indicate failure.
    2. strict_strto*() also do not have overflow checks but the name and
       comments pretend they do.
    3. Both families have only "long long" and "long" variants,
       but users want strtou8()
    4. Both "simple" and "strict" prefixes are wrong:
       Simple doesn't exactly say what's so simple, strict should not exist
       because conversion should be strict by default.

    The solution is to use "k" prefix and add convertors for more types.
    Enter
        kstrtoull()
        kstrtoll()
        kstrtoul()
        kstrtol()
        kstrtouint()
        kstrtoint()

        kstrtou64()
        kstrtos64()
        kstrtou32()
        kstrtos32()
        kstrtou16()
        kstrtos16()
        kstrtou8()
        kstrtos8()

    Include runtime testsuite (somewhat incomplete) as well.

    strict_strto*() become deprecated, stubbed to kstrto*() and
    eventually will be removed altogether.

    Use kstrto*() in code today!

    Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if
          they'll be unused at runtime. This is temporarily solution,
          because I don't want to hardcode list of archs where these
          functions aren't needed. Current solution with sizeof() and
          __alignof__ at least always works.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tested with ckmake:

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.24
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.24

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: embrace LINUX_BACKPORT() for v2.6.23
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: embrace LINUX_BACKPORT() for v2.6.23

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add LINUX_BACKPORT() for prefixing symbols
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: add LINUX_BACKPORT() for prefixing symbols

Ben Hutchings <ben@decadent.org.uk> notes that "compat"
is already taken as a prefix for symbols and while this
is only slightly true in practice its best we avoid any
future issues.

Others in the past have noted issues with symbols exported
by backporting effort to conflict with other symbols that
might be preferred by the running kernel. In the worst
case scenerio we'd have the same subsystems with two eras
with two sets of drivers using a subystem from an era each.
This patch doesn't address that but tries to address the
namespace conflict by compat itself. The best alternative I
was hoping for was to use core module symbol namespaces but
after reviewing that effort introduced in 2007
by Andi Kleen [0] I see in the end Rusty Russell nack'd
these patches [1] so we're left with dealing with symbol
renaming.

Define LINUX_BACKPORT() to be used to allow us to rename
symbols with a backport_ prefix. The the cleanest, but
its a start.

[0] http://thread.gmane.org/gmane.linux.network/78674
[1] http://article.gmane.org/gmane.linux.kernel/606885

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: use EXPORT_SYMBOL_GPL()
Luis R. Rodriguez [Wed, 20 Mar 2013 00:57:13 +0000 (17:57 -0700)]
compat: use EXPORT_SYMBOL_GPL()

This was the intent all along, however some symbols have
slipped. The goal is always clear: if you are using any
of this code at run time this is making your code derivative
works of the Linux kernel and therefore GPLv2.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix ckmake to skip same base kernels
Luis R. Rodriguez [Fri, 15 Mar 2013 02:05:47 +0000 (19:05 -0700)]
compat: fix ckmake to skip same base kernels

The ckmake script was allowing testing of compilation
of kernels even if the base kernels were the same. This
fixes it to skip them, trimming down test kernel compilation
down and not caring what old kernels you keep on your
system. This also now prints the RC release correctly.

The get_rel_spec() routine is based on the rel-html
get_rel_spec() routine and rel-html is AGPL but since
I wrote it I relicense a modified version of that
routine here to GPLv2.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport print_hex_dump_debug()
Luis R. Rodriguez [Thu, 14 Mar 2013 22:08:01 +0000 (15:08 -0700)]
compat: backport print_hex_dump_debug()

This backports print_hex_dump_debug() from commit
7a555613, which itself required a definition from
commit 07613b0b.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 7a555613
v3.9-rc1~128^2~135

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 07613b0b
v3.2-rc1~184^2~6

commit 7a555613eb77c69eb6e48b61bc5f72dd42fa1780
Author: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Date:   Wed Dec 5 16:48:27 2012 -0500

    dynamic_debug: dynamic hex dump

    Introduce print_hex_dump_debug() that can be dynamically controlled, similar to
    pr_debug.

    Also, make print_hex_dump_bytes() dynamically controlled

    Implement only 'p' flag (_DPRINTK_FLAGS_PRINT) to keep it simple since hex dump prints
    multiple lines and long prefix would impact readability.
    To provide line/file etc. information, use pr_debug or similar
    before/after print_hex_dump_debug()

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 07613b0b5ef8570033aa806d1731dce599862223
Author: Jason Baron <jbaron@redhat.com>
Date:   Tue Oct 4 14:13:15 2011 -0700

    dynamic_debug: consolidate repetitive struct _ddebug descriptor definitions

    Replace the repetitive struct _ddebug descriptor definitions with a new
    DECLARE_DYNAMIC_DEBUG_META_DATA(name, fmt) macro.

    [akpm@linux-foundation.org: s/DECLARE/DEFINE/]
Signed-off-by: Jason Baron <jbaron@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix compilation on 2.6.24 based on next-20130312
Luis R. Rodriguez [Thu, 14 Mar 2013 18:58:10 +0000 (11:58 -0700)]
compat: fix compilation on 2.6.24 based on next-20130312

drivers/net/wireless/iwlwifi/mvm/mac80211.c ends up
including include/net/inet_hashtables.h which in 2.6.24
has a routine called __inet_lookup_established() that
uses the sk_for_each(1, 2, 3). The patch below by Hauke
backported the change that went into the kernel that
made sk_for_each(1, 3) use two arguments. It turns out
that upstream we realized that the second argument was
useless. The header however uses it though so the trick
didn't work for 2.6.24 if code used it there.

We fix it using a nasty hack by ensuring that when the
header file is included we redefine that routine to
something else, then we udef it, and then define our
new version that only uses the 2 argument form of
sk_for_each(). This is a nasty way to solve it but
not sure if there is anything cleaner.

commit dbc390647a841061954f67ea226221fc7f4b3836
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Sun Feb 10 20:10:10 2013 +0100

    compat: backport drop of node parameter from iterators

    This patch backports the following commit in mainline linux kernel:

      commit 0bbacca7c3911451cea923b0ad6389d58e3d9ce9
      Author: Sasha Levin <sasha.levin@oracle.com>
      Date:   Thu Feb 7 12:32:18 2013 +1100

          hlist: drop the node parameter from iterators

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport rename of random32 to prandom
Luis R. Rodriguez [Wed, 13 Mar 2013 09:51:15 +0000 (02:51 -0700)]
compat: backport rename of random32 to prandom

mcgrof@frijol ~/linux-next (git::master)$ git describe \
--contains  496f2f93b1cc286f5a4f4f9acdc1e5314978683f
v3.8-rc1~74^2~22

commit 496f2f93b1cc286f5a4f4f9acdc1e5314978683f
Author: Akinobu Mita <akinobu.mita@gmail.com>
Date:   Mon Dec 17 16:04:23 2012 -0800

    random32: rename random32 to prandom

    This renames all random32 functions to have 'prandom_' prefix as follows:

      void prandom_seed(u32 seed);      /* rename from srandom32() */
      u32 prandom_u32(void);            /* rename from random32() */
      void prandom_seed_state(struct rnd_state *state, u64 seed);
                                /* rename from prandom32_seed() */
      u32 prandom_u32_state(struct rnd_state *state);
                                /* rename from prandom32() */

    The purpose of this renaming is to prevent some kernel developers from
    assuming that prandom32() and random32() might imply that only
    prandom32() was the one using a pseudo-random number generator by
    prandom32's "p", and the result may be a very embarassing security
    exposure.  This concern was expressed by Theodore Ts'o.

    And furthermore, I'm going to introduce new functions for getting the
    requested number of pseudo-random bytes.  If I continue to use both
    prandom32 and random32 prefixes for these functions, the confusion
    is getting worse.

    As a result of this renaming, "prandom_" is the common prefix for
    pseudo-random number library.

    Currently, srandom32() and random32() are preserved because it is
    difficult to rename too many users at once.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Robert Love <robert.w.love@intel.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: David Laight <david.laight@aculab.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add 3.9-rc1 vanilla kernel to list of kernels to test
Luis R. Rodriguez [Thu, 7 Mar 2013 20:58:29 +0000 (12:58 -0800)]
compat: add 3.9-rc1 vanilla kernel to list of kernels to test

This adds the vanilla 3.9-rc1 kernel to the list set list of
test kernels we'll test.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add file_inode()
Hauke Mehrtens [Wed, 27 Feb 2013 23:54:58 +0000 (00:54 +0100)]
compat: add file_inode()

This adds a backport for file_inode().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: update kernel versions in bin/get-compat-kernels
Hauke Mehrtens [Tue, 19 Feb 2013 22:26:31 +0000 (23:26 +0100)]
compat: update kernel versions in bin/get-compat-kernels

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: deactivate netdev_set_default_ethtool_ops() for some 3.7 kernels
Hauke Mehrtens [Mon, 18 Feb 2013 21:37:36 +0000 (22:37 +0100)]
compat: deactivate netdev_set_default_ethtool_ops() for some 3.7 kernels

netdev_set_default_ethtool_ops() was backported in 3.7.8 and compat
should not ship it on any more recent versions any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: backport of lock_map_acquire() and lock_map_release()
Hauke Mehrtens [Wed, 13 Feb 2013 19:51:00 +0000 (20:51 +0100)]
compat: backport of lock_map_acquire() and lock_map_release()

This is a backport of:

commit 3295f0ef9ff048a4619ede597ad9ec9cab725654
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Aug 11 10:30:30 2008 +0200

    lockdep: rename map_[acquire|release]() => lock_map_[acquire|release]()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: backport of lock_map_acquire_read()
Hauke Mehrtens [Wed, 13 Feb 2013 19:50:02 +0000 (20:50 +0100)]
compat: backport of lock_map_acquire_read()

This is a backport of:

commit e159489baa717dbae70f9903770a6a4990865887
Author: Tejun Heo <tj@kernel.org>
Date:   Sun Jan 9 23:32:15 2011 +0100

    workqueue: relax lockdep annotation on flush_work()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: add empty struct watchdog_device
Hauke Mehrtens [Wed, 13 Feb 2013 19:33:51 +0000 (20:33 +0100)]
compat: add empty struct watchdog_device

This is needed in some header file but so driver accesses this struct.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: add missing platform devid constants
Hauke Mehrtens [Wed, 13 Feb 2013 18:23:13 +0000 (19:23 +0100)]
compat: add missing platform devid constants

They are both set to none and will result in no id being added to the
device.

This is a backport of:

commit 689ae231afbac8979f96100b372a5a73458baaa9
Author: Jean Delvare <khali@linux-fr.org>
Date:   Fri Jul 27 22:14:59 2012 +0200

    platform: Add support for automatic device IDs

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: add PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB
Hauke Mehrtens [Wed, 13 Feb 2013 18:23:00 +0000 (19:23 +0100)]
compat: add PCI_EXP_LNKCAP_SLS_2_5GB and PCI_EXP_LNKCAP_SLS_5_0GB

This is a backport of:

commit 130f1b8f35f14d27c43da755f3c9226318c17f57
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Wed Dec 26 10:39:23 2012 -0700

    PCI: Add PCIe Link Capability link speed and width names

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: move tty_flip_buffer_push() and tty_insert_flip_string()
Hauke Mehrtens [Sun, 10 Feb 2013 21:49:06 +0000 (22:49 +0100)]
compat: move tty_flip_buffer_push() and tty_insert_flip_string()

These backports are also needed for kernel 3.7 and 3.8.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: add kernel 3.8-rc7 and update others
Hauke Mehrtens [Sun, 10 Feb 2013 19:51:22 +0000 (20:51 +0100)]
compat: add kernel 3.8-rc7 and update others

This adds 3.8-rc7 to the get.compat-kernels fetch script and updates
some kernel versions to the last minor version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: check if efi_enabled() was already backported
Hauke Mehrtens [Sun, 10 Feb 2013 20:50:15 +0000 (21:50 +0100)]
compat: check if efi_enabled() was already backported

efi_enabled() gets backported to older kernel versions and if this is
the case compat should not try to do the same.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: backport drop of node parameter from iterators
Hauke Mehrtens [Sun, 10 Feb 2013 19:10:10 +0000 (20:10 +0100)]
compat: backport drop of node parameter from iterators

This patch backports the following commit in mainline linux kernel:

  commit 0bbacca7c3911451cea923b0ad6389d58e3d9ce9
  Author: Sasha Levin <sasha.levin@oracle.com>
  Date:   Thu Feb 7 12:32:18 2013 +1100

      hlist: drop the node parameter from iterators

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: backport idr_alloc() usage
Hauke Mehrtens [Sun, 10 Feb 2013 18:45:10 +0000 (19:45 +0100)]
compat: backport idr_alloc() usage

This backports a patch series send by Tejun Heo:
https://lkml.org/lkml/2013/2/2/159

11 years agocompat: netdev_set_default_ethtool_ops() is not in kernel 3.7.5
Hauke Mehrtens [Sun, 3 Feb 2013 17:25:07 +0000 (18:25 +0100)]
compat: netdev_set_default_ethtool_ops() is not in kernel 3.7.5

netdev_set_default_ethtool_ops() should be added to compat for every
3.7.X series kernel as it is also not in 3.7.5.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: backport BUILD_BUG_ON from recent kernel
Hauke Mehrtens [Sun, 3 Feb 2013 16:20:56 +0000 (17:20 +0100)]
compat: backport BUILD_BUG_ON from recent kernel

This version of BUILD_BUG_ON does not have the following error on an
old kernel version (2.6.32 - 2.6.37):

drivers/net/wireless/iwlwifi/mvm/quota.c:145:24: error: bit-field
'<anonymous>' width not an integer constant

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: adapt signature change of tty_flip_buffer_push() and tty_insert_flip_string()
Hauke Mehrtens [Sun, 3 Feb 2013 14:08:46 +0000 (15:08 +0100)]
compat: adapt signature change of tty_flip_buffer_push() and tty_insert_flip_string()

The method signature of tty_flip_buffer_push() and
tty_insert_flip_string() was changed in these commits and this converts
it to the old behavior.

commit 2e124b4a390ca85325fae75764bef92f0547fa25
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Thu Jan 3 15:53:06 2013 +0100

    TTY: switch tty_flip_buffer_push

commit 05c7cd39907184328f48d3e7899f9cdd653ad336
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Thu Jan 3 15:53:04 2013 +0100

    TTY: switch tty_insert_flip_string

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: add efi_enabled()
Hauke Mehrtens [Sun, 3 Feb 2013 13:01:39 +0000 (14:01 +0100)]
compat: add efi_enabled()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: backport nla_put_be{16,32,64}()
Johannes Berg [Thu, 24 Jan 2013 10:44:56 +0000 (11:44 +0100)]
compat: backport nla_put_be{16,32,64}()

I intend to use these in nl80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: ckmake: do not start all build at the same time
Hauke Mehrtens [Thu, 24 Jan 2013 23:44:09 +0000 (00:44 +0100)]
compat: ckmake: do not start all build at the same time

When all builds are started at the same time this causes problems like,
because all threads want to access the same file.

In the compat-drivers build this resulted in this error for some threads:
./scripts/gen-compat-autoconf.sh: /usr/bin/env: bad interpreter: Text file busy

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: ckmake: remove lots of warning spam for the log
Hauke Mehrtens [Thu, 24 Jan 2013 21:15:21 +0000 (22:15 +0100)]
compat: ckmake: remove lots of warning spam for the log

Set the environment variable KCFLAGS = "-Wno-unused-but-set-variable"
to remove lots of spam from the log.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: ckmake: make return code 2 is error
Hauke Mehrtens [Thu, 24 Jan 2013 20:37:34 +0000 (21:37 +0100)]
compat: ckmake: make return code 2 is error

If make returns 2 it should be treat as an error and not as ok.
The documentation says 2 is returned if make encountered an error:
https://www.gnu.org/software/make/manual/html_node/Running.html

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: update kernel versions in bin/get-compat-kernels
Hauke Mehrtens [Wed, 23 Jan 2013 23:41:41 +0000 (00:41 +0100)]
compat: update kernel versions in bin/get-compat-kernels

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: do not access default_ethtool_ops
Hauke Mehrtens [Wed, 23 Jan 2013 22:54:45 +0000 (23:54 +0100)]
compat: do not access default_ethtool_ops

&default_ethtool_ops is not exported in kernel 3.7.4 and earlier and it
should be be accessed from compat.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: fix compile errors when assembly is built into modules
Felix Fietkau [Wed, 23 Jan 2013 21:22:44 +0000 (13:22 -0800)]
compat: fix compile errors when assembly is built into modules

On powerpc, modules can be compiled and linked with an assembly file, adding
missing symbols that the compiler references when using -Os.

== ckmake-report.log ==

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.50              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.33              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.17              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.5               [  OK  ]
24  3.7.0               [  OK  ]

real    0m33.803s
user    11m24.519s
sys     3m39.690s

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 years agocompat: remove trailing erroneous semicolon from compat-3.8.c
Luis R. Rodriguez [Tue, 22 Jan 2013 00:00:49 +0000 (16:00 -0800)]
compat: remove trailing erroneous semicolon from compat-3.8.c

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport netdev_set_default_ethtool_ops()
Luis R. Rodriguez [Mon, 21 Jan 2013 21:31:01 +0000 (13:31 -0800)]
compat: backport netdev_set_default_ethtool_ops()

Stanislaw found that due to commit 2c60db03 by Eric Dumazet
the wireless core was not assigning driver specific ethtool_ops.
This was fixed by Stanislaw's commit d07d7507 which added
netdev_set_default_ethtool_ops(). Since Eric's commit 2c60db03
is on v3.7-rc1 Stanislaw's fix is required down to v3.7 as well.
The d07d7507 commit is currently present on v3.8-rc4 and is on
its way to what we think may be v3.7.5. Because of this kernels
older than v3.7.5 will require the full implementation while
older kernels than v3.7.0 will require just assigning the ops
passed only if netdev has no ops already set just as we used
to have it implemented on cfg80211.

mcgrof@frijol ~/linux-stable (git::linux-3.8.y)$ git describe --contains 2c60db
v3.7-rc1~145^2~142

mcgrof@frijol ~/linux-stable (git::linux-3.8.y)$ git describe --contains d07d75
v3.8-rc4~29^2~4

ckmake results:

1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.50              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.33              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.17              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.5               [  OK  ]
24  3.7.0               [  OK  ]

real    0m34.791s
user    11m38.572s
sys     3m56.927s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix warning in usb_autopm_get_interface_no_{resume,suspend}
Hauke Mehrtens [Wed, 9 Jan 2013 16:34:23 +0000 (17:34 +0100)]
compat: fix warning in usb_autopm_get_interface_no_{resume,suspend}

This fixes the following warning on kernel version <= 2.6.31.

/compat/compat-2.6.33.c: In function ‘usb_autopm_get_interface_no_resume’:
/compat/compat-2.6.33.c:32:2: warning: passing argument 1 of ‘atomic_inc’ from incompatible pointer type [enabled by default]
/arch/x86/include/asm/atomic_64.h:85:20: note: expected ‘struct atomic_t *’ but argument is of type ‘int *’
/compat/compat-2.6.33.c: In function ‘usb_autopm_put_interface_no_suspend’:
/compat/compat-2.6.33.c:51:2: warning: passing argument 1 of ‘atomic_dec’ from incompatible pointer type [enabled by default]
/arch/x86/include/asm/atomic_64.h:98:20: note: expected ‘struct atomic_t *’ but argument is of type ‘int *’

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add ETHTOOL_FWVERS_LEN
Hauke Mehrtens [Wed, 9 Jan 2013 16:34:22 +0000 (17:34 +0100)]
compat: add ETHTOOL_FWVERS_LEN

In older kernel version this was hard coded to 32

This was added in this commit:
commit 141518c95870228da4e050fbe31a8f0c9df82c72
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Thu Dec 3 08:36:22 2009 +0000

    tg3: Add some VPD preprocessor constants

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add simple_write_to_buffer
Hauke Mehrtens [Wed, 9 Jan 2013 16:34:21 +0000 (17:34 +0100)]
compat: add simple_write_to_buffer

This was copied from fs/libfs.c

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add missing return value to netif_set_real_num_tx_queues
Hauke Mehrtens [Wed, 9 Jan 2013 16:34:20 +0000 (17:34 +0100)]
compat: add missing return value to netif_set_real_num_tx_queues

This fixes the following warning:

compat/compat-2.6.35.o
compat/compat-2.6.35.c: In function ‘netif_set_real_num_tx_queues’:
compat/compat-2.6.35.c:45:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix warning of missing struct netdev_queue
Hauke Mehrtens [Wed, 9 Jan 2013 16:34:19 +0000 (17:34 +0100)]
compat: fix warning of missing struct netdev_queue

Fix a warning on kernel version <= 2.6.26:
include/linux/compat-3.3.h:44:49: warning: ‘struct netdev_queue’ declared inside parameter list [enabled by default]

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: export platform_device_register_data()
Hauke Mehrtens [Thu, 27 Dec 2012 17:19:41 +0000 (18:19 +0100)]
compat: export platform_device_register_data()

platform_device_register_data has to be exported for kernel
version < 2.6.33. Some of these kernel have this method but do not
export it and only kernel version < 2.6.28 does not have this function.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix compiler warning in nla_get_s64()
Hauke Mehrtens [Thu, 27 Dec 2012 17:19:40 +0000 (18:19 +0100)]
compat: fix compiler warning in nla_get_s64()

This fixes the following warning:

compat/include/linux/compat-3.7.h: In function ‘nla_get_s64’:
compat/include/linux/compat-3.7.h:191:2: warning: passing argument 2 of ‘nla_memcpy’ discards ‘const’ qualifier from pointer target type [enabled by default]
In file included from include/net/genetlink.h:5:0,
                 from compat/include/linux/compat-2.6.32.h:12,
                 from compat/include/linux/compat-2.6.29.h:13,
                 from compat/include/linux/compat-2.6.h:50,
                 from <command-line>:0:

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: move HID_USB_DEVICE and HID_BLUETOOTH_DEVICE
Luis R. Rodriguez [Thu, 20 Dec 2012 02:17:56 +0000 (18:17 -0800)]
compat: move HID_USB_DEVICE and HID_BLUETOOTH_DEVICE

These were actually introduced in 2.6.28.h and as such
we were getting a lot of redefinition warnings which
can cause delays in compilation. Lets clear this up ;)

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add ionice to ckmake again
Luis R. Rodriguez [Thu, 20 Dec 2012 00:36:38 +0000 (16:36 -0800)]
compat: add ionice to ckmake again

This adds back the ionice settings on the make
call. The copying of content on the thread is not
yet reniced and although Python has utilities to
modify niceness and ionice there are privileged
requirements on the levels we want and I'm not too
sure yet how to resolve this in a reasonable way.

This for example fails:

p = psutil.Process(os.getpid())
delta = -20 - os.nice(0)
p.set_nice(delta)
p.set_ionice(psutil.IOPRIO_CLASS_RT)

This improves perfomance by about 1 minute.

real    17m53.079s
user    446m12.733s
sys     66m13.372s

Since ckmake is multithreaded now though it meant that
we had to copy the content of the code that we want to
compile for each kernel on a new directory. This work
is not reprioritized as it is nice so the best thing
I can think of is we renice the ckmake process our
ourselves and therefore children would properly inherit
the priority.

ionice -c 3 nice -n 20 ckmake

Can we do better without networking the solution ?

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: rewrite ckmake in Python
Luis R. Rodriguez [Wed, 19 Dec 2012 04:06:39 +0000 (20:06 -0800)]
compat: rewrite ckmake in Python

This rewrites ckmake in Python. I suspected that we can still
improve compilation down by making ckmake multithreaded.
I was right, and in order to make this multithreaded I picked
python and ncurses to display results. This shaves down 6
minutes for compilation of compat-drivers on 24 kernels from
25 minutes down to 19 minutes. This can likely be improved
further.

Before:

real    25m28.705s
user    506m26.003s
sys     69m45.990s

After:

real    19m4.757s
user    486m26.236s
sys     70m5.579s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add 3.2 and 3.3 kernels to rebuild headers
Luis R. Rodriguez [Sat, 15 Dec 2012 00:59:59 +0000 (16:59 -0800)]
compat: add 3.2 and 3.3 kernels to rebuild headers

The 3.2 and 3.3 kernels also require rebuilding
kernel headers for glibc dependencies.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix get-compat-kernels for rebuilding kernel headers
Luis R. Rodriguez [Sat, 15 Dec 2012 00:54:01 +0000 (16:54 -0800)]
compat: fix get-compat-kernels for rebuilding kernel headers

We need to rebuild headers for kernels >= 3.4, and while at
it account for 4.0 and x.y kernels here x > 3.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add support for forcing get-compat-kernels
Luis R. Rodriguez [Sat, 15 Dec 2012 00:32:21 +0000 (16:32 -0800)]
compat: add support for forcing get-compat-kernels

Useful for cronjobs.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add v3.7 to get-compat-kernels
Luis R. Rodriguez [Sat, 15 Dec 2012 00:26:14 +0000 (16:26 -0800)]
compat: add v3.7 to get-compat-kernels

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: adjust get-compat-kernels for root users
Luis R. Rodriguez [Sat, 15 Dec 2012 00:22:35 +0000 (16:22 -0800)]
compat: adjust get-compat-kernels for root users

Prefix the download / target directory with compat-ksrc/
if root is used.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: adjust get-compat-kernels for root usage
Luis R. Rodriguez [Sat, 15 Dec 2012 00:20:34 +0000 (16:20 -0800)]
compat: adjust get-compat-kernels for root usage

If the user id is root then don't assume we want it
under / but instead use the current directory.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport platform_device_register_data()
Luis R. Rodriguez [Wed, 12 Dec 2012 19:45:05 +0000 (11:45 -0800)]
compat: backport platform_device_register_data()

Add the helper.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains d8bf254
v2.6.28-rc1~284^2~9

commit d8bf254089a6c31d7d01a4d1d2f1861662900855
Author: Dmitry Baryshkov <dbaryshkov@gmail.com>
Date:   Mon Sep 22 14:41:40 2008 -0700

    platform: add new device registration helper

    Add a helper that registers simple platform_device w/o resources but with
    parent and device data.

    This is usefull to cleanup platform code from code that registers such
    simple devices as leds-gpio, generic-bl, etc.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mcgrof@drvbp1 ~/compat (git::master)$ time ckmake
Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    1m58.798s
user    3m59.967s
sys     1m25.585s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix compilation on hid_ignore()
Luis R. Rodriguez [Thu, 13 Dec 2012 04:38:14 +0000 (20:38 -0800)]
compat: fix compilation on hid_ignore()

This fixes compilation on the addition of hid_ignore()
for kernels older than 2.6.28.

mcgrof@drvbp1 ~/compat (git::master)$ time ckmake
Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    1m58.798s
user    3m59.967s
sys     1m25.585s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport struct hid_device_id
Luis R. Rodriguez [Thu, 13 Dec 2012 04:18:00 +0000 (20:18 -0800)]
compat: backport struct hid_device_id

Kernels older than 2.6.28 did not have this
defined. Add it.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains e8c84f9a
v2.6.28-rc1~571^2~54

commit e8c84f9a5f06912c94c38961096c994da3890a2e
Author: Jiri Slaby <jirislaby@gmail.com>
Date:   Mon May 19 15:50:01 2008 +0200

    modpost: add support for hid

    Generate aliases for hid device modules to support autoloading.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport HID_USB_DEVICE() and HID_BLUETOOTH_DEVICE()
Luis R. Rodriguez [Wed, 12 Dec 2012 19:54:49 +0000 (11:54 -0800)]
compat: backport HID_USB_DEVICE() and HID_BLUETOOTH_DEVICE()

commit 070748ed0b52399858a5967026a452bbb903a64c
Author: Henrik Rydberg <rydberg@euromail.se>
Date:   Mon Apr 23 12:07:05 2012 +0200

    HID: Create a generic device group

    Devices that do not have a special driver are handled by the generic
    driver. This patch does the same thing using device groups; Instead of
    forcing a particular driver, the appropriate driver is picked up by
    udev. As a consequence, one can now move a device from generic to
    specific handling by a simple rebind. By adding a new device id to the
    generic driver, the same thing can be done in reverse.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add HID_QUIRK_IGNORE
Luis R. Rodriguez [Wed, 12 Dec 2012 17:47:09 +0000 (09:47 -0800)]
compat: add HID_QUIRK_IGNORE

Just add the define.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 6f4303fb
v2.6.30-rc1~219^2~9

commit 6f4303fb2ec68055e793b84887a7ae0f9ea7cc2d
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Thu Jan 29 00:15:51 2009 +0100

    HID: bring back possibility to specify vid/pid ignore on module load

    When hid quirks were converted to specialized driver, the HID_QUIRK_IGNORE
    has been moved completely, as the hid_ignore_list[] has been moved into the
    generic code.

    However userspace already got used to the possibility that modprobing
    usbhid with

        'quirks=vid:pid:0x4'

    makes the device ignored by usbhid driver. So keep this quirk flag in place
    for backwards compatibility.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE
Luis R. Rodriguez [Wed, 12 Dec 2012 15:49:18 +0000 (07:49 -0800)]
compat: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

We just need the definitions.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains b5e5a37e
v2.6.35-rc1~454^2~5^2~14

commit b5e5a37e36cd4d355b875665312d7aaae4e5833c
Author: Bastien Nocera <hadess@hadess.net>
Date:   Fri Apr 16 17:19:50 2010 +0100

    HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE

    Add two quirks to make it possible for usbhid module options to
    override whether a device is ignored (HID_QUIRK_NO_IGNORE) and
    whether to connect a hiddev device (HID_QUIRK_HIDDEV_FORCE).

    Passing HID_QUIRK_NO_IGNORE for your device means that it will
    not be ignored by the HID layer, even if present in a blacklist.

    HID_QUIRK_HIDDEV_FORCE will force the creation of a hiddev for that
    device, making it accessible from user-space.

    Tested with an Apple IR Receiver, switching it from using appleir
    to using lirc's macmini driver.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport definition of HID_TYPE_USBNONE
Luis R. Rodriguez [Wed, 12 Dec 2012 02:47:44 +0000 (18:47 -0800)]
compat: backport definition of HID_TYPE_USBNONE

This is declared within the enum:

enum hid_type {
       HID_TYPE_OTHER = 0,
       HID_TYPE_USBMOUSE,
       HID_TYPE_USBNONE
};

But we just declare it as a define for 2.

This backports was added with the below commit:

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 6dc1418e
v3.1-rc1~309^2^2~14

commit 6dc1418e13144162e8bc4858789010d8f0e1e65c
Author: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Date:   Mon May 23 15:45:44 2011 -0700

    HID: yurex: recognize GeneralKeys wireless presenter as generic HID

    Unfortunately, the device seems to have the same Vendor ID and Product ID
    as YUREX leg-shakes sensors, and the commit 6bc235a2e2 ("USB: add driver
    for Meywa-Denki & Kayac YUREX") added the ID to hid_ignore_list.

    I believe that we can distinguish YUREX and the Wireless Presenter by
    device type.  The patch below makes the driver ignore only YUREX
    (bInterfaceProtocol==0), and recognize Wireless Presenter
    (bInterfaceProtocol is keyboard or mouse) as generic HID.  (I don't have
    the Wireless Presenter, so not yet ested.)

    ** YUREX lsusb information:
    Bus 002 Device 007: ID 0c45:1010 Microdia
    Device Descriptor:
       bLength                18
       bDescriptorType         1
       bcdUSB               1.10
       bDeviceClass            0 (Defined at Interface level)
       bDeviceSubClass         0
       bDeviceProtocol         0
       bMaxPacketSize0         8
       idVendor           0x0c45 Microdia
       idProduct          0x1010
       bcdDevice            0.03
       iManufacturer           1 JESS
       iProduct                2 YUREX
       iSerial                 3 10000269
       bNumConfigurations      1
       Configuration Descriptor:
         bLength                 9
         bDescriptorType         2
         wTotalLength           34
         bNumInterfaces          1
         bConfigurationValue     1
         iConfiguration          0
         bmAttributes         0xa0
           (Bus Powered)
           Remote Wakeup
         MaxPower              100mA
         Interface Descriptor:
           bLength                 9
           bDescriptorType         4
           bInterfaceNumber        0
           bAlternateSetting       0
           bNumEndpoints           1
           bInterfaceClass         3 Human Interface Device
           bInterfaceSubClass      1 Boot Interface Subclass
           bInterfaceProtocol      0 None
           iInterface              0
             HID Device Descriptor:
               bLength                 9
               bDescriptorType        33
               bcdHID               1.10
               bCountryCode            0 Not supported
               bNumDescriptors         1
               bDescriptorType        34 Report
               wDescriptorLength      31
              Report Descriptors:
                ** UNAVAILABLE **
           Endpoint Descriptor:
             bLength                 7
             bDescriptorType         5
             bEndpointAddress     0x81  EP 1 IN
             bmAttributes            3
               Transfer Type            Interrupt
               Synch Type               None
               Usage Type               Data
             wMaxPacketSize     0x0008  1x 8 bytes
             bInterval              10
    Device Status:     0x0002
       (Bus Powered)
       Remote Wakeup Enabled

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

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: Greg KH <gregkh@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
Reported-by: Thomas B?chler <thomas@archlinux.org>
Tested-by: Thomas B?chler <thomas@archlinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport PCI_EXP_LNKCTL_ASPM_L0S and PCI_EXP_LNKCTL_ASPM_L1
Luis R. Rodriguez [Wed, 12 Dec 2012 02:26:45 +0000 (18:26 -0800)]
compat: backport PCI_EXP_LNKCTL_ASPM_L0S and PCI_EXP_LNKCTL_ASPM_L1

This backports the addition of two defines added by the
commit below.

commit 7508320678b7819ac6aeb89580b8622a424ce586
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Wed Dec 5 13:51:19 2012 -0700

    PCI: Add standard PCIe Capability Link ASPM field names

    Add standard #defines for ASPM fields in PCI Express Link Capability and
    Link Control registers.

    Previously we used PCIE_LINK_STATE_L0S and PCIE_LINK_STATE_L1 directly, but
    these are defined for the Linux ASPM interfaces, e.g.,
    pci_disable_link_state(), and only coincidentally match the actual register
    bits.  PCIE_LINK_STATE_CLKPM, also part of that interface, does not match
    the register bit.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport hid_ignore()
Luis R. Rodriguez [Wed, 12 Dec 2012 02:09:10 +0000 (18:09 -0800)]
compat: backport hid_ignore()

We backport hid_ignore() as of next-20121211, that is now
used by other drivers.

mcgrof@drvbp1 ~/compat (git::master)$ time ckmake
Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    2m9.630s
user    8m55.525s
sys     2m2.460s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: generate CONFIG_COMPAT_KERNEL_3_8
Luis R. Rodriguez [Wed, 12 Dec 2012 02:05:49 +0000 (18:05 -0800)]
compat: generate CONFIG_COMPAT_KERNEL_3_8

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport unsigned netlink attribute accessors
Johannes Berg [Fri, 7 Dec 2012 01:05:16 +0000 (17:05 -0800)]
compat: backport unsigned netlink attribute accessors

These were added upstream in commit
4778e0be16c291ba6d9d55eeff3a6764fc84a071.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport napi_gro_receive()
Luis R. Rodriguez [Wed, 5 Dec 2012 00:32:46 +0000 (16:32 -0800)]
compat: backport napi_gro_receive()

Just call netif_receive_skb() for kernels older than
v2.6.29. If Enterprise Linux distributions decided to
backport GRO support onto a kernel older than 2.6.29,
they'll likely want #ifdef this out accordingly.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains d565b0a1
v2.6.29-rc1~581^2~181

commit d565b0a1a9b6ee7dff46e1f68b26b526ac11ae50
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Mon Dec 15 23:38:52 2008 -0800

    net: Add Generic Receive Offload infrastructure

    This patch adds the top-level GRO (Generic Receive Offload) infrastructure.
    This is pretty similar to LRO except that this is protocol-independent.
    Instead of holding packets in an lro_mgr structure, they're now held in
    napi_struct.

    For drivers that intend to use this, they can set the NETIF_F_GRO bit and
    call napi_gro_receive instead of netif_receive_skb or just call netif_rx.
    The latter will call napi_receive_skb automatically.  When napi_gro_receive
    is used, the driver must either call napi_complete/napi_rx_complete, or
    call napi_gro_flush in softirq context if the driver uses the primitives
    __napi_complete/__napi_rx_complete.

    Protocols will set the gro_receive and gro_complete function pointers in
    order to participate in this scheme.

    In addition to the packet, gro_receive will get a list of currently held
    packets.  Each packet in the list has a same_flow field which is non-zero
    if it is a potential match for the new packet.  For each packet that may
    match, they also have a flush field which is non-zero if the held packet
    must not be merged with the new packet.

    Once gro_receive has determined that the new skb matches a held packet,
    the held packet may be processed immediately if the new skb cannot be
    merged with it.  In this case gro_receive should return the pointer to
    the existing skb in gro_list.  Otherwise the new skb should be merged into
    the existing packet and NULL should be returned, unless the new skb makes
    it impossible for any further merges to be made (e.g., FIN packet) where
    the merged skb should be returned.

    Whenever the skb is merged into an existing entry, the gro_receive
    function should set NAPI_GRO_CB(skb)->same_flow.  Note that if an skb
    merely matches an existing entry but can't be merged with it, then
    this shouldn't be set.

    If gro_receive finds it pointless to hold the new skb for future merging,
    it should set NAPI_GRO_CB(skb)->flush.

    Held packets will be flushed by napi_gro_flush which is called by
    napi_complete and napi_rx_complete.

    Currently held packets are stored in a singly liked list just like LRO.
    The list is limited to a maximum of 8 entries.  In future, this may be
    expanded to use a hash table to allow more flows to be held for merging.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backplane mode negotiation ethtool definitions
Luis R. Rodriguez [Tue, 4 Dec 2012 21:46:45 +0000 (21:46 +0000)]
compat: backplane mode negotiation ethtool definitions

This backports the ethtool definitions implemented on
commit 894b19a6.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 894b19a6
v2.6.31-rc1~14^2~577

commit 894b19a6b343ce3589237167a56e6df0fe72ef0d
Author: Ben Hutchings <bhutchings@solarflare.com>
Date:   Wed Apr 29 08:25:57 2009 +0000

    ethtool/mdio: Support backplane mode negotiation

    Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: rename MDIO exported symbols
Luis R. Rodriguez [Tue, 4 Dec 2012 21:12:46 +0000 (21:12 +0000)]
compat: rename MDIO exported symbols

compat-drivers now has support for carrying over the
MDIO module. To help it avoid clashes with already in
place drivers that rely on the older MDIO module we
rename the exported symbols of the shinier module with
a compat_ prefix.

An alternative to this strategy is to have compat-drivers
work under a separate namespace but we have yet to receive
patches for that, although we hear someone did it.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport netif_set_real_num_rx_queues()
Luis R. Rodriguez [Tue, 4 Dec 2012 01:36:15 +0000 (17:36 -0800)]
compat: backport netif_set_real_num_rx_queues()

netif_set_real_num_rx_queues() was added on v2.6.37 but
requires CONFIG_RPS support which was added on v2.6.35.
A few updates were done on the net core though to support
changing the number of RX queues if the device was already
registered. We can't support this on older kernels though
so the best we can do is for kernels >= 2.6.35 simply try
to update the num_rx_queues and if the device is registered
fail.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 62fe0b40
v2.6.37-rc1~147^2~340

commit 62fe0b40abb3484413800edaef9b087a20059acf
Author: Ben Hutchings <bhutchings@solarflare.com>
Date:   Mon Sep 27 08:24:33 2010 +0000

    net: Allow changing number of RX queues after device allocation

    For RPS, we create a kobject for each RX queue based on the number of
    queues passed to alloc_netdev_mq().  However, drivers generally do not
    determine the numbers of hardware queues to use until much later, so
    this usually represents the maximum number the driver may use and not
    the actual number in use.

    For TX queues, drivers can update the actual number using
    netif_set_real_num_tx_queues().  Add a corresponding function for RX
    queues, netif_set_real_num_rx_queues().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
mcgrof@drvbp1 ~/compat (git::master)$ time ckmake
Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    2m5.270s
user    8m51.501s
sys     2m1.576s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport netif_set_real_num_tx_queues()
Luis R. Rodriguez [Mon, 3 Dec 2012 23:40:21 +0000 (15:40 -0800)]
compat: backport netif_set_real_num_tx_queues()

This was added as of v2.6.35. We implement a slightly
modified version given that this was later changed
to return int through commit e6484930. The changes
on e6484930 however were added due to some internal
changes on core networking, we'll leave in place
a simpler implementation for older kernels.

Note that for older kernels than 2.6.27 we use
the netdev egress_subqueue_count to set the TX
queue count. Commit fd2ea0a7 added real_num_tx_queues
to the netdevice when Multiqueue was added.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains f0796d5c73e59786d09a1e617689d1d415f2db44
v2.6.35-rc5~14^2~14

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 3171d026
v2.6.37-rc1~147^2~339

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains fd2ea0a7
v2.6.27-rc1~964^2~78

commit f0796d5c73e59786d09a1e617689d1d415f2db44
Author: John Fastabend <john.r.fastabend@intel.com>
Date:   Thu Jul 1 13:21:57 2010 +0000

    net: decreasing real_num_tx_queues needs to flush qdisc

    Reducing real_num_queues needs to flush the qdisc otherwise
    skbs with queue_mappings greater then real_num_tx_queues can
    be sent to the underlying driver.

    The flow for this is,

    dev_queue_xmit()
        dev_pick_tx()
                skb_tx_hash()  => hash using real_num_tx_queues
                skb_set_queue_mapping()
        ...
        qdisc_enqueue_root() => enqueue skb on txq from hash
    ...
    dev->real_num_tx_queues -= n
    ...
    sch_direct_xmit()
        dev_hard_start_xmit()
                ndo_start_xmit(skb,dev) => skb queue set with old hash

    skbs are enqueued on the qdisc with skb->queue_mapping set
    0 < queue_mappings < real_num_tx_queues.  When the driver
    decreases real_num_tx_queues skb's may be dequeued from the
    qdisc with a queue_mapping greater then real_num_tx_queues.

    This fixes a case in ixgbe where this was occurring with DCB
    and FCoE. Because the driver is using queue_mapping to map
    skbs to tx descriptor rings we can potentially map skbs to
    rings that no longer exist.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit e6484930d7c73d324bccda7d43d131088da697b9
Author: Tom Herbert <therbert@google.com>
Date:   Mon Oct 18 18:04:39 2010 +0000

    net: allocate tx queues in register_netdevice

    This patch introduces netif_alloc_netdev_queues which is called from
    register_device instead of alloc_netdev_mq.  This makes TX queue
    allocation symmetric with RX allocation.  Also, queue locks allocation
    is done in netdev_init_one_queue.  Change set_real_num_tx_queues to
    fail if requested number < 1 or greater than number of allocated
    queues.

Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit fd2ea0a79faad824258af5dcec1927aa24d81c16
Author: David S. Miller <davem@davemloft.net>
Date:   Thu Jul 17 01:56:23 2008 -0700

    net: Use queue aware tests throughout.

    This effectively "flips the switch" by making the core networking
    and multiqueue-aware drivers use the new TX multiqueue structures.

    Non-multiqueue drivers need no changes.  The interfaces they use such
    as netif_stop_queue() degenerate into an operation on TX queue zero.
    So everything "just works" for them.

    Code that really wants to do "X" to all TX queues now invokes a
    routine that does so, such as netif_tx_wake_all_queues(),
    netif_tx_stop_all_queues(), etc.

    pktgen and netpoll required a little bit more surgery than the others.

    In particular the pktgen changes, whilst functional, could be largely
    improved.  The initial check in pktgen_xmit() will sometimes check the
    wrong queue, which is mostly harmless.  The thing to do is probably to
    invoke fill_packet() earlier.

    The bulk of the netpoll changes is to make the code operate solely on
    the TX queue indicated by by the SKB queue mapping.

    Setting of the SKB queue mapping is entirely confined inside of
    net/core/dev.c:dev_pick_tx().  If we end up needing any kind of
    special semantics (drops, for example) it will be implemented here.

    Finally, we now have a "real_num_tx_queues" which is where the driver
    indicates how many TX queues are actually active.

    With IGB changes from Jeff Kirsher.

Signed-off-by: David S. Miller <davem@davemloft.net>
mcgrof@drvbp1 ~/compat (git::master)$ time ckmake
Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    1m51.110s
user    4m58.571s
sys     1m39.282s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport PTR_RET()
Luis R. Rodriguez [Mon, 3 Dec 2012 21:23:12 +0000 (13:23 -0800)]
compat: backport PTR_RET()

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains fa9ee9c4
v2.6.39-rc1~267

commit fa9ee9c4b9885dfdf8eccac19b8b4fc8a7c53288
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Tue Mar 22 16:34:05 2011 -0700

    include/linux/err.h: add a function to cast error-pointers to a return value

    PTR_RET() can be used if you have an error-pointer and are only interested
    in the eventual error value, but not the pointer.  Yields the usual 0 for
    no error, -ESOMETHING otherwise.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport definition of PCI_MSIX_ENTRY_CTRL_MASKBIT
Luis R. Rodriguez [Mon, 3 Dec 2012 19:50:49 +0000 (11:50 -0800)]
compat: backport definition of PCI_MSIX_ENTRY_CTRL_MASKBIT

This backports the addition of PCI_MSIX_ENTRY_CTRL_MASKBIT.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 8d805286968811223cca002134ba3d81244d5313
v2.6.38-rc1~55^2~14

commit 8d805286968811223cca002134ba3d81244d5313
Author: Sheng Yang <sheng@linux.intel.com>
Date:   Thu Nov 11 15:46:55 2010 +0800

    PCI: Add mask bit definition for MSI-X table

    Then we can use it instead of magic number 1.

Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport alloc_etherdev_mqs()
Luis R. Rodriguez [Mon, 3 Dec 2012 19:38:20 +0000 (11:38 -0800)]
compat: backport alloc_etherdev_mqs()

This backports support for alloc_netdev_mqs(). The routine adds
support for specifying different TX queues and RX queues. In older
kernels we were only able to request the equal amount of queues for
both TX and RX. To backport this simply ignore the RX queue count.

The commit that added alloc_netdev_mq() with equal amount of TX
and RX queues was added via f25f4e44 onto kernel v2.6.23.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains  36909ea4
v2.6.38-rc1~50^2~46

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains f25f4e44
v2.6.23-rc1~1109^2~115

commit 36909ea43814cba34f7c921e99cba33d770a54e1
Author: Tom Herbert <therbert@google.com>
Date:   Sun Jan 9 19:36:31 2011 +0000

    net: Add alloc_netdev_mqs function

    Added alloc_netdev_mqs function which allows the number of transmit and
    receive queues to be specified independenty.  alloc_netdev_mq was
    changed to a macro to call the new function.  Also added
    alloc_etherdev_mqs with same purpose.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
commit f25f4e44808f0f6c9875d94ef1c41ef86c288eb2
Author: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Date:   Fri Jul 6 13:36:20 2007 -0700

    [CORE] Stack changes to add multiqueue hardware support API

    Add the multiqueue hardware device support API to the core network
    stack.  Allow drivers to allocate multiple queues and manage them at
    the netdev level if they choose to do so.

    Added a new field to sk_buff, namely queue_mapping, for drivers to
    know which tx_ring to select based on OS classification of the flow.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport PCI MSI-X entry definitions
Luis R. Rodriguez [Sat, 1 Dec 2012 19:22:09 +0000 (11:22 -0800)]
compat: backport PCI MSI-X entry definitions

The PCI MSI-X entries were moved to uapi headers on v2.6.38
to allow drivers to use it. Older kernels will need this.

mcgrof@frijol ~/linux-stable (git::linux-3.2.y)$ git describe --contains 00aaaef9
v2.6.38-rc1~55^2~15

commit 00aaaef9a51a1a25c5d6d52ce510772f149a0eb0
Author: Sheng Yang <sheng@linux.intel.com>
Date:   Thu Nov 11 15:46:54 2010 +0800

    PCI: MSI: Move MSI-X entry definition to pci_regs.h

    Then it can be used by others.

Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: fix addition of NETIF_F_RXCSUM
Luis R. Rodriguez [Sat, 1 Dec 2012 18:50:33 +0000 (10:50 -0800)]
compat: fix addition of NETIF_F_RXCSUM

This needs to be defined to something and although
ckmake passed, no code was using it so we were unable
to test it at compile time really.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: define NETIF_F_RXCSUM
Luis R. Rodriguez [Sat, 1 Dec 2012 18:33:41 +0000 (10:33 -0800)]
compat: define NETIF_F_RXCSUM

We can't really backport this so just define it.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains e83d360d
v2.6.39-rc1~468^2~336

commit e83d360d9a7e5d71d55c13e96b19109a2ea23bf0
Author: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date:   Tue Feb 15 16:59:18 2011 +0000

    net: introduce NETIF_F_RXCSUM

    Introduce NETIF_F_RXCSUM to replace device-private flags for RX checksum
    offload. Integrate it with ndo_fix_features.

    ethtool_op_get_rx_csum() is removed altogether as nothing in-tree uses it.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
mcgrof@drvbp1 ~/compat (git::master)$ time ckmake

Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    1m59.783s
user    8m11.111s
sys     1m56.675s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport BQL helpers
Luis R. Rodriguez [Sat, 1 Dec 2012 17:58:24 +0000 (09:58 -0800)]
compat: backport BQL helpers

This backports the addition of Byte Queue Limit functional
helpers. BQL was added as of v3.3 but some Linux distributions
have backported BQL to their v3.2 kernels or older. To
address this we assume that they also enabled CONFIG_BQL
and test for that and simply avoid adding the BWL work
if CONFIG_BQL is defined.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains c5d67bd7
v3.3-rc1~182^2~426

commit c5d67bd78c5dc540e3461c36fb3d389fbe0de4c3
Author: Tom Herbert <therbert@google.com>
Date:   Mon Nov 28 16:32:52 2011 +0000

    net: Add netdev interfaces for recording sends/comp

    Add interfaces for drivers to call for recording number of packets and
    bytes at send time and transmit completion.  Also, added a function to
    "reset" a queue.  These will be used by Byte Queue Limits.

Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
mcgrof@drvbp1 ~/compat (git::master)$ time ckmake
Trying kernel 3.6.5-030605-generic [OK]
Trying kernel 3.5.7-030507-generic [OK]
Trying kernel 3.4.17-030417-generic [OK]
Trying kernel 3.3.8-030308-generic [OK]
Trying kernel 3.2.33-030233-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.50-030050-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063513-generic [OK]
Trying kernel 2.6.34-02063413-generic [OK]
Trying kernel 2.6.33-02063320-generic [OK]
Trying kernel 2.6.32-02063260-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    2m2.691s
user    8m34.724s
sys     2m7.708s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport ethtool to mii advertisment conversion helpers
Luis R. Rodriguez [Sat, 1 Dec 2012 01:18:50 +0000 (17:18 -0800)]
compat: backport ethtool to mii advertisment conversion helpers

Commit 28011cf1 added ethtool to mii advertisment conversion helpers.
We backport these here.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 28011cf1
v3.3-rc1~182^2~564

commit 28011cf19b75df9d3f35489a7599a97ec0b3f1a0
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Wed Nov 16 18:36:59 2011 -0500

    net: Add ethtool to mii advertisment conversion helpers

    Translating between ethtool advertisement settings and MII
    advertisements are common operations for ethernet drivers.  This patch
    adds a set of helper functions that implements the conversion.  The
    patch then modifies a couple of the drivers to use the new functions.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport ethtool_rxfh_indir_default()
Luis R. Rodriguez [Sat, 1 Dec 2012 01:10:35 +0000 (17:10 -0800)]
compat: backport ethtool_rxfh_indir_default()

This was added via commit 278bc429:

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 278bc429
v3.3-rc1~182^2~191

commit 278bc4296bd64ffd1d3913b487dc8a520e423a7a
Author: Ben Hutchings <bhutchings@solarflare.com>
Date:   Thu Dec 15 13:56:49 2011 +0000

    ethtool: Define and apply a default policy for RX flow hash indirection

    All drivers that support modification of the RX flow hash indirection
    table initialise it in the same way: RX rings are assigned to table
    entries in rotation.  Make that default policy explicit by having them
    call a ethtool_rxfh_indir_default() function.

    In the ethtool core, add support for a zero size value for
    ETHTOOL_SRXFHINDIR, which resets the table to this default.

Partly-suggested-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add gpio header for kernels older than 2.6.24
Luis R. Rodriguez [Thu, 29 Nov 2012 22:45:54 +0000 (14:45 -0800)]
compat: add gpio header for kernels older than 2.6.24

Just include_next for newer kernels and for older
kernels do not do anything.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: move config_enabled to compat-3.4.h
Hauke Mehrtens [Wed, 28 Nov 2012 22:57:40 +0000 (23:57 +0100)]
compat: move config_enabled to compat-3.4.h

config_enabled() was introduced in kernel version 3.4 and not in
version 3.1. Now some driver uses this directly and this fails without
this patch.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add kref_get_unless_zero()
Hauke Mehrtens [Wed, 28 Nov 2012 22:57:39 +0000 (23:57 +0100)]
compat: add kref_get_unless_zero()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: add eth_zero_addr()
Hauke Mehrtens [Wed, 28 Nov 2012 22:57:38 +0000 (23:57 +0100)]
compat: add eth_zero_addr()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: make compat load without CONFIG_CPU_FREQ
Hauke Mehrtens [Wed, 28 Nov 2012 22:57:37 +0000 (23:57 +0100)]
compat: make compat load without CONFIG_CPU_FREQ

If the kernel was compiled without CONFIG_CPU_FREQ cpufreq_cpu_put() is
not available, this is the case for some ARM kernels. In this case do
not add the backport function compat_cpufreq_quick_get_max to compat.ko.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: add USB_SUBCLASS_VENDOR_SPEC
Hauke Mehrtens [Mon, 5 Nov 2012 23:12:28 +0000 (00:12 +0100)]
compat: add USB_SUBCLASS_VENDOR_SPEC

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: change count to 4 for glibc kernel fix
Luis R. Rodriguez [Fri, 16 Nov 2012 05:26:09 +0000 (21:26 -0800)]
compat: change count to 4 for glibc kernel fix

I've tested this a number of times now and at least
kernel 3.2.33-030233-generic requires the loop to run
4 times.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix get-compat-kernels for libc issue again
Luis R. Rodriguez [Fri, 16 Nov 2012 05:06:22 +0000 (21:06 -0800)]
compat: fix get-compat-kernels for libc issue again

It turns out the right approach is to make clean and then
to be sure (as in some kernels it fails if run only once)
run twice make.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: run ckmake with num cpu threads
Luis R. Rodriguez [Fri, 9 Nov 2012 18:08:36 +0000 (19:08 +0100)]
compat: run ckmake with num cpu threads

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix typo in bin/get-compat-kernels
Luis R. Rodriguez [Fri, 9 Nov 2012 18:03:27 +0000 (19:03 +0100)]
compat: fix typo in bin/get-compat-kernels

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix libc dependency on bin/get-compat-kernels
Luis R. Rodriguez [Fri, 9 Nov 2012 17:58:39 +0000 (18:58 +0100)]
compat: fix libc dependency on bin/get-compat-kernels

To really hash out the issues with requirements of newer libc
we force clean, and build twice. I haven't figured out a cleaner
way to do this. If you have a better way please send a patch.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: update list of kernel headers
Hauke Mehrtens [Thu, 1 Nov 2012 19:05:31 +0000 (20:05 +0100)]
compat: update list of kernel headers

With this patch get-compat-kernels fetches the most recent minor
versions of the kernel headers from the Ubuntu mainline repository.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: encourage non-root use of bin/get-compat-kernels
Luis R. Rodriguez [Fri, 19 Oct 2012 21:22:18 +0000 (14:22 -0700)]
compat: encourage non-root use of bin/get-compat-kernels

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: add v3.6.2 vanilla kernels to bin/get-compat-kernels
Luis R. Rodriguez [Fri, 19 Oct 2012 21:21:52 +0000 (14:21 -0700)]
compat: add v3.6.2 vanilla kernels to bin/get-compat-kernels

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix first ckmake make clean assumption
Luis R. Rodriguez [Thu, 18 Oct 2012 22:13:34 +0000 (15:13 -0700)]
compat: fix first ckmake make clean assumption

Any directory should be used to make the first
'make clean' but we should get that from the KLIBS
variable. Use the first kernel found that we can
use. This fixes a complaint when your current kernel
has no kernel headers installed but you do have some
present on the compat-ksrc dir.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: backport usb_autopm_[get|put]_interface_no_[resume|suspend]()
Luis R. Rodriguez [Thu, 18 Oct 2012 21:06:36 +0000 (14:06 -0700)]
compat: backport usb_autopm_[get|put]_interface_no_[resume|suspend]()

This backports these two routines:

  * usb_autopm_get_interface_no_resume()
  * usb_autopm_put_interface_no_suspend()

These routines simply increment or decrement the USB
pm usage counter without trying to either suspend or
resume.

mcgrof@garbanzo ~/compat (git::master)$ time ckmake
Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063512-generic [OK]
Trying kernel 2.6.34-02063410-generic [OK]
Trying kernel 2.6.33-02063305-generic [OK]
Trying kernel 2.6.32-02063255-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real    1m2.113s
user    3m30.573s
sys     0m31.922s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: backport seq_file's user namespace addition
Luis R. Rodriguez [Fri, 28 Sep 2012 22:03:55 +0000 (15:03 -0700)]
compat: backport seq_file's user namespace addition

Commit adb37c4, which as per linux-next may get to
v3.7-rc1, introduced adding a user namespace to a
struct seq_file. For older kernels with CONFIG_USER_NS
support just access the user_name space via the struct
file. For kernels without CONFIG_USER_NS pass the
init_user_ns. There is a special case to handle for
kernels with CONFIG_USER_NS prior to v2.6.38 --
see commit 47a150ed which added a struct user_namespace
to struct cred.

This backports:

commit adb37c4c67f807f16beb222028fb3ce9a354dc2b
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Wed May 23 18:01:20 2012 -0600

    userns: Make seq_file's user namespace accessible

    struct file already has a user namespace associated with it
    in file->f_cred->user_ns, unfortunately because struct
    seq_file has no struct file backpointer associated with
    it, it is difficult to get at the user namespace in seq_file
    context.  Therefore add a helper function seq_user_ns to return
    the associated user namespace and a user_ns field to struct
    seq_file to be used in implementing seq_user_ns.

Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
And for kernels older than v2.6.38 this is relevant to
review:

commit 47a150edc2ae734c0f4bf50aa19499e23b9a46f8
Author: Serge E. Hallyn <serge.hallyn@canonical.com>
Date:   Fri May 13 04:27:54 2011 +0100

    Cache user_ns in struct cred

    If !CONFIG_USERNS, have current_user_ns() defined to (&init_user_ns).

    Get rid of _current_user_ns.  This requires nsown_capable() to be
    defined in capability.c rather than as static inline in capability.h,
    so do that.

    Request_key needs init_user_ns defined at current_user_ns if
    !CONFIG_USERNS, so forward-declare that in cred.h if !CONFIG_USERNS
    at current_user_ns() define.

    Compile-tested with and without CONFIG_USERNS.

Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
    [ This makes a huge performance difference for acl_permission_check(),
      up to 30%.  And that is one of the hottest kernel functions for loads
      that are pathname-lookup heavy.  ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mcgrof@garbanzo ~/compat (git::master)$ time ckmake
Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063512-generic [OK]
Trying kernel 2.6.34-02063410-generic [OK]
Trying kernel 2.6.33-02063305-generic [OK]
Trying kernel 2.6.32-02063255-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

real 1m1.219s
user 3m19.912s
sys 0m31.102s

Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>