openwrt/staging/blogic.git
11 years agocompat: backport devm_regmap_init()
Luis R. Rodriguez [Wed, 10 Apr 2013 11:35:14 +0000 (04:35 -0700)]
compat: backport devm_regmap_init()

Backport devm_regmap_init() for I2C and SPI.
Asynchronous I/O support was added as of 3.9 and
since the regmap is part the core we don't want
to deal with trying a full backport replacement
yet. Given that no one as of next-20130328 uses
regmap asynchronous we simply warn if its ever
used for now. The regmap callbacks were made
bus agnostic as of commit 0135bbcc added on on
3.5 and becuase of this we we just remove all
that from our port given that we do this port
for kernels < 3.4.

This works with the old core regmap implementation
added as of 3.1 given that static inlines were
used as wrapper for calls and the bus context
was only used by the internal code.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains c0eb4676
v3.4-rc1~126^2~4^2

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 0d509f2b
v3.9-rc2~19^2~6^2~5

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 0135bbcc
v3.5-rc1~117^2~7^3~6

commit c0eb46766d395da8d62148bda2e59bad5e6ee2f2
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Mon Jan 30 19:56:52 2012 +0000

    regmap: Implement managed regmap_init()

    Save error handling and unwinding code in drivers by providing managed
    versions of the regmap init functions, simplifying usage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
commit 0d509f2b112b21411712f0bf789b372987967e49
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Sun Jan 27 22:07:38 2013 +0800

    regmap: Add asynchronous I/O support

    Some use cases like firmware download can transfer a lot of data in quick
    succession. With high speed buses these use cases can benefit from having
    multiple transfers scheduled at once since this allows the bus to minimise
    the delay between transfers.

    Support this by adding regmap_raw_write_async(), allowing raw transfers to
    be scheduled, and regmap_async_complete() to wait for them to finish.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
commit 0135bbcc7a0cc056f0203ff839466236b8e3dc19
Author: Stephen Warren <swarren@nvidia.com>
Date:   Wed Apr 4 15:48:30 2012 -0600

    regmap: introduce explicit bus_context for bus callbacks

    The only context needed by I2C and SPI bus definitions is the device
    itself; this can be converted to an i2c_client or spi_device in order
    to perform IO on the device. However, other bus types may need more
    context in order to perform IO. Enable this by having regmap_init accept
    a bus_context parameter, and pass this to all bus callbacks. The
    existing callbacks simply pass the struct device here. Future bus types
    may pass something else.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport __i2c_transfer()
Luis R. Rodriguez [Wed, 10 Apr 2013 11:35:13 +0000 (04:35 -0700)]
compat: backport __i2c_transfer()

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains b37d2a3a
v3.6-rc1~28^2~265

commit b37d2a3a75cb0e72e18c29336cb2095b63dabfc8
Author: Jean Delvare <khali@linux-fr.org>
Date:   Fri Jun 29 07:47:19 2012 -0300

    [media] i2c: Export an unlocked flavor of i2c_transfer

    Some drivers (in particular for TV cards) need exclusive access to
    their I2C buses for specific operations. Export an unlocked flavor
    of i2c_transfer to give them full control.

    The unlocked flavor has the following limitations:
    * Obviously, caller must hold the i2c adapter lock.
    * No debug messages are logged. We don't want to log messages while
      holding a rt_mutex.
    * No check is done on the existence of adap->algo->master_xfer. It
      is thus the caller's responsibility to ensure that the function is
      OK to call.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport dev_level_ratelimited()
Luis R. Rodriguez [Wed, 10 Apr 2013 11:35:12 +0000 (04:35 -0700)]
compat: backport dev_level_ratelimited()

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 6ca04593
v3.5-rc1~147^2~7

This is only enabled for kernels where ratelimit.h was added.

commit 6ca045930338485a8cdef117e74372aa1678009d
Author: Hiroshi DOYU <hdoyu@nvidia.com>
Date:   Mon May 14 10:47:57 2012 +0300

    driver core: Add dev_*_ratelimited() family

    Add dev_*_ratelimited() family, dev_* version of pr_*_ratelimited().

    Using Joe Perches's proposal/implementation.

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: enable DRM_NOUVEAU for 3.2
Luis R. Rodriguez [Wed, 10 Apr 2013 11:35:11 +0000 (04:35 -0700)]
backports: enable DRM_NOUVEAU for 3.2

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: include <linux/module.h> to fix module version
Johannes Berg [Wed, 10 Apr 2013 10:17:05 +0000 (12:17 +0200)]
backports: include <linux/module.h> to fix module version

Otherwise we may end up with MODULE_VERSION() not being
defined, and then compile obviously fails.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: fix module version
Johannes Berg [Tue, 9 Apr 2013 22:00:17 +0000 (00:00 +0200)]
backports: fix module version

Adding multiple MODULE_VERSION statements doesn't work on
kernels before 3.8 (where __UNIQUE_ID was introduced) so
just use a single line:

$ /sbin/modinfo .../net/mac80211/mac80211.ko
filename:       .../net/mac80211/mac80211.ko
license:        GPL
description:    IEEE 802.11 subsystem
version:        backported from Linux (next-20130405-0-g7df052b) using backports 6648f05
srcversion:     CD64527389072C2F603DD61
depends:        cfg80211,compat
vermagic:       3.8.0 SMP mod_unload modversions
parm:           max_nullfunc_tries:Maximum nullfunc tx tries before disconnecting (reason 4). (int)
parm:           max_probe_tries:Maximum probe tries before disconnecting (reason 4). (int)
parm:           probe_wait_ms:Maximum time(ms) to wait for probe response before disconnecting (reason 4). (int)
parm:           ieee80211_default_rc_algo:Default rate control algorithm for mac80211 to use (charp)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogit tracker: add special version string to build
Johannes Berg [Tue, 9 Apr 2013 21:25:50 +0000 (23:25 +0200)]
git tracker: add special version string to build

In output trees created with the git tracker, we avoid changing
the "versions" file all the time and just put "(see git)" into
the versions. However, it's useful to still be able to identify
it, and when using this the backport is (usually) built in the
git tree. Use this fact and add the git tree commit into a new
variable to put it into the MODULE_VERSION and also print it at
runtime.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: add backport version to all modules
Johannes Berg [Tue, 9 Apr 2013 09:09:44 +0000 (11:09 +0200)]
backports: add backport version to all modules

We print out the backports version at runtime, but it
can also be useful to be able to determine it from the
installed modules.

As we already override module_init() to make all our
backported modules depend on compat.ko (in order to do
exactly this -- print out the version at runtime) also
add some MODULE_VERSION directives to it.

This results in, for example for mac80211, this:

$ /sbin/modinfo .../net/mac80211/mac80211.ko
filename:       .../net/mac80211/mac80211.ko
license:        GPL
description:    IEEE 802.11 subsystem
version:        backported from: Linux (next-20130405-0-g7df052b)
version:        backports: 6e0475b
srcversion:     6C298E6033E34EA8E223D7B
depends:        cfg80211,compat
vermagic:       3.8.0 SMP mod_unload modversions
parm:           max_nullfunc_tries:Maximum nullfunc tx tries before disconnecting (reason 4). (int)
parm:           max_probe_tries:Maximum probe tries before disconnecting (reason 4). (int)
parm:           probe_wait_ms:Maximum time(ms) to wait for probe response before disconnecting (reason 4). (int)
parm:           ieee80211_default_rc_algo:Default rate control algorithm for mac80211 to use (charp)

Fuck-yeah: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: add automatic backports only if needed
Johannes Berg [Mon, 8 Apr 2013 20:36:24 +0000 (22:36 +0200)]
gentree: add automatic backports only if needed

If the automatic backports aren't selected by any
driver then they don't need to be added to the
output, so ignore them in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobuild: add NFC defconfig file
Thierry Escande [Mon, 8 Apr 2013 10:26:13 +0000 (12:26 +0200)]
build: add NFC defconfig file

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobuild: enable NFC build
Thierry Escande [Mon, 8 Apr 2013 10:26:12 +0000 (12:26 +0200)]
build: enable NFC build

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: add NFC patches
Thierry Escande [Mon, 8 Apr 2013 10:26:11 +0000 (12:26 +0200)]
backports: add NFC patches

These are NFC patches refreshed on next-20130404

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: add NFC core and drivers
Thierry Escande [Mon, 8 Apr 2013 10:26:10 +0000 (12:26 +0200)]
backports: add NFC core and drivers

This grabs NFC core and drivers files from your linux tree.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport module_i2c_driver helper macro
Thierry Escande [Mon, 8 Apr 2013 10:26:09 +0000 (12:26 +0200)]
compat: backport module_i2c_driver helper macro

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport MODULE_ALIAS_GENL_FAMILY macro
Thierry Escande [Mon, 8 Apr 2013 10:26:08 +0000 (12:26 +0200)]
compat: backport MODULE_ALIAS_GENL_FAMILY macro

This also backports MODULE_ALIAS_NET_PF_PROTO_NAME used by MODULE_ALIAS_GENL_FAMILY

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport a define for SOL_NFC
Thierry Escande [Mon, 8 Apr 2013 10:26:07 +0000 (12:26 +0200)]
compat: backport a define for SOL_NFC

This backports: "NFC: llcp: Implement socket options"

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport sk_for_each_safe
Thierry Escande [Mon, 8 Apr 2013 10:26:06 +0000 (12:26 +0200)]
compat: backport sk_for_each_safe

This is needed for NFC core.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoRevert "backport: allow using backported drivers w/o LEDs"
Johannes Berg [Mon, 8 Apr 2013 19:54:21 +0000 (21:54 +0200)]
Revert "backport: allow using backported drivers w/o LEDs"

This reverts commit 35d1b56e93e192c926c866f2f69123bddccc0826.

It broke compilation on older kernels.

11 years agogentree: make automatic backport filenames unique
Johannes Berg [Mon, 8 Apr 2013 19:11:45 +0000 (21:11 +0200)]
gentree: make automatic backport filenames unique

Instead of copying drivers/base/hdmi.c to just hdmi.c copy it to
drivers-base-hdmi.c as there can be multiple files with the same
name (e.g. "core.c"). While at it, also fix this mechanism for
modules -- before having more than a single file for a module
would have caused multiple modules which clearly can't work, now
it's needed to give a #module-name and it will be added to the
Makefile correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackport: allow using backported drivers w/o LEDs
Johannes Berg [Mon, 8 Apr 2013 16:48:52 +0000 (18:48 +0200)]
backport: allow using backported drivers w/o LEDs

When the base kernel has LED support (partially) disabled,
currently many drivers cannot be built. Since LED support
is hardy critical, work around this by providing API stubs
for the LED support code to still compile (but not work.)

This passes allyesconfig (except for some stupid rtlwifi
issue) with next-20130405 against a 3.8 kernel that has
all the LED options disabled.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackport: add patch to disable wireless extensions
Johannes Berg [Mon, 8 Apr 2013 17:20:04 +0000 (19:20 +0200)]
backport: add patch to disable wireless extensions

There's no way to build wireless extensions out of tree,
remove the Kconfig support for them entirely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackport patches: rename/combine some patches
Johannes Berg [Sat, 6 Apr 2013 20:52:26 +0000 (22:52 +0200)]
backport patches: rename/combine some patches

It's not efficient to have a large number of patches,
but necessary to split patches per driver or subsystem
to allow copying only parts. I had split them per file
as that was easy to generate, now combine a few again
and move some into the higher directory level.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: apply patches on by one
Johannes Berg [Sat, 6 Apr 2013 20:42:05 +0000 (22:42 +0200)]
gentree: apply patches on by one

Instead of trying to infer the directory structure, which
was only used for verbose output and the git debug option,
just apply the patches on by one in the correct order.

Also warn if finding a .patch file that doesn't contain a
patch, just in case the patch library doesn't understand
some patches properly, for debugging purposes mostly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: only apply .patch files
Johannes Berg [Fri, 5 Apr 2013 23:10:33 +0000 (01:10 +0200)]
gentree: only apply .patch files

This helps not have to ignore any other random
editor backup files etc.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: rename all patches to *.patch
Johannes Berg [Fri, 5 Apr 2013 23:06:03 +0000 (01:06 +0200)]
backports: rename all patches to *.patch

Also combine some that would otherwise have
the same names (where .c and .h files with
the same name exist)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: really enable DRM
Johannes Berg [Fri, 5 Apr 2013 21:17:05 +0000 (23:17 +0200)]
backports: really enable DRM

This was previously not really enabled because it wasn't
in the Makefile.kernel, add it there. Also add a defconfig
file for all DRM drivers.

This passes ckmake --defconfig drm:

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

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: fix IS_ENABLED() backport
Johannes Berg [Fri, 5 Apr 2013 21:44:50 +0000 (23:44 +0200)]
backports: fix IS_ENABLED() backport

The 3.4 version was erroneously put into the backports for
kernels < 3.1, so for 3.2/3.3 it would not work correctly
as the dependencies weren't there. Fix this by backporting
it if the kernel is < 3.4 regardless of whether it may
already have been present, since it's broken before 3.4.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: fake pci_platform_rom
Johannes Berg [Fri, 5 Apr 2013 21:26:56 +0000 (23:26 +0200)]
backports: fake pci_platform_rom

We can't really port it as the code kept changing
and it doesn't exist on older kernels, so just
disable it completely for now but print a warning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agockmake: allow using defconfig file
Johannes Berg [Fri, 5 Apr 2013 21:14:30 +0000 (23:14 +0200)]
ckmake: allow using defconfig file

This is useful to check only a certain subsystem, e.g. DRM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomake lib: don't require a space after assignments
Johannes Berg [Fri, 5 Apr 2013 21:05:32 +0000 (23:05 +0200)]
make lib: don't require a space after assignments

Some makefiles have just

obj-$(...)+=

which wasn't parsed correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agockmake: fix getting number of CPUs
Johannes Berg [Fri, 5 Apr 2013 19:42:26 +0000 (21:42 +0200)]
ckmake: fix getting number of CPUs

The code to get the number of CPUs is wrong, it finds the
maximum *string* between the CPUs and then converts it to
an integer after that -- fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agorefresh drm patches for next-20130404
Johannes Berg [Fri, 5 Apr 2013 19:24:00 +0000 (21:24 +0200)]
refresh drm patches for next-20130404

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: add DRM drivers
Luis R. Rodriguez [Fri, 5 Apr 2013 16:38:19 +0000 (09:38 -0700)]
backports: add DRM drivers

They are building just fine so enable them.

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

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: remove DRM nouveau kconfig patches
Luis R. Rodriguez [Fri, 5 Apr 2013 16:38:18 +0000 (09:38 -0700)]
backports: remove DRM nouveau kconfig patches

These are no longer needed.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackports: remove dma-buf patches
Luis R. Rodriguez [Fri, 5 Apr 2013 16:38:17 +0000 (09:38 -0700)]
backports: remove dma-buf patches

These are no longer needed given that dma-buf is
now backported.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: add HDMI library support
Luis R. Rodriguez [Fri, 5 Apr 2013 16:38:16 +0000 (09:38 -0700)]
compat: add HDMI library support

HDMI was being carried over through compat-drivers but that
was a mistake as all its doing is providing helper routines.
It was also defining it as a module which was tainting the
kernel! This introduces hdmi into the backports tree in the
correct way instead.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains \
f142d3bd556c5e82e9bb3d33d07d6708702ea4ce
v3.9-rc1~83^2~1^2~4

commit f142d3bd556c5e82e9bb3d33d07d6708702ea4ce
Author: Thierry Reding <thierry.reding@avionic-design.de>
Date:   Wed Nov 21 15:29:29 2012 +0100

    video: Add generic HDMI infoframe helpers

    Add generic helpers to pack HDMI infoframes into binary buffers.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
1   2.6.24              [  OK  ]
2   2.6.25              [  OK  ]
3   2.6.26              [  OK  ]
4   2.6.27              [  OK  ]
5   2.6.28              [  OK  ]
6   2.6.29              [  OK  ]
7   2.6.30              [  OK  ]
8   2.6.31              [  OK  ]
9   2.6.32              [  OK  ]
10  2.6.33              [  OK  ]
11  2.6.34              [  OK  ]
12  2.6.35              [  OK  ]
13  2.6.36              [  OK  ]
14  2.6.37              [  OK  ]
15  2.6.38              [  OK  ]
16  2.6.39              [  OK  ]
17  3.0.65              [  OK  ]
18  3.1.10              [  OK  ]
19  3.2.38              [  OK  ]
20  3.3.8               [  OK  ]
21  3.4.32              [  OK  ]
22  3.5.7               [  OK  ]
23  3.6.11              [  OK  ]
24  3.7.9               [  OK  ]
25  3.8.0               [  OK  ]
26  3.9-rc1             [  OK  ]

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocompat: backport dma-buf
Luis R. Rodriguez [Fri, 5 Apr 2013 16:38:15 +0000 (09:38 -0700)]
compat: backport dma-buf

dma-buf was added via commit d15bd7ee on v3.3 but completed
in a more sound fassion in later kernels, you should preferably
be at v3.5 a least, so we take the latest dma-buf implementation
and port it for usage on kernels [3.0-3.4].

This is implemented as a non modular solution upstream but
we can carry the implementation into our compat module.

Note that although commit f23513e8d was added on v2.6.23
that allowed the kernel to call get_unused_fd_flags(flags)
for O_CLOEXEC setting, this routine was not exported until
v3.7. dma-buf makes use of it, and since our backported
dma-buf implementation is modular it means we have to work
around the lack of get_unused_fd_flags() exported symbol
on older kernels. Due to the security concerns noted by
Ulrich on f23513e8 we need to ensure the operatin is
atomic so we fix this on our port of dma-buf for older
kernels by adding our own dma_buf_fd_set_flag() to be called
when dma_buf_fd() is used. This implementation is available
for usage on kernels >= 3.0. We disable it for v3.5 as
we're happy with that implementation.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains \
d15bd7ee445d0702ad801fdaece348fdb79e6581
v3.3-rc1~161^2~2

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains \
f23513e8d96cf5e6cf8d2ff0cb5dd6bbc33995e4
v2.6.23-rc1~894

mcgrof@frijol ~/linux-stable (git::linux-3.2.y)$ git describe --contains \
1a7bd226
v3.7-rc1~134^2~69

commit d15bd7ee445d0702ad801fdaece348fdb79e6581
Author: Sumit Semwal <sumit.semwal@ti.com>
Date:   Mon Dec 26 14:53:15 2011 +0530

    dma-buf: Introduce dma buffer sharing mechanism

    This is the first step in defining a dma buffer sharing mechanism.

    A new buffer object dma_buf is added, with operations and API to allow easy
    sharing of this buffer object across devices.

    The framework allows:
    - creation of a buffer object, its association with a file pointer, and
       associated allocator-defined operations on that buffer. This operation is
       called the 'export' operation.
    - different devices to 'attach' themselves to this exported buffer object, to
      facilitate backing storage negotiation, using dma_buf_attach() API.
    - the exported buffer object to be shared with the other entity by asking for
       its 'file-descriptor (fd)', and sharing the fd across.
    - a received fd to get the buffer object back, where it can be accessed using
       the associated exporter-defined operations.
    - the exporter and user to share the scatterlist associated with this buffer
       object using map_dma_buf and unmap_dma_buf operations.

    Atleast one 'attach()' call is required to be made prior to calling the
    map_dma_buf() operation.

    Couple of building blocks in map_dma_buf() are added to ease introduction
    of sync'ing across exporter and users, and late allocation by the exporter.

    For this first version, this framework will work with certain conditions:
    - *ONLY* exporter will be allowed to mmap to userspace (outside of this
       framework - mmap is not a buffer object operation),
    - currently, *ONLY* users that do not need CPU access to the buffer are
       allowed.

    More details are there in the documentation patch.

    This is based on design suggestions from many people at the mini-summits[1],
    most notably from Arnd Bergmann <arnd@arndb.de>, Rob Clark <rob@ti.com> and
    Daniel Vetter <daniel@ffwll.ch>.

    The implementation is inspired from proof-of-concept patch-set from
    Tomasz Stanislawski <t.stanislaws@samsung.com>, who demonstrated buffer sharing
    between two v4l2 devices. [2]

    [1]: https://wiki.linaro.org/OfficeofCTO/MemoryManagement
    [2]: http://lwn.net/Articles/454389

Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-and-Tested-by: Rob Clark <rob.clark@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: add ability to create automatic backports
Johannes Berg [Fri, 5 Apr 2013 18:59:02 +0000 (20:59 +0200)]
gentree: add ability to create automatic backports

Instead of manually copying code like HDMI and dma-buf,
add the ability to just specify such backports in the
Kconfig file for compat. This will then always update
to the lastest code as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: fix rename bug in --git-revision option
Johannes Berg [Fri, 5 Apr 2013 18:39:53 +0000 (20:39 +0200)]
gentree: fix rename bug in --git-revision option

The --git-revision option didn't handle file/dir renames
correctly, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agokconfig lib: make tree walking a generator
Johannes Berg [Fri, 5 Apr 2013 18:02:55 +0000 (20:02 +0200)]
kconfig lib: make tree walking a generator

Instead of building the list in memory first, just
use a generator.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agorediff patches against next-20130404
Johannes Berg [Fri, 5 Apr 2013 16:14:56 +0000 (18:14 +0200)]
rediff patches against next-20130404

With the previous two patches, next-20130404 passes ckmake --allyesconfig.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackport a define for SOCK_SELECT_ERR_QUEUE
Johannes Berg [Fri, 5 Apr 2013 15:44:11 +0000 (17:44 +0200)]
backport a define for SOCK_SELECT_ERR_QUEUE

This is a bit tricky, but it works because adding 14 to
SOCK_QUEUE_SHRUNK will always reach a bit that can't be
set on older kernels anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobackport PDE_DATA for Bluetooth in linux-next
Johannes Berg [Fri, 5 Apr 2013 15:23:05 +0000 (17:23 +0200)]
backport PDE_DATA for Bluetooth in linux-next

This backports "procfs: new helper - PDE_DATA(inode)".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: fix file copying bug
Johannes Berg [Fri, 5 Apr 2013 16:04:47 +0000 (18:04 +0200)]
gentree: fix file copying bug

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogit tracker: handle temporary failures better
Johannes Berg [Fri, 5 Apr 2013 12:26:52 +0000 (14:26 +0200)]
git tracker: handle temporary failures better

If there are multiple commits in the source kernel, one
of which causes backporting failures (ie. patches don't
apply), and a subsequent one fixes it, the output is
very confusing because it skips the failing commit.

Change the script to generate a combination commit in
this case that contains the shortlog of all the commits
inbetween that were broken.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogit tracker: rename 'prefail' to 'last-success'
Johannes Berg [Fri, 5 Apr 2013 12:26:07 +0000 (14:26 +0200)]
git tracker: rename 'prefail' to 'last-success'

That's more obvious ...

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogit tracker: override committer/author in commits
Johannes Berg [Fri, 5 Apr 2013 12:11:28 +0000 (14:11 +0200)]
git tracker: override committer/author in commits

For commits generated by the git tracker, the committer
should always be set to the script, and for those that
are "meta commits" (like failures or backport updates)
the author should also be set to it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agodoc: clarify why symbol renaming is needed
Johannes Berg [Fri, 5 Apr 2013 10:14:29 +0000 (12:14 +0200)]
doc: clarify why symbol renaming is needed

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomore symbol fixup needed for latest RHEL6.3 kernels
Andy Gospodarek [Fri, 5 Apr 2013 02:04:47 +0000 (22:04 -0400)]
more symbol fixup needed for latest RHEL6.3 kernels

These changes will allow compat.ko to load properly on the latest released
RHEL6.3 errata kernels.

Reported here: https://bugzilla.kernel.org/show_bug.cgi?id=55971

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agofixup error when LINUX_BACKPORT macro was added
Andy Gospodarek [Fri, 5 Apr 2013 02:04:46 +0000 (22:04 -0400)]
fixup error when LINUX_BACKPORT macro was added

Commit a05e783cb8853210628bd1f2bd82d17dd004c9d1 did not properly
backport the symbols for:

schedule_delayed_work
schedule_delayed_work_on

as it left the 'compat' string there when adding the LINUX_BACKPORT
symbol.  This resulted in these two not getting redefined and kernels
with these backported resulted in duplicate symbols when trying to load
compat.ko.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobuild system: handle int Kconfig options in autoconf header
Johannes Berg [Fri, 5 Apr 2013 08:21:21 +0000 (10:21 +0200)]
build system: handle int Kconfig options in autoconf header

Add a line of shell script code to handle int Kconfig
options when creating the autoconf header.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agorefresh patches against next-20130328
Johannes Berg [Thu, 4 Apr 2013 22:29:26 +0000 (00:29 +0200)]
refresh patches against next-20130328

The patches were last refreshed against that same tree,
so the only change is that now we have -p in there, which
results in changes like this (only):

-@@ -1593,7 +1593,7 @@
+@@ -1593,7 +1593,7 @@ static int nl80211_dump_wiphy(struct sk_

This makes the patches more readable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: add -p option to diff when refreshing patches
Johannes Berg [Thu, 4 Apr 2013 22:28:42 +0000 (00:28 +0200)]
gentree: add -p option to diff when refreshing patches

This generally makes patches more readable to humans
and has no impact on the tools.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogentree: fix describe version bug
Johannes Berg [Thu, 4 Apr 2013 22:11:32 +0000 (00:11 +0200)]
gentree: fix describe version bug

With the --git-revision option, that revision needs
to be used for the output version, not 'HEAD'.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoadd some kconfig/make system documentation
Johannes Berg [Thu, 4 Apr 2013 21:36:43 +0000 (23:36 +0200)]
add some kconfig/make system documentation

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogit tracker: don't chdir, remove verbose argument
Johannes Berg [Thu, 4 Apr 2013 19:56:05 +0000 (21:56 +0200)]
git tracker: don't chdir, remove verbose argument

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agogitignore: add more build artifacts
Johannes Berg [Thu, 4 Apr 2013 18:10:28 +0000 (20:10 +0200)]
gitignore: add more build artifacts

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogit tracker: allow creating defconfig symlink
Johannes Berg [Thu, 4 Apr 2013 16:25:02 +0000 (18:25 +0200)]
git tracker: allow creating defconfig symlink

This makes it possible to do just 'make' in the output
tree, rather than having to configure first.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agokconfig: add --as-needed
Johannes Berg [Thu, 4 Apr 2013 16:08:57 +0000 (18:08 +0200)]
kconfig: add --as-needed

18:07 < *thierryE> It's seems that for my ld version, parameters order matters
18:07 < *thierryE> Yep
18:07 < *thierryE> mconf: LDFLAGS = -Wl,--no-as-needed -lncurses
18:08 < johill> so just add the -Wl,--no-as-needed ?
18:08 < *thierryE> Yes
18:08 < *thierryE> --as-needed is enabled by default for some config

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd more stuff to output .gitignore
Johannes Berg [Thu, 4 Apr 2013 16:07:56 +0000 (18:07 +0200)]
add more stuff to output .gitignore

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd kconfig binaries to output .gitignore
Johannes Berg [Thu, 4 Apr 2013 16:03:54 +0000 (18:03 +0200)]
add kconfig binaries to output .gitignore

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogit tracker: override versions file
Johannes Berg [Thu, 4 Apr 2013 16:01:51 +0000 (18:01 +0200)]
git tracker: override versions file

Otherwise it keeps changing.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogentree: fix bug in version file writing
Johannes Berg [Thu, 4 Apr 2013 16:00:05 +0000 (18:00 +0200)]
gentree: fix bug in version file writing

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogit lib: suppress messages from shortlog
Johannes Berg [Thu, 4 Apr 2013 15:55:35 +0000 (17:55 +0200)]
git lib: suppress messages from shortlog

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogit-tracker: fix small bug
Johannes Berg [Thu, 4 Apr 2013 15:53:11 +0000 (17:53 +0200)]
git-tracker: fix small bug

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd .gitignore to output directory
Johannes Berg [Thu, 4 Apr 2013 15:00:12 +0000 (17:00 +0200)]
add .gitignore to output directory

When using the git-tracker, this is very useful.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agodevel: add git tracker helper script
Johannes Berg [Thu, 4 Apr 2013 14:50:00 +0000 (16:50 +0200)]
devel: add git tracker helper script

This allows creating a git tree based on the backport
output automatically, to track an upstream kernel tree.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogentree: remove pointless code
Johannes Berg [Thu, 4 Apr 2013 00:11:09 +0000 (02:11 +0200)]
gentree: remove pointless code

There's no need to join a path with nothing ...

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogentree: make lib directory a python module
Johannes Berg [Wed, 3 Apr 2013 23:52:41 +0000 (01:52 +0200)]
gentree: make lib directory a python module

That will make it easier to use gentree and/or git
helpers from other scripts.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agobuild: add defconfig files
Johannes Berg [Wed, 3 Apr 2013 23:28:47 +0000 (01:28 +0200)]
build: add defconfig files

This enables users to more easily select the driver that
they need, and us to ship default configurations that we
prefer for that driver. Add iwlwifi as the first example.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agobuild: add simple 'install' target
Johannes Berg [Wed, 3 Apr 2013 22:50:47 +0000 (00:50 +0200)]
build: add simple 'install' target

This really just installs the modules, everything else
is still missing.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agobuild: fix defconfig usage
Johannes Berg [Wed, 3 Apr 2013 22:24:56 +0000 (00:24 +0200)]
build: fix defconfig usage

The make target vs. filename got confusing and the
invocation of the conf program was wrong as well;
fix both issues.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agobuild: read KLIB variable
Johannes Berg [Wed, 3 Apr 2013 22:01:49 +0000 (00:01 +0200)]
build: read KLIB variable

Some scripts may rely on setting KLIB rather than
KLIB_BUILD, particularly for an install target,
so read that variable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogentree: make output configurable
Johannes Berg [Wed, 3 Apr 2013 15:28:43 +0000 (17:28 +0200)]
gentree: make output configurable

It might not always have to go to stdout, so make
a function to print it and use that.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogentree: fix return code
Johannes Berg [Wed, 3 Apr 2013 15:25:15 +0000 (17:25 +0200)]
gentree: fix return code

The recent shuffling broke the return value, return it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoRevert "fix compat dependencies"
Johannes Berg [Wed, 3 Apr 2013 12:07:36 +0000 (14:07 +0200)]
Revert "fix compat dependencies"

This reverts commit 4f321aefd84259e8f44ff9d080ffdf7ac41290c4.

That didn't work if the symbol isn't defined at all ...

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agofix compat dependencies
Johannes Berg [Wed, 3 Apr 2013 12:04:58 +0000 (14:04 +0200)]
fix compat dependencies

Apparently "depends on !FOO" will be OK if FOO=m,
which isn't what we want, so make it FOO = n.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agocorrect crc8 include file
Johannes Berg [Wed, 3 Apr 2013 11:47:12 +0000 (13:47 +0200)]
correct crc8 include file

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoexplain Kconfig recipe better, adjust existing code
Johannes Berg [Wed, 3 Apr 2013 11:44:16 +0000 (13:44 +0200)]
explain Kconfig recipe better, adjust existing code

The Kconfig recipes for backporting need a bit more
explanation, add that. Also adjust the existing ones.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agocorrect makefile/kconfig mangling
Johannes Berg [Wed, 3 Apr 2013 09:46:00 +0000 (11:46 +0200)]
correct makefile/kconfig mangling

Due to reordering the steps, the makefile and kconfig
mangling needs to be changed a bit, make it more robust.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agogentree: change to make external use possible
Johannes Berg [Wed, 3 Apr 2013 09:32:23 +0000 (11:32 +0200)]
gentree: change to make external use possible

Change the scripting a bit to make it possible to
import the gentree script as a module to call it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agockmake: parallelise even allyesconfig/allnoconfig
Johannes Berg [Tue, 2 Apr 2013 23:12:28 +0000 (01:12 +0200)]
ckmake: parallelise even allyesconfig/allnoconfig

There are two C files to build in there :-)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agohard-code list of backport files
Johannes Berg [Tue, 2 Apr 2013 23:09:16 +0000 (01:09 +0200)]
hard-code list of backport files

This avoids accidentally copying files that are in the
local, possibly dirty, working directory.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agofix EWMA backport
Johannes Berg [Tue, 2 Apr 2013 22:46:12 +0000 (00:46 +0200)]
fix EWMA backport

If backporting to a kernel that already has it, the
symbol mangling shouldn't be done ...

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd more .PHONY
Johannes Berg [Tue, 2 Apr 2013 21:57:15 +0000 (23:57 +0200)]
add more .PHONY

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agosome makefile cleanups
Johannes Berg [Tue, 2 Apr 2013 21:54:53 +0000 (23:54 +0200)]
some makefile cleanups

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoallow defconfig to work
Johannes Berg [Tue, 2 Apr 2013 21:50:10 +0000 (23:50 +0200)]
allow defconfig to work

This allows shipping a 'defconfig' file in the output and
then just "make" works, taking the config from there and
setting everything else to the default.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agockmake: default to just building compat
Johannes Berg [Tue, 2 Apr 2013 21:30:14 +0000 (23:30 +0200)]
ckmake: default to just building compat

but add --allyesconfig option

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agobuild fw loader only for kernel 2.6.32 and lower
Johannes Berg [Tue, 2 Apr 2013 21:17:57 +0000 (23:17 +0200)]
build fw loader only for kernel 2.6.32 and lower

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agofix the previous commit ...
Johannes Berg [Tue, 2 Apr 2013 21:11:01 +0000 (23:11 +0200)]
fix the previous commit ...

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd compat testing option
Johannes Berg [Tue, 2 Apr 2013 21:01:08 +0000 (23:01 +0200)]
add compat testing option

Add the BACKPORT_USERSEL_BUILD_ALL option that selects
all the backported stuff drivers would otherwise have.
This allows testing all the backported code without
compiling all drivers.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd comments, small fixes
Johannes Berg [Tue, 2 Apr 2013 20:56:58 +0000 (22:56 +0200)]
add comments, small fixes

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agocompat: backport poll_requested_events() and poll_does_not_wait()
Luis R. Rodriguez [Sun, 31 Mar 2013 00:26:04 +0000 (17:26 -0700)]
compat: backport poll_requested_events() and poll_does_not_wait()

The main thing for the backport was the poll_table key and qproc
fields renames. We only enable this for kernels > 2.6.31 given that
these old fields only exist as of that kernel and this is currently
only used by video drivers which are only supported as of v3.2.

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 626cf236
v3.4-rc1~109^2~52

commit 626cf236608505d376e4799adb4f7eb00a8594af
Author: Hans Verkuil <hans.verkuil@cisco.com>
Date:   Fri Mar 23 15:02:27 2012 -0700

    poll: add poll_requested_events() and poll_does_not_wait() functions

    In some cases the poll() implementation in a driver has to do different
    things depending on the events the caller wants to poll for.  An example
    is when a driver needs to start a DMA engine if the caller polls for
    POLLIN, but doesn't want to do that if POLLIN is not requested but instead
    only POLLOUT or POLLPRI is requested.  This is something that can happen
    in the video4linux subsystem among others.

    Unfortunately, the current epoll/poll/select implementation doesn't
    provide that information reliably.  The poll_table_struct does have it: it
    has a key field with the event mask.  But once a poll() call matches one
    or more bits of that mask any following poll() calls are passed a NULL
    poll_table pointer.

    Also, the eventpoll implementation always left the key field at ~0 instead
    of using the requested events mask.

    This was changed in eventpoll.c so the key field now contains the actual
    events that should be polled for as set by the caller.

    The solution to the NULL poll_table pointer is to set the qproc field to
    NULL in poll_table once poll() matches the events, not the poll_table
    pointer itself.  That way drivers can obtain the mask through a new
    poll_requested_events inline.

    The poll_table_struct can still be NULL since some kernel code calls it
    internally (netfs_state_poll() in ./drivers/staging/pohmelfs/netfs.h).  In
    that case poll_requested_events() returns ~0 (i.e.  all events).

    Very rarely drivers might want to know whether poll_wait will actually
    wait.  If another earlier file descriptor in the set already matched the
    events the caller wanted to wait for, then the kernel will return from the
    select() call without waiting.  This might be useful information in order
    to avoid doing expensive work.

    A new helper function poll_does_not_wait() is added that drivers can use
    to detect this situation.  This is now used in sock_poll_wait() in
    include/net/sock.h.  This was the only place in the kernel that needed
    this information.

    Drivers should no longer access any of the poll_table internals, but use
    the poll_requested_events() and poll_does_not_wait() access functions
    instead.  In order to enforce that the poll_table fields are now prepended
    with an underscore and a comment was added warning against using them
    directly.

    This required a change in unix_dgram_poll() in unix/af_unix.c which used
    the key field to get the requested events.  It's been replaced by a call
    to poll_requested_events().

    For qproc it was especially important to change its name since the
    behavior of that field changes with this patch since this function pointer
    can now be NULL when that wasn't possible in the past.

    Any driver accessing the qproc or key fields directly will now fail to compile.

    Some notes regarding the correctness of this patch: the driver's poll()
    function is called with a 'struct poll_table_struct *wait' argument.  This
    pointer may or may not be NULL, drivers can never rely on it being one or
    the other as that depends on whether or not an earlier file descriptor in
    the select()'s fdset matched the requested events.

    There are only three things a driver can do with the wait argument:

    1) obtain the key field:

        events = wait ? wait->key : ~0;

       This will still work although it should be replaced with the new
       poll_requested_events() function (which does exactly the same).
       This will now even work better, since wait is no longer set to NULL
       unnecessarily.

    2) use the qproc callback. This could be deadly since qproc can now be
       NULL. Renaming qproc should prevent this from happening. There are no
       kernel drivers that actually access this callback directly, BTW.

    3) test whether wait == NULL to determine whether poll would return without
       waiting. This is no longer sufficient as the correct test is now
       wait == NULL || wait->_qproc == NULL.

       However, the worst that can happen here is a slight performance hit in
       the case where wait != NULL and wait->_qproc == NULL. In that case the
       driver will assume that poll_wait() will actually add the fd to the set
       of waiting file descriptors. Of course, poll_wait() will not do that
       since it tests for wait->_qproc. This will not break anything, though.

       There is only one place in the whole kernel where this happens
       (sock_poll_wait() in include/net/sock.h) and that code will be replaced
       by a call to poll_does_not_wait() in the next patch.

       Note that even if wait->_qproc != NULL drivers cannot rely on poll_wait()
       actually waiting. The next file descriptor from the set might match the
       event mask and thus any possible waits will never happen.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Jonathan Corbet <corbet@lwn.net>
Reviewed-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agocompat: backport memweight()
Luis R. Rodriguez [Fri, 29 Mar 2013 23:13:17 +0000 (16:13 -0700)]
compat: backport memweight()

mcgrof@frijol ~/linux-next (git::master)$ git describe --contains 639b9e34
v3.6-rc1~41^2~73

commit 639b9e34f15e4b2c30068a4e4485586af0cdf709
Author: Akinobu Mita <akinobu.mita@gmail.com>
Date:   Mon Jul 30 14:40:55 2012 -0700

    string: introduce memweight()

    memweight() is the function that counts the total number of bits set in
    memory area.  Unlike bitmap_weight(), memweight() takes pointer and size
    in bytes to specify a memory area which does not need to be aligned to
    long-word boundary.

    [akpm@linux-foundation.org: rename `w' to `ret']
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Anders Larsen <al@alarsen.net>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Tony Luck <tony.luck@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
11 years agobackport ETH_P_802_3_MIN
Johannes Berg [Tue, 2 Apr 2013 20:16:16 +0000 (22:16 +0200)]
backport ETH_P_802_3_MIN

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd the ability to include ALX
Johannes Berg [Tue, 2 Apr 2013 20:13:40 +0000 (22:13 +0200)]
add the ability to include ALX

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agodo post-processing after applying patches
Johannes Berg [Tue, 2 Apr 2013 20:11:37 +0000 (22:11 +0200)]
do post-processing after applying patches

Otherwise some patches might not apply, and anything
added in patches to the Kconfig won't work correctly.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd ethernet back
Johannes Berg [Tue, 2 Apr 2013 19:31:33 +0000 (21:31 +0200)]
add ethernet back

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoadd ability to read source files from git
Johannes Berg [Tue, 2 Apr 2013 19:08:35 +0000 (21:08 +0200)]
add ability to read source files from git

Instead of having to have a checked-out kernel tree the
script can now read the files from a git revision when
passed the --git-revision <rev> argument. In this case
the kerneldir is taken as the git tree to use.

This helps when generating for multiple different trees.

Note that due to the need to invoke git many times this
is considerably slower than copying from a checkout. If
taking into account the time to create the checkout it's
still faster though.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
11 years agoremove copy sanity check
Johannes Berg [Tue, 2 Apr 2013 18:48:25 +0000 (20:48 +0200)]
remove copy sanity check

If you get this wrong, it will error out while copying anyway.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>