platform/kernel/linux-3.10.git
9 years agoARM: dts: Add dts file for exynos4412-redwood board
Tomasz Figa [Tue, 5 Feb 2013 14:59:06 +0000 (15:59 +0100)]
ARM: dts: Add dts file for exynos4412-redwood board

This patch adds a basic dts file for Redwood board based on Exynos 4412
SoC.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4210-trats: Update display nodes for CDF
Tomasz Figa [Wed, 6 Feb 2013 16:16:35 +0000 (17:16 +0100)]
ARM: dts: exynos4210-trats: Update display nodes for CDF

This patch updates DSI controller and LCD panel nodes in device tree
source of exynos4210-trats board for new exynos-dsi and s6e8ax0 drivers
using Common Display Framework.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4412-slp_pq: Update display nodes for CDF
Tomasz Figa [Mon, 28 Jan 2013 14:37:43 +0000 (15:37 +0100)]
ARM: dts: exynos4412-slp_pq: Update display nodes for CDF

This patch updates display device nodes in exynos4412-slp_pq.dts to be
compatible with new drivers using Common Display Framework.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4: Add node for exynos-dsi to exynos4.dtsi
Tomasz Figa [Fri, 31 Aug 2012 10:26:33 +0000 (12:26 +0200)]
ARM: dts: exynos4: Add node for exynos-dsi to exynos4.dtsi

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
ARM: dts: exynos4: Update DSI node for new driver

This patch updates DSI controller node in exynos4.dtsi for new
exynos-dsi driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agovideo: display: Add panel-s6e8aa0 driver
Tomasz Figa [Wed, 6 Feb 2013 16:11:57 +0000 (17:11 +0100)]
video: display: Add panel-s6e8aa0 driver

This patch adds a CDF-compliant panel driver for S6E8AA0 DSI
LCD panel.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agovideo: display: Add panel-s6d6aa1 driver
Tomasz Figa [Tue, 5 Feb 2013 14:57:50 +0000 (15:57 +0100)]
video: display: Add panel-s6d6aa1 driver

This patch adds a CDF-compliant panel driver for S6D6AA1 DSI LCD panel.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agovideo: display: Add exynos-dsi video source driver
Tomasz Figa [Mon, 28 Jan 2013 14:24:28 +0000 (15:24 +0100)]
video: display: Add exynos-dsi video source driver

This patch adds new driver for DSI master block available in Samsung
Exynos SoCs. The driver is designed and written specifically for Common
Display Framework.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: EXYNOS: Make MACH_EXYNOS4_DT select S5P_SETUP_MIPIPHY
Tomasz Figa [Mon, 3 Sep 2012 13:51:26 +0000 (15:51 +0200)]
ARM: EXYNOS: Make MACH_EXYNOS4_DT select S5P_SETUP_MIPIPHY

S5P_SETUP_MIPIPHY is needed for device tree support of MIPI DSI on
Exynos4.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: Exynos4: fix DSIM support
Marek Szyprowski [Mon, 11 Jun 2012 11:27:17 +0000 (13:27 +0200)]
ARM: Exynos4: fix DSIM support

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agovideo: add display-core
Tomasz Figa [Wed, 30 Jan 2013 10:07:46 +0000 (11:07 +0100)]
video: add display-core

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: Exynos: enable CMA and MFC for SLP_PQ board
Marek Szyprowski [Tue, 20 Aug 2013 12:59:04 +0000 (14:59 +0200)]
ARM: Exynos: enable CMA and MFC for SLP_PQ board

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agomedia: s5p-mfc: add support for runtime pm for memport client devices
Marek Szyprowski [Wed, 7 Aug 2013 09:01:53 +0000 (11:01 +0200)]
media: s5p-mfc: add support for runtime pm for memport client devices

Client device for handling memory/dma operations for right and left memory
port (memory bank) require runtime pm handling for correct operation. Add
required calls to power_on/power_off functions.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agomedia: s5p-mfc: remove DT hacks and simplify initialization code
Marek Szyprowski [Tue, 12 Feb 2013 13:03:29 +0000 (14:03 +0100)]
media: s5p-mfc: remove DT hacks and simplify initialization code

This patch removes custom initialization of reserved memory regions from
s5p-mfc driver. Memory initialization can be now handled by generic
code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoARM: Exynos: replace custom MFC reserved memory handling with generic code
Marek Szyprowski [Tue, 30 Jul 2013 13:23:55 +0000 (15:23 +0200)]
ARM: Exynos: replace custom MFC reserved memory handling with generic code

MFC driver use custom bindings for managing reserved memory. Those bindings
are not really specific to MFC device and no even well discussed. They can
be easily replaced with generic, platform independent code for handling
reserved and contiguous memory.

Two additional child devices for each memory port (AXI master) are
introduced to let one assign some properties to each of them. Later one
can also use them to assign properties related to SYSMMU controllers,
which can be used to manage the limited dma window provided by those
memory ports.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoARM: init: add support for reserved memory defined by device tree
Marek Szyprowski [Fri, 9 Aug 2013 11:01:08 +0000 (13:01 +0200)]
ARM: init: add support for reserved memory defined by device tree

Enable reserved memory initialization from device tree.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Tomasz Figa <t.figa@samsung.com>
9 years agodrivers: of: add initialization code for dma reserved memory
Marek Szyprowski [Mon, 29 Jul 2013 12:09:55 +0000 (14:09 +0200)]
drivers: of: add initialization code for dma reserved memory

This patch adds device tree support for contiguous and reserved memory
regions defined in device tree.

Large memory blocks can be reliably reserved only during early boot.
This must happen before the whole memory management subsystem is
initialized, because we need to ensure that the given contiguous blocks
are not yet allocated by kernel. Also it must happen before kernel
mappings for the whole low memory are created, to ensure that there will
be no mappings (for reserved blocks) or mapping with special properties
can be created (for CMA blocks). This all happens before device tree
structures are unflattened, so we need to get reserved memory layout
directly from fdt.

Later, those reserved memory regions are assigned to devices on each
device structure initialization.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Tomasz Figa <t.figa@samsung.com>
9 years agodrivers: of: add function to scan fdt nodes given by path
Marek Szyprowski [Thu, 27 Jun 2013 08:32:15 +0000 (10:32 +0200)]
drivers: of: add function to scan fdt nodes given by path

Add a function to scan the flattened device-tree starting from the
node given by the path. It is used to extract information (like reserved
memory), which is required on early boot before we can unflatten the tree.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Tomasz Figa <t.figa@samsung.com>
9 years agodrivers: dma-contiguous: clean source code and prepare for device tree
Marek Szyprowski [Mon, 29 Jul 2013 12:31:45 +0000 (14:31 +0200)]
drivers: dma-contiguous: clean source code and prepare for device tree

This patch cleans the initialization of dma contiguous framework. The
all-in-one dma_declare_contiguous() function is now separated into
dma_contiguous_reserve_area() which only steals the the memory from
memblock allocator and dma_contiguous_add_device() function, which
assigns given device to the specified reserved memory area. This improves
the flexibility in defining contiguous memory areas and assigning device
to them, because now it is possible to assign more than one device to
the given contiguous memory area. Such split in initialization procedure
is also required for upcoming device tree support.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Tomasz Figa <t.figa@samsung.com>
9 years agoregulator: max77693: Remove no longer supported __dev* attributes
Sylwester Nawrocki [Fri, 8 Feb 2013 18:26:33 +0000 (19:26 +0100)]
regulator: max77693: Remove no longer supported __dev* attributes

This patch fixes following build error:

drivers/regulator/max77693.c:673: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
drivers/regulator/max77693.c:743: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘max77693_pmic_remove’
drivers/regulator/max77693.c:768: error: ‘max77693_pmic_probe’ undeclared here (not in a function)
drivers/regulator/max77693.c:769: error: implicit declaration of function ‘__devexit_p’
drivers/regulator/max77693.c:769: error: ‘max77693_pmic_remove’ undeclared here (not in a function)

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoregulator: Remove const from declation of reg_desc in regulator_dev.
Jonghwa Lee [Thu, 7 Feb 2013 06:05:27 +0000 (15:05 +0900)]
regulator: Remove const from declation of reg_desc in regulator_dev.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agoregulator: max77693: Add regulator driver for max77693
Jonghwa Lee [Thu, 7 Feb 2013 06:04:33 +0000 (15:04 +0900)]
regulator: max77693: Add regulator driver for max77693

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
9 years agov4l2: videobuf2-dc: fix support for mappings without struct page in userptr mode
Marek Szyprowski [Fri, 7 Jun 2013 12:09:29 +0000 (14:09 +0200)]
v4l2: videobuf2-dc: fix support for mappings without struct page in userptr mode

Earlier version of dma-contig allocator in user ptr mode assumed that in
all cases DMA address equals physical address. This was just a special case.
Commit e15dab752d4c588544ccabdbe020a7cc092e23c8 introduced correct support
for converting userpage to dma address, but unfortunately it broke the
support for simple dma address = physical address for the case, when given
physical frame has no struct page associated with it (this happens if one
use for example dma_declare_coherent api or other reserved memory approach).
This commit restores support for such cases.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoARM: dts: Add camera clocks definitions to exynos4/x12.dtsi
Sylwester Nawrocki [Fri, 18 Jan 2013 18:14:50 +0000 (19:14 +0100)]
ARM: dts: Add camera clocks definitions to exynos4/x12.dtsi

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add MFC node for Exynos4 SoC series
Sylwester Nawrocki [Tue, 29 Jan 2013 13:44:19 +0000 (14:44 +0100)]
ARM: dts: Add MFC node for Exynos4 SoC series

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add pinctrl property to fimc-is node for PQ board
Sylwester Nawrocki [Wed, 23 Jan 2013 16:25:56 +0000 (17:25 +0100)]
ARM: dts: Add pinctrl property to fimc-is node for PQ board

9 years agoARM: dts: Add pinctrl entries for FIMC-IS peripherals
Sylwester Nawrocki [Mon, 7 Jan 2013 19:27:53 +0000 (20:27 +0100)]
ARM: dts: Add pinctrl entries for FIMC-IS peripherals

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: EXYNOS: change the value of EXYNOS4X12_ISP_LOWPWR
Younghwan Joo [Thu, 15 Nov 2012 12:02:27 +0000 (21:02 +0900)]
ARM: EXYNOS: change the value of EXYNOS4X12_ISP_LOWPWR

This patch is to fix the value of EXYNOS4X12_ISP_LOWPWR register
to zero at AFTR mode. It ensure the sub selection mux of mcuisp400
and isp200 reset a default position after power down

Signed-off-by: Younghwan Joo <yhwan.joo@samsung.com>
Signed-off-by: JaeYong Shin <jy2.shin@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: Add camera device nodes for PQ board
Sylwester Nawrocki [Wed, 6 Feb 2013 17:34:42 +0000 (18:34 +0100)]
ARM: dts: Add camera device nodes for PQ board

This patch adds all nodes for camera devices on an example Exynos4412 SoC
based board. This is all what's required in the board dts file to enable
rear facing camera (S5C73M3 sensor).

The aliases node contains entries required for the camera processing
data path entity drivers.

The sensor nodes use standard port/remote-endpoint nodes convention.
Internal SoC links between entities are not specified this way and
are coded in the driver instead.

The S5C73M3 sensor uses two control buses: I2C and SPI. There are
two, i2c_0 and spi_1 bus controller child nodes assigned to it.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agoARM: dts: Correct camera pinctrl nodes for Exynos4x12 SoCs
Sylwester Nawrocki [Wed, 24 Oct 2012 14:42:12 +0000 (16:42 +0200)]
ARM: dts: Correct camera pinctrl nodes for Exynos4x12 SoCs

Add separate nodes for the CAMCLK pin and turn off pull-up on camera
ports A, B. The video bus pins and the clock output (CAMCLK) pin need
separate nodes since full camera port is not used in some configurations,
e.g. for MIPI CSI-2 bus on CAMCLK is required and data/clock signal
use separate dedicated pins.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agoARM: dts: Add FIMC and MIPI CSIS device nodes for Exynos4x12
Sylwester Nawrocki [Mon, 7 Jan 2013 16:13:58 +0000 (17:13 +0100)]
ARM: dts: Add FIMC and MIPI CSIS device nodes for Exynos4x12

Add common camera node and fimc nodes specific to Exynos4212 and
Exynos4412 SoCs. fimc-is is a node for the Exynos4x12 FIMC-IS
subsystem and fimc-lite nodes are created as its child nodes,
among others due to FIMC-LITE device dependencies on FIMC-IS
related clocks.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agoARM: dts: Add ISP power domain node for Exynos4x12
Sylwester Nawrocki [Mon, 10 Dec 2012 14:23:38 +0000 (15:23 +0100)]
ARM: dts: Add ISP power domain node for Exynos4x12

The ISP power domain is a common power domain for fimc-lite
and fimc-is (ISP) devices.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agoARM: dts: Add camera to node exynos4.dtsi
Sylwester Nawrocki [Wed, 24 Oct 2012 15:00:57 +0000 (17:00 +0200)]
ARM: dts: Add camera to node exynos4.dtsi

This patch adds common FIMC device nodes for all Exynos4 SoCs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agos5c73m3: Disable boot_from_rom
Sylwester Nawrocki [Wed, 23 Jan 2013 11:37:03 +0000 (12:37 +0100)]
s5c73m3: Disable boot_from_rom

Boot from FROM memory is only for the mainline kernel.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoV4L: s5c73m3: Initial device tree support
Sylwester Nawrocki [Wed, 23 Jan 2013 11:32:05 +0000 (12:32 +0100)]
V4L: s5c73m3: Initial device tree support

Add OF match table for the I2C client and SPI device driver,
and GPIO handling for DT. This is minimum required to make
the driver work with DT.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
9 years agoARM: dts: exynos4: Add clock lookups to hsotg node
Tomasz Figa [Mon, 7 Jan 2013 17:23:04 +0000 (18:23 +0100)]
ARM: dts: exynos4: Add clock lookups to hsotg node

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4412-slp_pq: Add nodes for xxti and xusbxti clocks
Tomasz Figa [Mon, 7 Jan 2013 17:10:22 +0000 (18:10 +0100)]
ARM: dts: exynos4412-slp_pq: Add nodes for xxti and xusbxti clocks

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4210-trats: Add nodes for xxti and xusbxti clocks
Tomasz Figa [Mon, 7 Jan 2013 17:09:08 +0000 (18:09 +0100)]
ARM: dts: exynos4210-trats: Add nodes for xxti and xusbxti clocks

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agodrm/exynos: add dt match table for vidi module.
Inki Dae [Fri, 4 Jan 2013 07:27:03 +0000 (16:27 +0900)]
drm/exynos: add dt match table for vidi module.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoARM: DTS: SLP-PQ: add drm virtual display node.
Inki Dae [Fri, 4 Jan 2013 07:25:52 +0000 (16:25 +0900)]
ARM: DTS: SLP-PQ: add drm virtual display node.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoARM: dts: exynos4412-slp_pq: add fimd iommu support
Inki Dae [Thu, 3 Jan 2013 10:03:19 +0000 (19:03 +0900)]
ARM: dts: exynos4412-slp_pq: add fimd iommu support

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoARM: EXYNOS: select ARM_DMA_USE_IOMMU for MACH_EXYNOS4_DT
Inki Dae [Thu, 3 Jan 2013 10:01:41 +0000 (19:01 +0900)]
ARM: EXYNOS: select ARM_DMA_USE_IOMMU for MACH_EXYNOS4_DT

if EXYNOS_IOMMU is enabled then ARM_DMA_USE_IOMMU
will be enabled also.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: EXYNOS: add ARM_HAS_SG_CHAIN config
Inki Dae [Thu, 3 Jan 2013 05:00:30 +0000 (14:00 +0900)]
ARM: EXYNOS: add ARM_HAS_SG_CHAIN config

Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agodrm/exynos: fimd: clear channel before enabling iommu
Akshu Agrawal [Wed, 26 Dec 2012 11:27:41 +0000 (06:27 -0500)]
drm/exynos: fimd: clear channel before enabling iommu

If any fimd channel was already active, initializing iommu will result
in a PAGE FAULT (e.g. u-boot could have turned on the display and
not disabled it before the kernel starts). This patch checks if any
channel is active before initializing iommu and disables it.

Signed-off-by: Akshu Agrawal <akshu.a@samsung.com>
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
9 years agoARM: dts: exynos4210-trats: Fix vdd_arm regulator name
Tomasz Figa [Thu, 3 Jan 2013 16:53:55 +0000 (17:53 +0100)]
ARM: dts: exynos4210-trats: Fix vdd_arm regulator name

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4210-trats: Add display support on Trats
Tomasz Figa [Fri, 31 Aug 2012 10:32:35 +0000 (12:32 +0200)]
ARM: dts: exynos4210-trats: Add display support on Trats

This commit adds nodes and attributes necessary to enable support of
MIPI DSIM, LCD and FIMD on Trats board.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Conflicts:
arch/arm/boot/dts/exynos4210-trats.dts

9 years agoARM: dts: exynos4412-slp_pq: Enable USB PHY node
Tomasz Figa [Fri, 28 Dec 2012 15:44:57 +0000 (16:44 +0100)]
ARM: dts: exynos4412-slp_pq: Enable USB PHY node

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4210-trats: Enable USB PHY node
Tomasz Figa [Fri, 28 Dec 2012 15:44:39 +0000 (16:44 +0100)]
ARM: dts: exynos4210-trats: Enable USB PHY node

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4: Move usbphy node to SoC-specific dts files
Tomasz Figa [Mon, 7 Jan 2013 14:52:58 +0000 (15:52 +0100)]
ARM: dts: exynos4: Move usbphy node to SoC-specific dts files

USB PHY of Exynos4210 and Exynos4x12 require different compatible
strings, making usbphy node SoC-specific.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4: Add node for USB PHY
Tomasz Figa [Fri, 28 Dec 2012 15:44:10 +0000 (16:44 +0100)]
ARM: dts: exynos4: Add node for USB PHY

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: exynos4210-trats: Add node for USB gadget
Tomasz Figa [Thu, 4 Oct 2012 10:11:55 +0000 (12:11 +0200)]
ARM: dts: exynos4210-trats: Add node for USB gadget

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: dts: Add dts for exynos4412-slp_pq board
Tomasz Figa [Tue, 11 Sep 2012 12:27:22 +0000 (14:27 +0200)]
ARM: dts: Add dts for exynos4412-slp_pq board

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agodrivers: base: add notifier for failed driver bind
Marek Szyprowski [Thu, 8 Aug 2013 09:05:57 +0000 (11:05 +0200)]
drivers: base: add notifier for failed driver bind

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoiommu/exynos: return 0 if iommu_attach_device() successes
Cho KyongHo [Fri, 26 Jul 2013 11:31:01 +0000 (20:31 +0900)]
iommu/exynos: return 0 if iommu_attach_device() successes

iommu_attach_device() against exynos-iommu positive integer on success
if the caller calls iommu_attach_device() with the same iommu_domain
multiple times without call to iommu_detach_device() to inform the
caller how many calls to iommu_detach_device() to really detach iommu.

However the convention of the return value of success of common API is
zero, this patch makes iommu_attach_device() call against exynos-iommu
always return zero if the given device is successfully attached to
the given iommu_domain even though it is already attached to the same
iommu_domain.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: change rwlock to spinlock
Cho KyongHo [Fri, 26 Jul 2013 11:30:42 +0000 (20:30 +0900)]
iommu/exynos: change rwlock to spinlock

Since acquiring read_lock is not more frequent than write_lock, it is
not beneficial to use rwlock, this commit changes rwlock to spinlock.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: add bus notifier for registering System MMU
Cho KyongHo [Fri, 26 Jul 2013 11:30:17 +0000 (20:30 +0900)]
iommu/exynos: add bus notifier for registering System MMU

When a device driver is registered, all constructs to handle System MMU
is prepared by bus notifier call.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: remove custom fault handler
Cho KyongHo [Fri, 26 Jul 2013 11:29:06 +0000 (20:29 +0900)]
iommu/exynos: remove custom fault handler

This commit removes custom fault handler. The device drivers that
need to register fault handler can register
with iommu_set_fault_handler().

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: remove prefetch buffer setting when enabling System MMU
Cho KyongHo [Fri, 26 Jul 2013 11:28:49 +0000 (20:28 +0900)]
iommu/exynos: remove prefetch buffer setting when enabling System MMU

Prefetch buffer must be handled accurately, exact range of a buffer,
frame by frame manually. Otherwise, it may causes page fault or
deadlock in System MMU.
Thus this patch removes prefetch buffer setting when System MMU is
initialized(enabled).

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: support for device tree
Cho KyongHo [Fri, 26 Jul 2013 11:28:36 +0000 (20:28 +0900)]
iommu/exynos: support for device tree

This commit adds device tree support for System MMU.
This also include the following changes and enhancements:

* use managed device helper functions.
Simplyfies System MMU device driver.

* use only a single clock descriptor.
System MMU device descriptor is seperate if it is imposible to make
a single clock descriptor to make a device descriptor for a group of
System MMUs.

* removed dbgname member from sysmmu_drvdata structure.
debugging kernel message for a System MMU is distinguisheable with the
name of device descroptors.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoARM: dts: Add description of System MMU of Exynos SoCs
Cho KyongHo [Fri, 26 Jul 2013 11:28:19 +0000 (20:28 +0900)]
ARM: dts: Add description of System MMU of Exynos SoCs

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoclk: exynos5250: add gate clock descriptions of System MMU
Cho KyongHo [Fri, 26 Jul 2013 11:27:54 +0000 (20:27 +0900)]
clk: exynos5250: add gate clock descriptions of System MMU

This adds gate clocks of all System MMUs and their master IPs
that are not apeared in clk-exynos5250.c

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: allocate lv2 page table from own slab
Cho KyongHo [Fri, 26 Jul 2013 11:27:29 +0000 (20:27 +0900)]
iommu/exynos: allocate lv2 page table from own slab

Since kmalloc() does not guarantee that the allignment of 1KiB when it
allocates 1KiB, it is required to allocate lv2 page table from own
slab that guarantees alignment of 1KiB

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: fix page table maintenance
Cho KyongHo [Fri, 26 Jul 2013 11:27:11 +0000 (20:27 +0900)]
iommu/exynos: fix page table maintenance

This prevents allocating lv2 page table for the lv1 page table entry
that already has 1MB page mapping. In addition some BUG_ON() is
changed to WARN_ON().

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: add missing cache flush for removed page table entries
Cho KyongHo [Fri, 26 Jul 2013 11:26:28 +0000 (20:26 +0900)]
iommu/exynos: add missing cache flush for removed page table entries

This commit adds cache flush for removed small and large page entries
in exynos_iommu_unmap(). Missing cache flush of removed page table
entries can cause missing page fault interrupt when a master IP
accesses an unmapped area.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoiommu/exynos: do not include removed header
Cho KyongHo [Fri, 26 Jul 2013 11:26:10 +0000 (20:26 +0900)]
iommu/exynos: do not include removed header

This commit remove <mach/sysmmu.h> which is removed.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
9 years agoARM: dts: exynos4: Add node for hsotg
Tomasz Figa [Tue, 11 Sep 2012 11:37:40 +0000 (13:37 +0200)]
ARM: dts: exynos4: Add node for hsotg

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agousb: phy: samsung: Add support for USB 2.0 PHY on Exynos 4x12
Tomasz Figa [Mon, 25 Mar 2013 16:39:07 +0000 (17:39 +0100)]
usb: phy: samsung: Add support for USB 2.0 PHY on Exynos 4x12

This patch adds driver data for Exynos 4x12 USB 2.0 PHY.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: phy: samsung: Pass enable/disable callbacks through driver data
Tomasz Figa [Mon, 25 Mar 2013 15:57:32 +0000 (16:57 +0100)]
usb: phy: samsung: Pass enable/disable callbacks through driver data

To remove unnecessary if statements, this patch introduces phy_enable
and phy_disable callbacks in driver data structure that implement
SoC-specific PHY initialization and deinitialization.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: phy: samsung: Pass set_isolation callback through driver data
Tomasz Figa [Mon, 25 Mar 2013 15:40:52 +0000 (16:40 +0100)]
usb: phy: samsung: Pass set_isolation callback through driver data

This patch extends driver data structure with set_isolation callback,
which allows to remove the need for checking for SoC type in a switch
statement.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: phy: samsung: Consolidate reference clock rate handling
Tomasz Figa [Mon, 25 Mar 2013 15:15:55 +0000 (16:15 +0100)]
usb: phy: samsung: Consolidate reference clock rate handling

This patch cleans up handling of reference clock rate in Samsung USB PHY
drivers. It is mostly a cosmetic change but improves error handling in
case of failing to get reference clock or invalid clock rate.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: phy: samsung: Use clk_get to get reference clock
Tomasz Figa [Mon, 25 Mar 2013 18:36:22 +0000 (19:36 +0100)]
usb: phy: samsung: Use clk_get to get reference clock

There is no need to use devm_clk_get to get a clock that is being put
at the end of the function.

This patch changes the code getting reference clock to use clk_get
instead of useless in this case devm_clk_get.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: phy: samsung: Select common driver part implicitly
Tomasz Figa [Mon, 25 Mar 2013 14:48:47 +0000 (15:48 +0100)]
usb: phy: samsung: Select common driver part implicitly

Since phy-samsung-usb library can be used only by phy-samsung-usb2 and
phy-samsung-usb3 drivers, there is no need to give explicit control over
its Kconfig symbol.

This patch makes CONFIG_SAMSUNG_USBPHY symbol hidden and selected
implicitly by CONFIG_SAMSUNG_USB2PHY and CONFIG_SAMSUNG_USB3PHY.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
9 years agousb: gadget: s3c-hsotg: Add device tree-based instantiation
Tomasz Figa [Tue, 11 Sep 2012 11:36:51 +0000 (13:36 +0200)]
usb: gadget: s3c-hsotg: Add device tree-based instantiation

9 years agomm: cma: allocate pages from CMA if NR_FREE_PAGES approaches low water mark
Marek Szyprowski [Fri, 9 Nov 2012 15:04:23 +0000 (16:04 +0100)]
mm: cma: allocate pages from CMA if NR_FREE_PAGES approaches low water mark

It has been observed that system tends to keep a lot of CMA free pages
even in very high memory pressure use cases. The CMA fallback for movable
pages is used very rarely, only when system is completely pruned from
MOVABLE pages, what usually means that the out-of-memory even will be
triggered very soon. To avoid such situation and make better use of CMA
pages, a heuristics is introduced which turns on CMA fallback for movable
pages when the real number of free pages (excluding CMA free pages)
approaches low water mark.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Michal Nazarewicz <mina86@mina86.com>
9 years agofs/buffer.c: Revoke LRU when trying to drop buffers
Laura Abbott [Wed, 12 Sep 2012 07:36:16 +0000 (09:36 +0200)]
fs/buffer.c: Revoke LRU when trying to drop buffers

When a buffer is added to the LRU list, a reference is taken which is
not dropped until the buffer is evicted from the LRU list. This is the
correct behavior, however this LRU reference will prevent the buffer
from being dropped. This means that the buffer can't actually be dropped
until it is selected for eviction. There's no bound on the time spent
on the LRU list, which means that the buffer may be undroppable for
very long periods of time. Given that migration involves dropping
buffers, the associated page is now unmigratible for long periods of
time as well. CMA relies on being able to migrate a specific range
of pages, so these these types of failures make CMA significantly
less reliable, especially under high filesystem usage.

Rather than waiting for the LRU algorithm to eventually kick out
the buffer, explicitly remove the buffer from the LRU list when trying
to drop it. There is still the possibility that the buffer
could be added back on the list, but that indicates the buffer is
still in use and would probably have other 'in use' indicates to
prevent dropping.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
9 years agofs: jbd2: force commit to free jbd2's cma/isolated page
Marek Szyprowski [Tue, 4 Sep 2012 08:44:49 +0000 (10:44 +0200)]
fs: jbd2: force commit to free jbd2's cma/isolated page

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
9 years agoARM: dts: exynos4: Add DT nodes for L2 cache controller
Tomasz Figa [Wed, 12 Sep 2012 13:36:39 +0000 (15:36 +0200)]
ARM: dts: exynos4: Add DT nodes for L2 cache controller

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: EXYNOS: Add secure firmware support to l2x0 initialization
Tomasz Figa [Wed, 12 Sep 2012 13:35:58 +0000 (15:35 +0200)]
ARM: EXYNOS: Add secure firmware support to l2x0 initialization

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoARM: EXYNOS: Fail l2x0 cache initialization if DT-based init fails
Tomasz Figa [Wed, 12 Sep 2012 13:30:32 +0000 (15:30 +0200)]
ARM: EXYNOS: Fail l2x0 cache initialization if DT-based init fails

On DT-based boards, DT decides whether to enable l2x0 cache controller
or not.

This patch modifies Exynos l2x0 cache initialization code to fail if
l2x0_of_init fails.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
9 years agoLinux 3.10.60 upstream v3.10.60
Greg Kroah-Hartman [Fri, 14 Nov 2014 16:48:23 +0000 (08:48 -0800)]
Linux 3.10.60

9 years agolibceph: ceph-msgr workqueue needs a resque worker
Ilya Dryomov [Fri, 10 Oct 2014 12:39:05 +0000 (16:39 +0400)]
libceph: ceph-msgr workqueue needs a resque worker

commit f9865f06f7f18c6661c88d0511f05c48612319cc upstream.

Commit f363e45fd118 ("net/ceph: make ceph_msgr_wq non-reentrant")
effectively removed WQ_MEM_RECLAIM flag from ceph_msgr_wq.  This is
wrong - libceph is very much a memory reclaim path, so restore it.

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Tested-by: Micha Krause <micha@krausam.de>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoBtrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup
Chris Mason [Tue, 4 Nov 2014 14:59:04 +0000 (06:59 -0800)]
Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup

commit 6e5aafb27419f32575b27ef9d6a31e5d54661aca upstream.

If we hit any errors in btrfs_lookup_csums_range, we'll loop through all
the csums we allocate and free them.  But the code was using list_entry
incorrectly, and ended up trying to free the on-stack list_head instead.

This bug came from commit 0678b6185

btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()

Signed-off-by: Chris Mason <clm@fb.com>
Reported-by: Erik Berg <btrfs@slipsprogrammoer.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoof: Fix overflow bug in string property parsing functions
Grant Likely [Mon, 3 Nov 2014 15:15:35 +0000 (15:15 +0000)]
of: Fix overflow bug in string property parsing functions

commit a87fa1d81a9fb5e9adca9820e16008c40ad09f33 upstream.

The string property read helpers will run off the end of the buffer if
it is handed a malformed string property. Rework the parsers to make
sure that doesn't happen. At the same time add new test cases to make
sure the functions behave themselves.

The original implementations of of_property_read_string_index() and
of_property_count_strings() both open-coded the same block of parsing
code, each with it's own subtly different bugs. The fix here merges
functions into a single helper and makes the original functions static
inline wrappers around the helper.

One non-bugfix aspect of this patch is the addition of a new wrapper,
of_property_read_string_array(). The new wrapper is needed by the
device_properties feature that Rafael is working on and planning to
merge for v3.19. The implementation is identical both with and without
the new static inline wrapper, so it just got left in to reduce the
churn on the header file.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Darren Hart <darren.hart@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agosysfs: driver core: Fix glue dir race condition by gdp_mutex
Yijing Wang [Fri, 7 Nov 2014 04:05:49 +0000 (12:05 +0800)]
sysfs: driver core: Fix glue dir race condition by gdp_mutex

commit e4a60d139060975eb956717e4f63ae348d4d8cc5 upstream.

There is a race condition when removing glue directory.
It can be reproduced in following test:

path 1: Add first child device
device_add()
    get_device_parent()
            /*find parent from glue_dirs.list*/
            list_for_each_entry(k, &dev->class->p->glue_dirs.list, entry)
                    if (k->parent == parent_kobj) {
                            kobj = kobject_get(k);
                            break;
                    }
            ....
            class_dir_create_and_add()

path2: Remove last child device under glue dir
device_del()
    cleanup_device_parent()
            cleanup_glue_dir()
                    kobject_put(glue_dir);

If path2 has been called cleanup_glue_dir(), but not
call kobject_put(glue_dir), the glue dir is still
in parent's kset list. Meanwhile, path1 find the glue
dir from the glue_dirs.list. Path2 may release glue dir
before path1 call kobject_get(). So kernel will report
the warning and bug_on.

This is a "classic" problem we have of a kref in a list
that can be found while the last instance could be removed
at the same time.

This patch reuse gdp_mutex to fix this race condition.

The following calltrace is captured in kernel 3.4, but
the latest kernel still has this bug.

-----------------------------------------------------
<4>[ 3965.441471] WARNING: at ...include/linux/kref.h:41 kobject_get+0x33/0x40()
<4>[ 3965.441474] Hardware name: Romley
<4>[ 3965.441475] Modules linked in: isd_iop(O) isd_xda(O)...
...
<4>[ 3965.441605] Call Trace:
<4>[ 3965.441611]  [<ffffffff8103717a>] warn_slowpath_common+0x7a/0xb0
<4>[ 3965.441615]  [<ffffffff810371c5>] warn_slowpath_null+0x15/0x20
<4>[ 3965.441618]  [<ffffffff81215963>] kobject_get+0x33/0x40
<4>[ 3965.441624]  [<ffffffff812d1e45>] get_device_parent.isra.11+0x135/0x1f0
<4>[ 3965.441627]  [<ffffffff812d22d4>] device_add+0xd4/0x6d0
<4>[ 3965.441631]  [<ffffffff812d0dbc>] ? dev_set_name+0x3c/0x40
....
<2>[ 3965.441912] kernel BUG at ..../fs/sysfs/group.c:65!
<4>[ 3965.441915] invalid opcode: 0000 [#1] SMP
...
<4>[ 3965.686743]  [<ffffffff811a677e>] sysfs_create_group+0xe/0x10
<4>[ 3965.686748]  [<ffffffff810cfb04>] blk_trace_init_sysfs+0x14/0x20
<4>[ 3965.686753]  [<ffffffff811fcabb>] blk_register_queue+0x3b/0x120
<4>[ 3965.686756]  [<ffffffff812030bc>] add_disk+0x1cc/0x490
....
-------------------------------------------------------

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoi2c: at91: don't account as iowait
Wolfram Sang [Mon, 3 Nov 2014 20:16:16 +0000 (21:16 +0100)]
i2c: at91: don't account as iowait

commit 11cfbfb098b22d3e57f1f2be217cad20e2d48463 upstream.

iowait is for blkio [1]. I2C shouldn't use it.

[1] https://lkml.org/lkml/2014/11/3/317

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoacer-wmi: Add acpi_backlight=video quirk for the Acer KAV80
Hans de Goede [Wed, 22 Oct 2014 14:06:38 +0000 (16:06 +0200)]
acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80

commit 183fd8fcd7f8afb7ac5ec68f83194872f9fecc84 upstream.

The acpi-video backlight interface on the Acer KAV80 is broken, and worse
it causes the entire machine to slow down significantly after a suspend/resume.

Blacklist it, and use the acer-wmi backlight interface instead. Note that
the KAV80 is somewhat unique in that it is the only Acer model where we
fall back to acer-wmi after blacklisting, rather then using the native
(e.g. intel) backlight driver. This is done because there is no native
backlight interface on this model.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1128309
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agorbd: Fix error recovery in rbd_obj_read_sync()
Jan Kara [Wed, 22 Oct 2014 07:17:24 +0000 (09:17 +0200)]
rbd: Fix error recovery in rbd_obj_read_sync()

commit a8d4205623ae965e36c68629db306ca0695a2771 upstream.

When we fail to allocate page vector in rbd_obj_read_sync() we just
basically ignore the problem and continue which will result in an oops
later. Fix the problem by returning proper error.

CC: Yehuda Sadeh <yehuda@inktank.com>
CC: Sage Weil <sage@inktank.com>
CC: ceph-devel@vger.kernel.org
Coverity-id: 1226882
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrm/radeon: remove invalid pci id
Alex Deucher [Sun, 26 Oct 2014 19:18:42 +0000 (15:18 -0400)]
drm/radeon: remove invalid pci id

commit 8c3e434769b1707fd2d24de5a2eb25fedc634c4a upstream.

0x4c6e is a secondary device id so should not be used
by the driver.

Noticed-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agousb: gadget: udc: core: fix kernel oops with soft-connect
Felipe Balbi [Mon, 10 Nov 2014 15:06:20 +0000 (09:06 -0600)]
usb: gadget: udc: core: fix kernel oops with soft-connect

[ Upstream commit bfa6b18c680450c17512c741ed1d818695747621 ]

Currently, there's no guarantee that udc->driver
will be valid when using soft_connect sysfs
interface. In fact, we can very easily trigger
a NULL pointer dereference by trying to disconnect
when a gadget driver isn't loaded.

Fix this bug:

~# echo disconnect > soft_connect
[   33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
[   33.694221] pgd = ed0cc000
[   33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
[   33.703766] Internal error: Oops: 17 [#1] SMP ARM
[   33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
[   33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
[   33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
[   33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
[   33.753416] LR is at mark_held_locks+0x78/0x90
[   33.758057] pc : [<c04df128>]    lr : [<c00896a4>]    psr: 20000013
[   33.758057] sp : ee68bec8  ip : c0c00008  fp : ee68bee4
[   33.770050] r10: ee6b394c  r9 : ee68bf80  r8 : ee6062c0
[   33.775508] r7 : 00000000  r6 : ee6062c0  r5 : 0000000b  r4 : ee739408
[   33.782346] r3 : 00000000  r2 : 00000000  r1 : ee71d390  r0 : ee664170
[   33.789168] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   33.796636] Control: 10c5387d  Table: ad0cc059  DAC: 00000015
[   33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
[   33.808740] Stack: (0xee68bec8 to 0xee68c000)
[   33.813299] bec0:                   0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
[   33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
[   33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
[   33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
[   33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
[   33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
[   33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
[   33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
[   33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
[   33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
[   33.898890] [<c04df128>] (usb_udc_softconn_store) from [<c04112ac>] (dev_attr_store+0x28/0x34)
[   33.907920] [<c04112ac>] (dev_attr_store) from [<c01c2868>] (sysfs_kf_write+0x5c/0x60)
[   33.916200] [<c01c2868>] (sysfs_kf_write) from [<c01c1a24>] (kernfs_fop_write+0xd0/0x194)
[   33.924773] [<c01c1a24>] (kernfs_fop_write) from [<c0152dd8>] (vfs_write+0xb0/0x1bc)
[   33.932874] [<c0152dd8>] (vfs_write) from [<c0153330>] (SyS_write+0x54/0xb0)
[   33.940247] [<c0153330>] (SyS_write) from [<c000f080>] (ret_fast_syscall+0x0/0x48)
[   33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
[   33.954625] ---[ end trace f849bead94eab7ea ]---

Fixes: 2ccea03 (usb: gadget: introduce UDC Class)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agousb: gadget: function: acm: make f_acm pass USB20CV Chapter9
Felipe Balbi [Mon, 10 Nov 2014 14:56:40 +0000 (08:56 -0600)]
usb: gadget: function: acm: make f_acm pass USB20CV Chapter9

[ Upstream commit 52ec49a5e56a27c5b6f8217708783eff39f24c16 ]

During Halt Endpoint Test, our interrupt endpoint
will be disabled, which will clear out ep->desc
to NULL. Unless we call config_ep_by_speed() again,
we will not be able to enable this endpoint which
will make us fail that test.

Fixes: f9c56cd (usb: gadget: Clear usb_endpoint_descriptor
inside the struct usb_ep on disable)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agousb: dwc3: gadget: fix set_halt() bug with pending transfers
Felipe Balbi [Mon, 10 Nov 2014 14:55:44 +0000 (08:55 -0600)]
usb: dwc3: gadget: fix set_halt() bug with pending transfers

[ Upstream commit 7a60855972f0d3c014093046cb6f013a1ee5bb19 ]

According to our Gadget Framework API documentation,
->set_halt() *must* return -EAGAIN if we have pending
transfers (on either direction) or FIFO isn't empty (on
TX endpoints).

Fix this bug so that the mass storage gadget can be used
without stall=0 parameter.

This patch should be backported to all kernels since v3.2.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agocrypto: algif - avoid excessive use of socket buffer in skcipher
Ondrej Kozina [Mon, 25 Aug 2014 09:49:54 +0000 (11:49 +0200)]
crypto: algif - avoid excessive use of socket buffer in skcipher

commit e2cffb5f493a8b431dc87124388ea59b79f0bccb upstream.

On archs with PAGE_SIZE >= 64 KiB the function skcipher_alloc_sgl()
fails with -ENOMEM no matter what user space actually requested.
This is caused by the fact sock_kmalloc call inside the function tried
to allocate more memory than allowed by the default kernel socket buffer
size (kernel param net.core.optmem_max).

Signed-off-by: Ondrej Kozina <okozina@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agomm: Remove false WARN_ON from pagecache_isize_extended()
Jan Kara [Wed, 29 Oct 2014 23:35:00 +0000 (10:35 +1100)]
mm: Remove false WARN_ON from pagecache_isize_extended()

commit f55fefd1a5a339b1bd08c120b93312d6eb64a9fb upstream.

The WARN_ON checking whether i_mutex is held in
pagecache_isize_extended() was wrong because some filesystems (e.g.
XFS) use different locks for serialization of truncates / writes. So
just remove the check.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agox86, apic: Handle a bad TSC more gracefully
Andy Lutomirski [Wed, 15 Oct 2014 17:12:07 +0000 (10:12 -0700)]
x86, apic: Handle a bad TSC more gracefully

commit b47dcbdc5161d3d5756f430191e2840d9b855492 upstream.

If the TSC is unusable or disabled, then this patch fixes:

 - Confusion while trying to clear old APIC interrupts.
 - Division by zero and incorrect programming of the TSC deadline
   timer.

This fixes boot if the CPU has a TSC deadline timer but a missing or
broken TSC.  The failure to boot can be observed with qemu using
-cpu qemu64,-tsc,+tsc-deadline

This also happens to me in nested KVM for unknown reasons.
With this patch, I can boot cleanly (although without a TSC).

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Bandan Das <bsd@redhat.com>
Link: http://lkml.kernel.org/r/e2fa274e498c33988efac0ba8b7e3120f7f92d78.1413393027.git.luto@amacapital.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoposix-timers: Fix stack info leak in timer_create()
Mathias Krause [Sat, 4 Oct 2014 21:06:39 +0000 (23:06 +0200)]
posix-timers: Fix stack info leak in timer_create()

commit 6891c4509c792209c44ced55a60f13954cb50ef4 upstream.

If userland creates a timer without specifying a sigevent info, we'll
create one ourself, using a stack local variable. Particularly will we
use the timer ID as sival_int. But as sigev_value is a union containing
a pointer and an int, that assignment will only partially initialize
sigev_value on systems where the size of a pointer is bigger than the
size of an int. On such systems we'll copy the uninitialized stack bytes
from the timer_create() call to userland when the timer actually fires
and we're going to deliver the signal.

Initialize sigev_value with 0 to plug the stack info leak.

Found in the PaX patch, written by the PaX Team.

Fixes: 5a9fa7307285 ("posix-timers: kill ->it_sigev_signo and...")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Brad Spengler <spender@grsecurity.net>
Cc: PaX Team <pageexec@freemail.hu>
Link: http://lkml.kernel.org/r/1412456799-32339-1-git-send-email-minipli@googlemail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agomac80211: fix typo in starting baserate for rts_cts_rate_idx
Karl Beldan [Mon, 13 Oct 2014 12:34:41 +0000 (14:34 +0200)]
mac80211: fix typo in starting baserate for rts_cts_rate_idx

commit c7abf25af0f41be4b50d44c5b185d52eea360cb8 upstream.

It affects non-(V)HT rates and can lead to selecting an rts_cts rate
that is not a basic rate or way superior to the reference rate (ATM
rates[0] used for the 1st attempt of the protected frame data).

E.g, assuming drivers register growing (bitrate) sorted tables of
ieee80211_rate-s, having :
- rates[0].idx == d'2 and basic_rates == b'10100
will select rts_cts idx b'10011 & ~d'(BIT(2)-1), i.e. 1, likewise
- rates[0].idx == d'2 and basic_rates == b'10001
will select rts_cts idx b'10000
The first is not a basic rate and the second is > rates[0].

Also, wrt severity of the addressed misbehavior, ATM we only have one
rts_cts_rate_idx rather than one per rate table entry, so this idx might
still point to bitrates > rates[1..MAX_RATES].

Fixes: 5253ffb8c9e1 ("mac80211: always pick a basic rate to tx RTS/CTS for pre-HT rates")
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoPM / Sleep: fix recovery during resuming from hibernation
Imre Deak [Fri, 24 Oct 2014 17:29:10 +0000 (20:29 +0300)]
PM / Sleep: fix recovery during resuming from hibernation

commit 94fb823fcb4892614f57e59601bb9d4920f24711 upstream.

If a device's dev_pm_ops::freeze callback fails during the QUIESCE
phase, we don't rollback things correctly calling the thaw and complete
callbacks. This could leave some devices in a suspended state in case of
an error during resuming from hibernation.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agotty: Fix high cpu load if tty is unreleaseable
Peter Hurley [Thu, 16 Oct 2014 17:51:30 +0000 (13:51 -0400)]
tty: Fix high cpu load if tty is unreleaseable

commit 37b164578826406a173ca7c20d9ba7430134d23e upstream.

Kernel oops can cause the tty to be unreleaseable (for example, if
n_tty_read() crashes while on the read_wait queue). This will cause
tty_release() to endlessly loop without sleeping.

Use a killable sleep timeout which grows by 2n+1 jiffies over the interval
[0, 120 secs.) and then jumps to forever (but still killable).

NB: killable just allows for the task to be rewoken manually, not
to be terminated.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoquota: Properly return errors from dquot_writeback_dquots()
Jan Kara [Wed, 22 Oct 2014 07:06:49 +0000 (09:06 +0200)]
quota: Properly return errors from dquot_writeback_dquots()

commit 474d2605d119479e5aa050f738632e63589d4bb5 upstream.

Due to a switched left and right side of an assignment,
dquot_writeback_dquots() never returned error. This could result in
errors during quota writeback to not be reported to userspace properly.
Fix it.

Coverity-id: 1226884
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoext3: Don't check quota format when there are no quota files
Jan Kara [Tue, 16 Sep 2014 20:23:10 +0000 (22:23 +0200)]
ext3: Don't check quota format when there are no quota files

commit 7938db449bbc55bbeb164bec7af406212e7e98f1 upstream.

The check whether quota format is set even though there are no
quota files with journalled quota is pointless and it actually
makes it impossible to turn off journalled quotas (as there's
no way to unset journalled quota format). Just remove the check.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agonfsd4: fix crash on unknown operation number
J. Bruce Fields [Wed, 22 Oct 2014 18:46:29 +0000 (14:46 -0400)]
nfsd4: fix crash on unknown operation number

commit 51904b08072a8bf2b9ed74d1bd7a5300a614471d upstream.

Unknown operation numbers are caught in nfsd4_decode_compound() which
sets op->opnum to OP_ILLEGAL and op->status to nfserr_op_illegal.  The
error causes the main loop in nfsd4_proc_compound() to skip most
processing.  But nfsd4_proc_compound also peeks ahead at the next
operation in one case and doesn't take similar precautions there.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>