openwrt/staging/blogic.git
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>
12 years agocompat: backport definition of VM_NODUMP and VM_DONTDUMP
Luis R. Rodriguez [Fri, 28 Sep 2012 18:06:14 +0000 (11:06 -0700)]
compat: backport definition of VM_NODUMP and VM_DONTDUMP

Commit accb61fe defined and added VM_NODUMP so we backport that
but later VM_NODUMP was renamed to VM_DONTDUMP via commit cdaaa7003.
We backport that definition declaration as well. Note though that
commit 909af768e removed the usage of the same bit field and it
was used previously for VM_ALWAYSDUMP... given that we want to
backport support for it but we can't we make this flag now a no-op
for older kernels.

Usage of VM_NODUMP or VM_DONTDUMP on older kernels will simply yield
in a no-op for memory regions.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains \
909af768e88867016f427264ae39d27a57b6a8ed
v3.4-rc1~109^2~7

commit 909af768e88867016f427264ae39d27a57b6a8ed
Author: Jason Baron <jbaron@redhat.com>
Date:   Fri Mar 23 15:02:51 2012 -0700

    coredump: remove VM_ALWAYSDUMP flag

    The motivation for this patchset was that I was looking at a way for a
    qemu-kvm process, to exclude the guest memory from its core dump, which
    can be quite large.  There are already a number of filter flags in
    /proc/<pid>/coredump_filter, however, these allow one to specify 'types'
    of kernel memory, not specific address ranges (which is needed in this
    case).

    Since there are no more vma flags available, the first patch eliminates
    the need for the 'VM_ALWAYSDUMP' flag.  The flag is used internally by
    the kernel to mark vdso and vsyscall pages.  However, it is simple
    enough to check if a vma covers a vdso or vsyscall page without the need
    for this flag.

    The second patch then replaces the 'VM_ALWAYSDUMP' flag with a new
    'VM_NODUMP' flag, which can be set by userspace using new madvise flags:
    'MADV_DONTDUMP', and unset via 'MADV_DODUMP'.  The core dump filters
    continue to work the same as before unless 'MADV_DONTDUMP' is set on the
    region.

    The qemu code which implements this features is at:

      http://people.redhat.com/~jbaron/qemu-dump/qemu-dump.patch

    In my testing the qemu core dump shrunk from 383MB -> 13MB with this
    patch.

    I also believe that the 'MADV_DONTDUMP' flag might be useful for
    security sensitive apps, which might want to select which areas are
    dumped.

    This patch:

    The VM_ALWAYSDUMP flag is currently used by the coredump code to
    indicate that a vma is part of a vsyscall or vdso section.  However, we
    can determine if a vma is in one these sections by checking it against
    the gate_vma and checking for a non-NULL return value from
    arch_vma_name().  Thus, freeing a valuable vma bit.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mcgrof@frijol ~/linux-next (git::master)$ git describe --contains accb61fe
v3.4-rc1~109^2~6

commit accb61fe7bb0f5c2a4102239e4981650f9048519
Author: Jason Baron <jbaron@redhat.com>
Date:   Fri Mar 23 15:02:51 2012 -0700

    coredump: add VM_NODUMP, MADV_NODUMP, MADV_CLEAR_NODUMP

    Since we no longer need the VM_ALWAYSDUMP flag, let's use the freed bit
    for 'VM_NODUMP' flag.  The idea is is to add a new madvise() flag:
    MADV_DONTDUMP, which can be set by applications to specifically request
    memory regions which should not dump core.

    The specific application I have in mind is qemu: we can add a flag there
    that wouldn't dump all of guest memory when qemu dumps core.  This flag
    might also be useful for security sensitive apps that want to absolutely
    make sure that parts of memory are not dumped.  To clear the flag use:
    MADV_DODUMP.

    [akpm@linux-foundation.org: s/MADV_NODUMP/MADV_DONTDUMP/, s/MADV_CLEAR_NODUMP/MADV_DODUMP/, per Roland]
    [akpm@linux-foundation.org: fix up the architectures which broke]
Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
VM_NODUMP was renamed to VM_DONTDUMP so for older kernels
just use the old declaration. This commit is not yet on
Linus' tree so in linux-next we trust it will be on v3.7-rc1.

commit cdaaa7003e855fb50be3a566ac8ef96c6ff138cd
Author: Konstantin Khlebnikov <khlebnikov@openvz.org>
Date:   Wed Sep 26 11:33:12 2012 +1000

    mm: prepare VM_DONTDUMP for using in drivers

    Rename VM_NODUMP into VM_DONTDUMP: this name matches other negative flags:
    VM_DONTEXPAND, VM_DONTCOPY.  Currently this flag used only for
    sys_madvise.  The next patch will use it for replacing the outdated flag
    VM_RESERVED.

    Also forbid madvise(MADV_DODUMP) for special kernel mappings VM_SPECIAL
    (VM_IO | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Carsten Otte <cotte@de.ibm.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Eric Paris <eparis@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
Cc: Matt Helsley <matthltc@us.ibm.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Venkatesh Pallipadi <venki@google.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: backport uidgid.h kuid_t and kgid_t addition
Luis R. Rodriguez [Fri, 28 Sep 2012 17:47:31 +0000 (10:47 -0700)]
compat: backport uidgid.h kuid_t and kgid_t addition

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains \
7a4e7408c5cadb240e068a662251754a562355e3
v3.5-rc1~107^2~33

This backports:

commit 7a4e7408c5cadb240e068a662251754a562355e3
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Mon Nov 14 14:29:51 2011 -0800

    userns: Add kuid_t and kgid_t and associated infrastructure in uidgid.h

    Start distinguishing between internal kernel uids and gids and
    values that userspace can use.  This is done by introducing two
    new types: kuid_t and kgid_t.  These types and their associated
    functions are infrastructure are declared in the new header
    uidgid.h.

    Ultimately there will be a different implementation of the mapping
    functions for use with user namespaces.  But to keep it simple
    we introduce the mapping functions first to separate the meat
    from the mechanical code conversions.

    Export overflowuid and overflowgid so we can use from_kuid_munged
    and from_kgid_munged in modular code.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
The uidgid.h header file is provided for older kernels and for
newer kernels we use include_next trick. The only difference
here is that compat-3.5.c now exports overflowuid and
overflowgid in the case that CONFIG_UID16 was not defined
given that on older kernels these were not exported although
linux/highuid.h always has historically provided the extern
declaration for them.

Apart from all this we also force inclusion of uidgid.h
within the compat framework now given that in newer
kernels its expected to be included by many header files
and modules without them having included it in upstream
code already.

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 1m0.411s
user 3m18.060s
sys 0m30.686s

Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: backport netlink pid to portid rename
Luis R. Rodriguez [Wed, 12 Sep 2012 00:39:59 +0000 (17:39 -0700)]
compat: backport netlink pid to portid rename

The patch:

commit 15e473046cb6e5d18a4d0057e61d76315230382b
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Fri Sep 7 20:12:54 2012 +0000

    netlink: Rename pid to portid to avoid confusion

    It is a frequent mistake to confuse the netlink port identifier with a
    process identifier.  Try to reduce this confusion by renaming fields
    that hold port identifiers portid instead of pid.

    I have carefully avoided changing the structures exported to
    userspace to avoid changing the userspace API.

    I have successfully built an allyesconfig kernel with this change.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Changed the struct members:

struct netlink_notify->pid    to
struct netlink_notify->portid

struct genl_info->snd_pid     to
struct genl_info->snd_portid

This adds helpers to help reduce the overhead cost to backport
this collateral evolution.

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    1m0.017s
user    3m12.748s
sys     0m30.274s

Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: drop const to fix compiler warnings
Felix Fietkau [Fri, 7 Sep 2012 07:56:14 +0000 (09:56 +0200)]
compat: drop const to fix compiler warnings

When calling pci_find_capability and pci_read_config_word, struct pci_dev
needs to be passed without const.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix typo on previous atomic changes
Luis R. Rodriguez [Thu, 6 Sep 2012 23:54:44 +0000 (16:54 -0700)]
compat: fix typo on previous atomic changes

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix ARM architecture support for atomic_t and atomic64_t changes
Mridula Prakash [Wed, 5 Sep 2012 20:17:29 +0000 (13:17 -0700)]
compat: fix ARM architecture support for atomic_t and atomic64_t changes

This ammends the patch below to extend support for ARM.

commit e079e9b66ea06373a3be82f9bed1702082a69310
Author: Luis R. Rodriguez <mcgrof@frijolero.org>
Date:   Tue Feb 7 19:22:02 2012 -0800

    compat: backport making atomic_t and atomic64_t universal

    mcgrof@tux ~/linux-next (git::master)$ \
        git describe --contains ea435467500612636f8f4fb639ff6e76b2496e4b
    v2.6.29-rc1~390

    This commit moved atomic_t and atomic64_t to a generic
    place, but some archs already had it defined. Just include
    that header for the archs that had it.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
ARM also had atomic.h before that commit upstream.

Signed-off-by: Mridula Prakash <Mridula.Prakash@lnties.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: backport PCI: Add accessors for PCI Express Capability
Luis R. Rodriguez [Wed, 5 Sep 2012 01:15:30 +0000 (18:15 -0700)]
compat: backport PCI: Add accessors for PCI Express Capability

This backports this patch:

commit 8c0d3a02c1309eb6112d2e7c8172e8ceb26ecfca
Author: Jiang Liu <jiang.liu@huawei.com>
Date:   Tue Jul 24 17:20:05 2012 +0800

    PCI: Add accessors for PCI Express Capability

    The PCI Express Capability (PCIe spec r3.0, sec 7.8) comes in two
    versions, v1 and v2.  In v1 Capability structures (PCIe spec r1.0 and
    r1.1), some fields are optional, so the structure size depends on the
    device type.

    This patch adds functions to access this capability so drivers don't
    have to be aware of the differences between v1 and v2.  Note that these
    new functions apply only to the "PCI Express Capability," not to any of
    the other "PCI Express Extended Capabilities" (AER, VC, ACS, MFVC, etc.)

    Function pcie_capability_read_word/dword() reads the PCIe Capabilities
    register and returns the value in the reference parameter "val".  If
    the PCIe Capabilities register is not implemented on the PCIe device,
    "val" is set to 0.

    Function pcie_capability_write_word/dword() writes the value to the
    specified PCIe Capability register.

    Function pcie_capability_clear_and_set_word/dword() sets and/or clears bits
    of a PCIe Capability register.

    [bhelgaas: changelog, drop "pci_" prefixes, don't export
    pcie_capability_reg_implemented()]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This is not yet upstream into a public release but based on
star alignments I can confidently say this will be part
of the v3.7-rc1 release unless Linus throws a shit fit over
it.

Worth mentioning is that the pci_dev->pcie_flags_reg
is not available on older kernels so we had to write
a pcie_flags_reg() helper. Additionally a lot of pci_reg.h
updates were made into the respective header file as they
were introduced.

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    0m59.966s
user    3m12.628s
sys     0m29.542s

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: Backport eth_broadcast_addr()
Ozan Çağlayan [Thu, 23 Aug 2012 11:37:27 +0000 (14:37 +0300)]
compat: Backport eth_broadcast_addr()

This backports:

commit ad7eee98bef92481581060801bdfd1b25a6106c0
Author: Johannes Berg <johannes.berg@intel.com>
Commit: David S. Miller <davem@davemloft.net>

    etherdevice: introduce eth_broadcast_addr

    A lot of code has either the memset or an inefficient copy
    from a static array that contains the all-ones broadcast
    address. Introduce eth_broadcast_addr() to fill an address
    with all ones, making the code clearer and allowing us to
    get rid of some constant arrays.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
$ git describe --contains ad7eee98bef92481581060801bdfd1b25a6106c0
v3.6-rc1~125^2~252

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]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: Backport USB_VENDOR_AND_INTERFACE_INFO() macro
Ozan Çağlayan [Thu, 23 Aug 2012 11:37:26 +0000 (14:37 +0300)]
compat: Backport USB_VENDOR_AND_INTERFACE_INFO() macro

This backports:

commit d81a5d1956731c453b85c141458d4ff5d6cc5366
Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Date:   Tue Jul 10 19:10:06 2012 -0300

USB: add USB_VENDOR_AND_INTERFACE_INFO() macro

which is now used in btusb driver.

$ git describe --contains d81a5d1956731c453b85c141458d4ff5d6cc5366
v3.6-rc1~101^2~4

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]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: add tty_port_register_device
Hauke Mehrtens [Sat, 18 Aug 2012 11:46:54 +0000 (13:46 +0200)]
compat: add tty_port_register_device

tty_register_device was replaced by tty_port_register_device in this
commit:
commit 734cc1783816ae358cef45673a29bf7af974e147
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Tue Aug 7 21:47:47 2012 +0200

    TTY: use tty_port_register_device

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fixup firmware defines on RHEL6
Andy Gospodarek [Tue, 14 Aug 2012 18:59:49 +0000 (14:59 -0400)]
compat: fixup firmware defines on RHEL6

Commit 182630e0f686a569aaf9b34781b08f27dc0ab1bb changed the way the
firmware code was handled to create new definitions based on config
options, not based on whether or not CONFIG_COMPAT_FIRMWARE_CLASS
was set.  Both need to be included to make this work properly in
environments like RHEL6 that do not need CONFIG_COMPAT_FIRMWARE_CLASS to
be set, but have CONFIG_FW_LOADER or CONFIG_FW_LOADER_MODULE set.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: disable compat firmware module on RHEL6.0 and later
Andy Gospodarek [Tue, 14 Aug 2012 18:59:48 +0000 (14:59 -0400)]
compat: disable compat firmware module on RHEL6.0 and later

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: disable KFIFO on RHEL6.1 and later
Andy Gospodarek [Tue, 14 Aug 2012 18:59:47 +0000 (14:59 -0400)]
compat: disable KFIFO on RHEL6.1 and later

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: fix defines for RHEL by adding RHEL to string
Andy Gospodarek [Tue, 14 Aug 2012 18:59:46 +0000 (14:59 -0400)]
compat: fix defines for RHEL by adding RHEL to string

The .config file contains 'CONFIG_COMPAT_6_1,' when it should contain,
'CONFIG_COMPAT_RHEL_6_1.'  This fixes that by adding the 'RHEL' in the
proper spot.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: RHEL build script fixup from upstream
Andy Gospodarek [Tue, 14 Aug 2012 18:59:45 +0000 (14:59 -0400)]
compat: RHEL build script fixup from upstream

There are parentheses where there should be curly braces.  This is a
patch that Phillip Perry posted to the list, but it was never
integrated.

Signed-off-by: Philip J Perry <phil@elrepo.org>
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: rename compat-wireless to compat-drivers
Luis R. Rodriguez [Tue, 14 Aug 2012 17:40:24 +0000 (10:40 -0700)]
compat: rename compat-wireless to compat-drivers

The git tree name has changed. New documentation:

https://backports.wiki.kernel.org

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
12 years agocompat: Backport __wake_up_all_locked()
Ozan Çağlayan [Tue, 14 Aug 2012 16:20:25 +0000 (19:20 +0300)]
compat: Backport __wake_up_all_locked()

This backports:

commit 63b2001169e75cd71e917ec953fdab572e3f944a
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Thu Dec 1 00:04:00 2011 +0100

sched/wait: Add __wake_up_all_locked() API

$ git describe --contains 63b2001169e75cd71e917ec953fdab572e3f944a
v3.4-rc1~3^2~24

This is used by the 3.6-rcX radeon DRM driver (radeon_sa.c) and will
probably be used by other drivers in the near future.

__wake_up_all_locked() is a preprocessor macro around __wake_up_locked()
which gained a 3rd parameter in 3.4.

That's why I backported the new __wake_up_locked() as
compat_wake_up_locked() to avoid name conflicts.

This new function uses the internal __wake_up_common() function
which needed a backport too. I backported it as
compat_wake_up_common() as __wake_up_common() was made available
in kernels between 2.6.28 <= x <= 2.6.30 through wait.h and
dropped after 2.6.30. Renaming fixes build problems of compat
for those kernels.

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]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>