Add support for vodabox3 board in a vanilla kernel
Lattice ECP3 FPGA: Correct endianness

This code corrects endianness and avoids a sparse error.
Tested with Lattice ECP3-35 with Freescale i.MX6.
It also sends uevent in order to load it.

Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add support for VBX3 FPGA

Add i2c probing for the moment...
Add deferred probe support

This patch declares the register names and also adds support for deferred
probing. As this driver depends on the loaded firmware on the FPGA, it must
be able to read the FPGA firmware version in order to be considered probed.
Register subdev and initialize media_entity
Change the way pads are declared
Add support for LMH0395

This device is a SPI based device from TI.
It is a 3 Gbps HD/SD SDI Dual Output Low Power
Extended Reach Adaptive Cable Equalizer.

Add routing support in order to select output
LMH0395 enables the use of up to two outputs.
LMH0395: Check if a signal is detected

When probing the driver, add some debug informations like signal detection
cable rate (3G/HD or SD) and cable length estimation.
This estimation is based on TI datasheet, for Belden 1694A cables.
Add support for vodabox3 board in a vanilla kernel
Add support for VBX3 FPGA

Add i2c probing for the moment...
Add deferred probe support

This patch declares the register names and also adds support for deferred
probing. As this driver depends on the loaded firmware on the FPGA, it must
be able to read the FPGA firmware version in order to be considered probed.
Register subdev and initialize media_entity
Change the way pads are declared
Add support for LMH0395

This device is a SPI based device from TI.
It is a 3 Gbps HD/SD SDI Dual Output Low Power
Extended Reach Adaptive Cable Equalizer.

Add routing support in order to select output
LMH0395 enables the use of up to two outputs.
LMH0395: Check if a signal is detected

When probing the driver, add some debug informations like signal detection
cable rate (3G/HD or SD) and cable length estimation.
This estimation is based on TI datasheet, for Belden 1694A cables.
Merge branch 'LMH0395' of github.com:Vodalys/linux-2.6-imx into LMH0395
Lattice ECP3 FPGA: Check firmware pointer

This patch corrects a lack of testing.
If fw is NULL when calling firmware_load(), it results in a kernel oops.
regulatory: add NUL to alpha2

alpha2 is defined as 2-chars array, but is used in multiple
places as string (e.g. with nla_put_string calls), which
might leak kernel data.

Solve it by simply adding an extra char for the NULL
terminator, making such operations safe.

Cc: stable@vger.kernel.org
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
percpu: fix pcpu_alloc_pages() failure path

When pcpu_alloc_pages() fails midway, pcpu_free_pages() is invoked to
free what has already been allocated.  The invocation is across the
whole requested range and pcpu_free_pages() will try to free all
non-NULL pages; unfortunately, this is incorrect as
pcpu_get_pages_and_bitmap(), unlike what its comment suggests, doesn't
clear the pages array and thus the array may have entries from the
previous invocations making the partial failure path free incorrect
pages.

Fix it by open-coding the partial freeing of the already allocated
pages.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
percpu: perform tlb flush after pcpu_map_pages() failure

If pcpu_map_pages() fails midway, it unmaps the already mapped pages.
Currently, it doesn't flush tlb after the partial unmapping.  This may
be okay in most cases as the established mapping hasn't been used at
that point but it can go wrong and when it goes wrong it'd be
extremely difficult to track down.

Flush tlb after the partial unmapping.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org