]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMerge tag 'at91-cleanup4_bis' into at91-next
Nicolas Ferre [Sun, 5 Apr 2015 20:29:14 +0000 (22:29 +0200)]
Merge tag 'at91-cleanup4_bis' into at91-next

Fourth batch of cleanup for 4.1:
- 1 issues revealed by the kbuild test robot fixed
- move of some functions and macros into relevant files to be able to
  streamline the at91 specific header afterwards

9 years agoARM: at91/pm: move AT91_MEMCTRL_* to pm.h
Alexandre Belloni [Mon, 16 Mar 2015 22:44:38 +0000 (23:44 +0100)]
ARM: at91/pm: move AT91_MEMCTRL_* to pm.h

the AT91_MEMCTRL_* defines are only used by the pm code, move them to pm.h

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: move the standby functions to pm.c
Alexandre Belloni [Mon, 16 Mar 2015 22:44:37 +0000 (23:44 +0100)]
ARM: at91/pm: move the standby functions to pm.c

The standby functions are now only used in pm.c, move them there.

Also, they are not inlined as a pointer to those functions is passed to the
cpuidle driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: fix pm_suspend.S compilation when ARMv6 is selected
Alexandre Belloni [Thu, 19 Mar 2015 20:14:40 +0000 (21:14 +0100)]
ARM: at91: fix pm_suspend.S compilation when ARMv6 is selected

When compiling for multiplatform for both ARMv6 and ARMv7, the default compiler
flags are for ARMv6, and results in:

arch/arm/mach-at91/pm_suspend.S:144: Error: selected processor does not support ARM mode `dsb'

Enforce ARMv7 flags for pm_suspend.o when CPU_V7 is selected.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoMerge branch 'at91-4.1-multiplatform' into at91-next
Nicolas Ferre [Thu, 19 Mar 2015 15:40:29 +0000 (16:40 +0100)]
Merge branch 'at91-4.1-multiplatform' into at91-next

9 years agoARM: at91: drop AT91_TIMER_HZ
Alexandre Belloni [Fri, 13 Mar 2015 21:57:24 +0000 (22:57 +0100)]
ARM: at91: drop AT91_TIMER_HZ

Drop AT91_TIMER_HZ as this can be handled using HZ_FIXED. Initial help message
was:

On AT91rm9200 chips where you're using a system clock derived
from the 32768 Hz hardware clock, this tick rate should divide
it exactly: use a power-of-two value, such as 128 or 256, to
reduce timing errors caused by rounding.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove hardware.h
Alexandre Belloni [Fri, 13 Mar 2015 21:57:23 +0000 (22:57 +0100)]
ARM: at91: remove hardware.h

hardware.h is now mostyl unused, move the remaining declarations to pm.c and
remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove SoC headers
Alexandre Belloni [Fri, 13 Mar 2015 21:57:22 +0000 (22:57 +0100)]
ARM: at91: remove SoC headers

Remove the now useless SoC headers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove useless mach/cpu.h
Alexandre Belloni [Fri, 13 Mar 2015 21:57:21 +0000 (22:57 +0100)]
ARM: at91: remove useless mach/cpu.h

mach/cpu.h is not used anymore, remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove unused headers
Alexandre Belloni [Fri, 13 Mar 2015 21:57:20 +0000 (22:57 +0100)]
ARM: at91: remove unused headers

Following the switch to multiplatform, uncompress.h is not used anymore. Remove
it.
at91_dbgu.h is also not used anymore

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: switch at91_dt_defconfig to multiplatform
Alexandre Belloni [Fri, 13 Mar 2015 21:57:19 +0000 (22:57 +0100)]
ARM: at91: switch at91_dt_defconfig to multiplatform

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: switch to multiplatform
Alexandre Belloni [Fri, 13 Mar 2015 21:57:18 +0000 (22:57 +0100)]
ARM: at91: switch to multiplatform

Switch AT91 to multiplatform as all SoCs are properly handled.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoMerge tag 'at91-cleanup3' into at91-4.1-multiplatform
Nicolas Ferre [Mon, 16 Mar 2015 17:09:48 +0000 (18:09 +0100)]
Merge tag 'at91-cleanup3' into at91-4.1-multiplatform

Third batch of cleanup for 4.1:
- System Timer (ST) for at91rm9200 re-work (syscon/regmap):
  - watchdog
  - restart handler
  - timer as a proper clocksource
  => remove mach dependency + cleanup

9 years agoMerge tag 'at91-cleanup2' into at91-4.1-multiplatform
Nicolas Ferre [Mon, 16 Mar 2015 17:09:44 +0000 (18:09 +0100)]
Merge tag 'at91-cleanup2' into at91-4.1-multiplatform

Second batch of cleanup for 4.1:
- remove unused matrix header files
- dbgu + chip identification: new driver for SoC detection
  this allow to remove all additional io mapping
- remove old non-standard AT91 setup code

9 years agoMerge tag 'at91-cleanup' into at91-4.1-multiplatform
Nicolas Ferre [Mon, 16 Mar 2015 17:09:39 +0000 (18:09 +0100)]
Merge tag 'at91-cleanup' into at91-4.1-multiplatform

First batch of cleanup for 4.1:
- little phy fixup that is not needed anymore
- hudge cleanup of the PM code:
  - removal of "use slow clock" option => always use this for suspend to RAM
  - quicker suspend as the asm function is copied only once to SRAM
  - use of the same asm function for "standby" and "mem" types of suspend
    actions
  - adaptation to the ARMv7 processors

9 years agoMerge tag 'at91-fixes3' into at91-4.1-multiplatform
Nicolas Ferre [Mon, 16 Mar 2015 17:09:34 +0000 (18:09 +0100)]
Merge tag 'at91-fixes3' into at91-4.1-multiplatform

Third fixes batch for AT91 on 4.0:
- clock fixes for USB
- compatible string changes for handling USB IP differences
  (+ needed AHB matrix syscon)
- fix of a compilation error in PM code

9 years agoMerge tag 'at91-fixes2' into at91-4.1-multiplatform
Nicolas Ferre [Mon, 16 Mar 2015 17:09:31 +0000 (18:09 +0100)]
Merge tag 'at91-fixes2' into at91-4.1-multiplatform

Second fixes batch for AT91 on 4.0:
- little fix for !MMU debug: may also help for randconfig
- fix of 2 errors in LCD clock definitions
- in PM code, not writing the key leads to not execute the action

9 years agoMerge tag 'at91-fixes' into at91-4.1-multiplatform
Nicolas Ferre [Mon, 16 Mar 2015 17:09:27 +0000 (18:09 +0100)]
Merge tag 'at91-fixes' into at91-4.1-multiplatform

First fixes batch for AT91 on 4.0:
- PM slowclock fixes for DDR and timeouts
- fix some DT entries
- little defconfig updates
- the removal of a harmful watchdog option + its detailed documentation

9 years agoMerge tag 'at91-cleanup3' into at91-next
Nicolas Ferre [Mon, 16 Mar 2015 17:05:48 +0000 (18:05 +0100)]
Merge tag 'at91-cleanup3' into at91-next

Third batch of cleanup for 4.1:
- System Timer (ST) for at91rm9200 re-work (syscon/regmap):
  - watchdog
  - restart handler
  - timer as a proper clocksource
  => remove mach dependency + cleanup

9 years agoARM: at91: remove useless include
Alexandre Belloni [Thu, 12 Mar 2015 12:07:34 +0000 (13:07 +0100)]
ARM: at91: remove useless include

Both drivers using the system timer are now converted to an MFD. mach/at91_st.h
is now useless.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoclocksource: atmel-st: remove mach/hardware dependency
Alexandre Belloni [Fri, 13 Mar 2015 10:54:37 +0000 (11:54 +0100)]
clocksource: atmel-st: remove mach/hardware dependency

Remove the mach/hardware dependency to prepare the driver for multiplatform
support.
Also switch from setup_irq() to request_irq()

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoclocksource: atmel-st: use syscon/regmap
Alexandre Belloni [Thu, 12 Mar 2015 12:07:32 +0000 (13:07 +0100)]
clocksource: atmel-st: use syscon/regmap

The register range from the system timer is also used by the watchdog driver.
Use a regmap to handle concurrent accesses.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: time: move the system timer driver to drivers/clocksource
Alexandre Belloni [Thu, 12 Mar 2015 12:07:31 +0000 (13:07 +0100)]
ARM: at91: time: move the system timer driver to drivers/clocksource

Import at91rm9200_time.c from mach-at91 as timer-atmel-st.c. Further cleanup is
required to get rid of the mach-at91 headers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: properly initialize timer
Alexandre Belloni [Thu, 12 Mar 2015 12:07:30 +0000 (13:07 +0100)]
ARM: at91: properly initialize timer

Use clocksource_of_init to initialize the system timer instead of relying on a
custom function.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: at91rm9200: remove deprecated arm_pm_restart
Alexandre Belloni [Thu, 12 Mar 2015 12:07:29 +0000 (13:07 +0100)]
ARM: at91: at91rm9200: remove deprecated arm_pm_restart

Now that a proper driver is available, remove at91rm9200_restart.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agowatchdog: at91rm9200: implement restart handler
Alexandre Belloni [Thu, 12 Mar 2015 12:07:28 +0000 (13:07 +0100)]
watchdog: at91rm9200: implement restart handler

Restarting the at91rm9200 is done through programming the watchdog and waiting
for it to reset.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agowatchdog: at91rm9200: use the system timer syscon
Alexandre Belloni [Thu, 12 Mar 2015 12:07:27 +0000 (13:07 +0100)]
watchdog: at91rm9200: use the system timer syscon

Use a syscon regmap to access the system timer registers.

Also, rename the driver atmel_st_watchdog to stop conflicting with
at91sam9_wdt.c

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agomfd: syscon: Add atmel system timer registers definition
Alexandre Belloni [Thu, 12 Mar 2015 12:07:26 +0000 (13:07 +0100)]
mfd: syscon: Add atmel system timer registers definition

AT91RM920 has a memory range reserved for timer and watchdog configuration.
Expose those registers so that drivers can make use of the system timer syscon
declared in at91 DTs.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/dt: declare atmel,at91rm9200-st as a syscon
Alexandre Belloni [Thu, 12 Mar 2015 12:07:25 +0000 (13:07 +0100)]
ARM: at91/dt: declare atmel,at91rm9200-st as a syscon

The system timer register range is used to handle three different
functionalities: Periodic Interval Timer, Real Time Timer and watchdog. Declare
it as a syscon to be able to get a regmap.
Also declare it as a simple-mfd and its watchdog subnode.

Finally, document the watchdog compatible string.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoMerge tag 'at91-cleanup2' into at91-next
Nicolas Ferre [Sat, 14 Mar 2015 16:47:14 +0000 (17:47 +0100)]
Merge tag 'at91-cleanup2' into at91-next

Second batch of cleanup for 4.1:
- remove unused matrix header files
- dbgu + chip identification: new driver for SoC detection
  this allow to remove all additional io mapping
- remove old non-standard AT91 setup code

9 years agoARM: at91: remove old setup
Alexandre Belloni [Thu, 12 Mar 2015 14:54:31 +0000 (15:54 +0100)]
ARM: at91: remove old setup

The old setup is not used anymore, remove it

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: sama5d4: remove useless map_io
Alexandre Belloni [Thu, 5 Mar 2015 19:17:46 +0000 (20:17 +0100)]
ARM: at91: sama5d4: remove useless map_io

All the peripheral remapped at io_map are taken care of by their respective
drivers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: sama5 use SoC detection infrastructure
Alexandre Belloni [Thu, 12 Mar 2015 14:54:30 +0000 (15:54 +0100)]
ARM: at91: sama5 use SoC detection infrastructure

Use the soc detection infrastructure for sama5 initialization.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: at91sam9: use SoC detection infrastructure
Alexandre Belloni [Thu, 12 Mar 2015 14:54:29 +0000 (15:54 +0100)]
ARM: at91: at91sam9: use SoC detection infrastructure

Use the soc detection infrastructure for at91sam9 initialization.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: at91rm9200 use SoC detection infrastructure
Alexandre Belloni [Thu, 12 Mar 2015 14:54:28 +0000 (15:54 +0100)]
ARM: at91: at91rm9200 use SoC detection infrastructure

Use the soc detection infrastructure for at91rm9200 initialization.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: add soc detection infrastructure
Boris BREZILLON [Thu, 12 Mar 2015 14:54:27 +0000 (15:54 +0100)]
ARM: at91: add soc detection infrastructure

Add new structures and functions to handle AT91 SoC detection.

[alexandre.belloni@free-electrons.com: reworked DBGU detection]
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/dt: introduce atmel,<chip>-dbgu
Alexandre Belloni [Thu, 12 Mar 2015 14:54:26 +0000 (15:54 +0100)]
ARM: at91/dt: introduce atmel,<chip>-dbgu

The DBGU is not a simple UART and we need to be able to distinguish it from the
other UARTs, in particular to get its address and check the chip id.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove unused _matrix.h headers
Alexandre Belloni [Thu, 12 Mar 2015 14:54:25 +0000 (15:54 +0100)]
ARM: at91: remove unused _matrix.h headers

The matrix headers are not used anymore, remove them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove unused at91_ioremap_matrix and header
Alexandre Belloni [Thu, 12 Mar 2015 14:54:24 +0000 (15:54 +0100)]
ARM: at91: remove unused at91_ioremap_matrix and header

at91_ioremap_matrix and the at91_matrix.h header are not used anymore, remove
them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove NEED_MACH_IO_H
Arnd Bergmann [Thu, 12 Mar 2015 14:54:23 +0000 (15:54 +0100)]
ARM: at91: remove NEED_MACH_IO_H

The mach/io.h header on at91 is used to support a nonstandard I/O space
window for the cf card driver. This changes the driver to use pci_ioremap_io
in order to have the standard location, and then removes the custom
mach/io.h.

[alexandre.belloni@free-electrons.com: Added PCI dependency]
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoMerge tag 'at91-cleanup' into at91-next
Nicolas Ferre [Fri, 13 Mar 2015 13:17:22 +0000 (14:17 +0100)]
Merge tag 'at91-cleanup' into at91-next

First batch of cleanup for 4.1:
- little phy fixup that is not needed anymore
- hudge cleanup of the PM code:
  - removal of "use slow clock" option => always use this for suspend to RAM
  - quicker suspend as the asm function is copied only once to SRAM
  - use of the same asm function for "standby" and "mem" types of suspend
    actions
  - adaptation to the ARMv7 processors

9 years agoARM: at91/pm: flush data cache and clean, invalidate and disable the L2 cache
Wenyou Yang [Mon, 9 Mar 2015 03:54:26 +0000 (11:54 +0800)]
ARM: at91/pm: flush data cache and clean, invalidate and disable the L2 cache

Flush data cache, and clean, invalidate and disable the L2 cache before going to suspend.
Restore the L2 cache configuration and re-enable the L2 cache after waking up.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm_suspend: add the WFI instruction support for ARMv7
Wenyou Yang [Mon, 9 Mar 2015 03:53:46 +0000 (11:53 +0800)]
ARM: at91/pm_suspend: add the WFI instruction support for ARMv7

Add the WFI instruction to make the cpu to the idle state.
In the meanwhile, disable the processor's clock.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: remove unused void (*at91_pm_standby)(void)
Wenyou Yang [Mon, 9 Mar 2015 03:51:49 +0000 (11:51 +0800)]
ARM: at91/pm: remove unused void (*at91_pm_standby)(void)

Because the standby mode use the same sram function as the suspend to memory
mode, void (*at91_pm_standby)(void) doesn't need, remove it.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: rename function name: at91_slow_clock() --> at91_pm_suspend_sram_fn()
Wenyou Yang [Mon, 9 Mar 2015 03:51:09 +0000 (11:51 +0800)]
ARM: at91/pm: rename function name: at91_slow_clock() --> at91_pm_suspend_sram_fn()

As the file name is renamed, rename the function name at91_slow_clock()
--> at91_pm_suspend_sram_fn(), rename the function handler's name at the
same time.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
[nicolas.ferre@atmel.com: little update of the commit message]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: rename file name: pm_slowclock.S --> pm_suspend.S
Wenyou Yang [Mon, 9 Mar 2015 03:50:29 +0000 (11:50 +0800)]
ARM: at91/pm: rename file name: pm_slowclock.S --> pm_suspend.S

Because the sram function is used for both suspend to memory and the suspend
to standby mode, renaming is more elegant.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: standby mode uses same sram function as suspend to memory mode
Wenyou Yang [Mon, 9 Mar 2015 03:49:46 +0000 (11:49 +0800)]
ARM: at91/pm: standby mode uses same sram function as suspend to memory mode

To simply the PM code, the suspend to standby mode uses same sram function
as the suspend to memory mode, running in the internal SRAM, instead of the
respective code for each mode.

For the suspend to standby mode, the master clock doesn't switch to the slow
clock, and PLLA and the main oscillator doesn't turn off as well.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: move the copying the sram function to the sram initialization phase
Wenyou Yang [Mon, 9 Mar 2015 03:49:01 +0000 (11:49 +0800)]
ARM: at91/pm: move the copying the sram function to the sram initialization phase

To decrease the suspend time, move copying the sram function to the sram
initialization phase, instead of every time go to suspend.

In the meanwhile, substitute fncpy() for memcpy().

If there is no sram allocated for PM, the PM is not supported.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm_slowclock: create the procedure to handle the sdram self-refresh
Wenyou Yang [Mon, 9 Mar 2015 03:48:26 +0000 (11:48 +0800)]
ARM: at91/pm_slowclock: create the procedure to handle the sdram self-refresh

To decrease the duplicated code, create the procedure
to contain both activing and exiting the sdram self-refresh mode.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm_slowclock: remove clocks which are already stopped when entering slow...
Sylvain Rochet [Thu, 5 Feb 2015 06:01:23 +0000 (14:01 +0800)]
ARM: at91/pm_slowclock: remove clocks which are already stopped when entering slow clock mode

Assume USB PLL and PLL B are already stopped before entering sleep mode.

Removed PLL B from slow clock code, all drivers are supposed to properly
unprepare clocks.

Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Acked-by: Wenyou.Yang <wenyou.yang@atmel.com>
[nicolas.ferre@atmel.com: remove the warning printed in pm.c]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm: remove CONFIG_AT91_SLOW_CLOCK config option
Wenyou Yang [Mon, 9 Mar 2015 03:45:35 +0000 (11:45 +0800)]
ARM: at91/pm: remove CONFIG_AT91_SLOW_CLOCK config option

The slow clock always exists, selecting CONFIG_AT91_SLOW_CLOCK config
is unnecessary for the suspend to memory mode.
For this mode the master clock should always switch to the slow clock.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5
Wenyou Yang [Mon, 9 Mar 2015 03:44:50 +0000 (11:44 +0800)]
ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5

To simply the PM config the CONFIG_AT91_SLOW_CLOCK option will be removed,
so move "select SRAM" from under AT91_SLOW_CLOCK, add "select SRAM if PM"
under SOC_AT91SAM9 and SOC_SAMA5

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK
Wenyou Yang [Mon, 9 Mar 2015 03:44:03 +0000 (11:44 +0800)]
ARM: at91/pm_slowclock: remove the unused code related with SLOWDOWN_MASTER_CLOCK

The SLOWDOWN_MASTER_CLOCK definition is not used, remove the redundant code.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: pm: change at91_pm_set_standby() to static
Wenyou Yang [Wed, 4 Mar 2015 01:44:45 +0000 (09:44 +0800)]
ARM: at91: pm: change at91_pm_set_standby() to static

Since at91_pm_set_standby() will not be used out of the pm.c file,
change its attribute from extern to static, remove its declaration as well.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91: remove ksz8081 phy fixup registration for sama5d4ek board
Boris Brezillon [Wed, 4 Mar 2015 11:20:12 +0000 (12:20 +0100)]
ARM: at91: remove ksz8081 phy fixup registration for sama5d4ek board

Commit 2b0ba96cea60 ("net: phy: micrel: disable NAND-tree for KSZ8021,
KSZ8031, KSZ8051, KSZ8081") automated the NAND-tree mode deactivation
process, thus making this phy fixup useless.
Remove it along with the associated headers inclusion.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[nicolas.ferre@atmel.com: remove selection of PHYLIB in at91 Kconfig]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoMerge tag 'at91-fixes3' into at91-4.1-cleanup
Nicolas Ferre [Thu, 12 Mar 2015 14:30:03 +0000 (15:30 +0100)]
Merge tag 'at91-fixes3' into at91-4.1-cleanup

Third fixes batch for AT91 on 4.0:
- clock fixes for USB
- compatible string changes for handling USB IP differences
  (+ needed AHB matrix syscon)
- fix of a compilation error in PM code

9 years agoMerge tag 'at91-fixes2' into at91-4.1-cleanup
Nicolas Ferre [Thu, 12 Mar 2015 14:30:00 +0000 (15:30 +0100)]
Merge tag 'at91-fixes2' into at91-4.1-cleanup

Second fixes batch for AT91 on 4.0:
- little fix for !MMU debug: may also help for randconfig
- fix of 2 errors in LCD clock definitions
- in PM code, not writing the key leads to not execute the action

9 years agoMerge tag 'at91-fixes' into at91-4.1-cleanup
Nicolas Ferre [Thu, 12 Mar 2015 14:29:56 +0000 (15:29 +0100)]
Merge tag 'at91-fixes' into at91-4.1-cleanup

First fixes batch for AT91 on 4.0:
- PM slowclock fixes for DDR and timeouts
- fix some DT entries
- little defconfig updates
- the removal of a harmful watchdog option + its detailed documentation

9 years agoMerge tag 'at91-dt' into at91-next
Nicolas Ferre [Wed, 11 Mar 2015 16:13:19 +0000 (17:13 +0100)]
Merge tag 'at91-dt' into at91-next

First batch of DT changes for 4.1:
- at91sam9x5 & EK board: ISI and camera sensors
- at91sam9n12 & EK board: USB gadget nodes
- sama5d3: typos, gpio-keys on Xplained board
- sama5d4: i2c, leds, audio, ISI, crypto, pwm missing nodes
- new sama5d4 xplained board

9 years agoMerge tag 'at91-fixes3' into at91-next
Nicolas Ferre [Wed, 11 Mar 2015 16:10:46 +0000 (17:10 +0100)]
Merge tag 'at91-fixes3' into at91-next

Third fixes batch for AT91 on 4.0:
- clock fixes for USB
- compatible string changes for handling USB IP differences
  (+ needed AHB matrix syscon)
- fix of a compilation error in PM code

9 years agoMerge tag 'at91-fixes2' into at91-next
Nicolas Ferre [Wed, 11 Mar 2015 16:10:42 +0000 (17:10 +0100)]
Merge tag 'at91-fixes2' into at91-next

Second fixes batch for AT91 on 4.0:
- little fix for !MMU debug: may also help for randconfig
- fix of 2 errors in LCD clock definitions
- in PM code, not writing the key leads to not execute the action

9 years agoMerge tag 'at91-fixes' into at91-next
Nicolas Ferre [Wed, 11 Mar 2015 16:10:38 +0000 (17:10 +0100)]
Merge tag 'at91-fixes' into at91-next

First fixes batch for AT91 on 4.0:
- PM slowclock fixes for DDR and timeouts
- fix some DT entries
- little defconfig updates
- the removal of a harmful watchdog option + its detailed documentation

9 years agoARM: at91: pm_slowclock: fix the compilation error
Wenyou Yang [Wed, 11 Mar 2015 02:08:12 +0000 (10:08 +0800)]
ARM: at91: pm_slowclock: fix the compilation error

When compiling the kernel in thumb2 (CONFIG_THUMB2_KERNEL option activated), we
hit a compilation crash. The error message is listed below:

---8< -----
Error: cannot use register index with PC-relative addressing -- `str r0,.saved_lpr'
--->8----

Add the .arm directive in the assembly files related to power management.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/dt: fix USB high-speed clock to select UTMI
Nicolas Ferre [Mon, 9 Mar 2015 15:51:13 +0000 (16:51 +0100)]
ARM: at91/dt: fix USB high-speed clock to select UTMI

The UTMI clock must be selected by any high-speed USB IP. The logic behind it
needs this particular clock.
So, correct the clock in the device tree files affected.

Reported-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: <stable@vger.kernel.org> #3.18
9 years agoARM: at91/dt: fix at91 udc compatible strings
Boris Brezillon [Wed, 3 Dec 2014 11:32:10 +0000 (12:32 +0100)]
ARM: at91/dt: fix at91 udc compatible strings

The at91rm9200, at91sam9260, at91sam9261 and at91sam9263 SoCs have slightly
different UDC IPs.
Those differences were previously handled with cpu_is_at91xx macro which
are about to be dropped for multi-platform support, thus we need to
change compatible strings.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/dt: declare matrix node as a syscon device
Boris Brezillon [Wed, 3 Dec 2014 11:32:09 +0000 (12:32 +0100)]
ARM: at91/dt: declare matrix node as a syscon device

There is no specific driver handling the AHB matrix, this is a simple syscon
device. the matrix is needed by several other drivers including the USB on some
SoCs (at91sam9261 for instance).
Without this definition, the USB will not work on these SoCs.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoARM: at91/dt: at91sam9261: fix clocks and clock-names in udc definition
Boris Brezillon [Wed, 3 Dec 2014 11:32:03 +0000 (12:32 +0100)]
ARM: at91/dt: at91sam9261: fix clocks and clock-names in udc definition

Peripheral clock is named pclk and system clock is named hclk (those are
the names expected by the at91_udc driver).

Drop the deprecated usb_clk (formerly used to configure the usb clock rate
which is now directly configurable through hclk).

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
9 years agoLinux 4.0-rc3 v4.0-rc3
Linus Torvalds [Sun, 8 Mar 2015 23:09:09 +0000 (16:09 -0700)]
Linux 4.0-rc3

9 years agosunrpc: fix braino in ->poll()
Al Viro [Sat, 7 Mar 2015 21:08:46 +0000 (21:08 +0000)]
sunrpc: fix braino in ->poll()

POLL_OUT isn't what callers of ->poll() are expecting to see; it's
actually __SI_POLL | 2 and it's a siginfo code, not a poll bitmap
bit...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@vger.kernel.org
Cc: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 8 Mar 2015 19:47:18 +0000 (12:47 -0700)]
Merge tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here's a round of USB fixes for 4.0-rc3.

  Nothing major, the usual gadget, xhci and usb-serial fixes and a few
  new device ids as well.

  All have been in linux-next successfully"

* tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
  xhci: Workaround for PME stuck issues in Intel xhci
  xhci: fix reporting of 0-sized URBs in control endpoint
  usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boards
  USB: ch341: set tty baud speed according to tty struct
  USB: serial: cp210x: Adding Seletek device id's
  USB: pl2303: disable break on shutdown
  USB: mxuport: fix null deref when used as a console
  USB: serial: clean up bus probe error handling
  USB: serial: fix port attribute-creation race
  USB: serial: fix tty-device error handling at probe
  USB: serial: fix potential use-after-free after failed probe
  USB: console: add dummy __module_get
  USB: ftdi_sio: add PIDs for Actisense USB devices
  Revert "USB: serial: make bulk_out_size a lower limit"
  cdc-acm: Add support for Denso cradle CU-321
  usb-storage: support for more than 8 LUNs
  uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS539
  USB: usbfs: don't leak kernel data in siginfo
  xhci: Clear the host side toggle manually when endpoint is 'soft reset'
  xhci: Allocate correct amount of scratchpad buffers
  ...

9 years agoMerge tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 8 Mar 2015 19:25:40 +0000 (12:25 -0700)]
Merge tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are some tty and serial driver fixes for 4.0-rc3.

  Along with the atime fix that you know about, here are some other
  serial driver bugfixes as well.  Most notable is a wait_until_sent
  bugfix that was traced back to being around since before 2.6.12 that
  Johan has fixed up.

  All have been in linux-next successfully"

* tag 'tty-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  TTY: fix tty_wait_until_sent maximum timeout
  TTY: fix tty_wait_until_sent on 64-bit machines
  USB: serial: fix infinite wait_until_sent timeout
  TTY: bfin_jtag_comm: remove incorrect wait_until_sent operation
  net: irda: fix wait_until_sent poll timeout
  serial: uapi: Declare all userspace-visible io types
  serial: core: Fix iotype userspace breakage
  serial: sprd: Fix missing spin_unlock in sprd_handle_irq()
  console: Fix console name size mismatch
  tty: fix up atime/mtime mess, take four
  serial: 8250_dw: Fix get_mctrl behaviour
  serial:8250:8250_pci: delete unneeded quirk entries
  serial:8250:8250_pci: fix redundant entry report for WCH_CH352_2S
  Change email address for 8250_pci
  serial: 8250: Revert "tty: serial: 8250_core: read only RX if there is something in the FIFO"
  Revert "tty/serial: of_serial: add DT alias ID handling"

9 years agoMerge tag 'staging-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 8 Mar 2015 19:20:10 +0000 (12:20 -0700)]
Merge tag 'staging-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are some IIO and staging driver fixes for 4.0-rc3.

  Details are in the shortlog, nothing major, mostly IIO fixes for
  reported issues.

  All have been in linux-next successfully"

* tag 'staging-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (23 commits)
  staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel
  staging: comedi: vmk80xx: remove "firmware version" kernel messages
  staging: comedi: comedi_isadma: fix "stalled" detect in comedi_isadma_disable_on_sample()
  iio: ak8975: fix AK09911 dependencies
  iio: common: ssp_sensors: Protect PM-only functions to kill warning
  IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc
  Revert "iio:humidity:si7020: fix pointer to i2c client"
  iio: light: gp2ap020a00f: Select REGMAP_I2C
  iio: light: jsa1212: Select REGMAP_I2C
  iio: ad5686: fix optional reference voltage declaration
  iio:adc:mcp3422 Fix incorrect scales table
  iio: mxs-lradc: fix iio channel map regression
  iio: imu: adis16400: Fix sign extension
  staging: iio: ad2s1200: Fix sign extension
  iio: mxs-lradc: only update the buffer when its conversions have finished
  iio: mxs-lradc: make ADC reads not unschedule touchscreen conversions
  iio: mxs-lradc: make ADC reads not disable touchscreen interrupts
  iio: mxs-lradc: separate touchscreen and buffer virtual channels
  iio: imu: inv_mpu6050: Prevent dereferencing NULL
  iio: iadc: wait_for_completion_timeout time in jiffies
  ...

9 years agoMerge tag 'char-misc-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 8 Mar 2015 19:15:47 +0000 (12:15 -0700)]
Merge tag 'char-misc-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are two char/misc fixes for 4.0-rc3.

  One is a reported binder driver fix needed due to a change in the mm
  core that happened in 4.0-rc1.  Another is a mei driver fix that
  resolves a reported issue in that driver.

  Both have been in linux-next for a while"

* tag 'char-misc-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  mei: make device disabled on stop unconditionally
  android: binder: fix binder mmap failures

9 years agoMerge tag 'cc-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char...
Linus Torvalds [Sun, 8 Mar 2015 18:51:04 +0000 (11:51 -0700)]
Merge tag 'cc-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull "code of conflict" from Greg KH:
 "This file tries to set the rational basis for our code reviews, gives
  some advice on how to conduct them, and provides an excalation channel
  for any kernel developers if they so desire it"

[ Let's see how this works ]

* tag 'cc-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  Code of Conflict

9 years agoMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sat, 7 Mar 2015 19:56:30 +0000 (11:56 -0800)]
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "A set of updates and bugfixes for the new designware-baytrail driver.

  And a documentation bugfix"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: imx: add required clocks property to binding
  i2c: designware-baytrail: baytrail_i2c_acquire() might sleep
  i2c: designware-baytrail: cross-check lock functions
  i2c: designware-baytrail: fix sparse warnings
  i2c: designware-baytrail: fix typo in error path
  i2c: designware-baytrail: describe magic numbers

9 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Sat, 7 Mar 2015 19:52:03 +0000 (11:52 -0800)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes from Vinod Koul:
 "This contains small fixes spread across the drivers"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: mmp_pdma: fix warning about slave caps
  dmaengine: qcom_bam_dma: fix wrong register offsets
  dmaengine: bam-dma: fix a warning about missing capabilities
  dmaengine: ioatdma: workaround for incorrect DMACAP register
  dmaengine: at_xdmac: fix for chan conf simplification
  dmaengine: dw: don't handle interrupt when dmaengine is not used
  dma: mmp-tdma: refine dma disable and dma-pos update
  dmaengine: shdma: Move DMA stop to (runtime) suspend callbacks
  dmaenegine: mmp-pdma: fix irq handler overwrite physical chan issue

9 years agoMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Linus Torvalds [Sat, 7 Mar 2015 19:31:17 +0000 (11:31 -0800)]
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:
 "arm64 and generic kernel/module.c (acked by Rusty) fixes for
  CONFIG_DEBUG_SET_MODULE_RONX"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  kernel/module.c: Update debug alignment after symtable generation
  arm64: Don't use is_module_addr in setting page attributes

9 years agoTTY: fix tty_wait_until_sent maximum timeout
Johan Hovold [Wed, 4 Mar 2015 09:39:07 +0000 (10:39 +0100)]
TTY: fix tty_wait_until_sent maximum timeout

Currently tty_wait_until_sent may take up to twice as long as the
requested timeout while waiting for driver and hardware buffers to
drain.

Fix this by taking the remaining number of jiffies after waiting for
driver buffers to drain into account so that the timeout actually
becomes a maximum timeout as it is documented to be.

Note that this specifically implies tighter timings when closing a port
as a consequence of actually honouring the port closing-wait setting
for drivers relying on tty_wait_until_sent_from_close (e.g. via
tty_port_close_start).

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoTTY: fix tty_wait_until_sent on 64-bit machines
Johan Hovold [Wed, 4 Mar 2015 09:39:06 +0000 (10:39 +0100)]
TTY: fix tty_wait_until_sent on 64-bit machines

Fix overflow bug in tty_wait_until_sent on 64-bit machines, where an
infinite timeout (0) would be passed to the underlying tty-driver's
wait_until_sent-operation as a negative timeout (-1), causing it to
return immediately.

This manifests itself for example as tcdrain() returning immediately,
drivers not honouring the drain flags when setting terminal attributes,
or even dropped data on close as a requested infinite closing-wait
timeout would be ignored.

The first symptom  was reported by Asier LLANO who noted that tcdrain()
returned prematurely when using the ftdi_sio usb-serial driver.

Fix this by passing 0 rather than MAX_SCHEDULE_TIMEOUT (LONG_MAX) to the
underlying tty driver.

Note that the serial-core wait_until_sent-implementation is not affected
by this bug due to a lucky chance (comparison to an unsigned maximum
timeout), and neither is the cyclades one that had an explicit check for
negative timeouts, but all other tty drivers appear to be affected.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org> # v2.6.12
Reported-by: ZIV-Asier Llano Palacios <asier.llano@cgglobal.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoUSB: serial: fix infinite wait_until_sent timeout
Johan Hovold [Wed, 4 Mar 2015 09:39:05 +0000 (10:39 +0100)]
USB: serial: fix infinite wait_until_sent timeout

Make sure to handle an infinite timeout (0).

Note that wait_until_sent is currently never called with a 0-timeout
argument due to a bug in tty_wait_until_sent.

Fixes: dcf010503966 ("USB: serial: add generic wait_until_sent
implementation")
Cc: stable <stable@vger.kernel.org> # v3.10
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoTTY: bfin_jtag_comm: remove incorrect wait_until_sent operation
Johan Hovold [Wed, 4 Mar 2015 09:39:04 +0000 (10:39 +0100)]
TTY: bfin_jtag_comm: remove incorrect wait_until_sent operation

Remove incorrect and redundant wait_until_sent operation, which waits
for the driver buffer rather than any hardware buffers to drain,
something which is already taken care of by the tty layer (and
chars_in_buffer).

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agonet: irda: fix wait_until_sent poll timeout
Johan Hovold [Wed, 4 Mar 2015 09:39:03 +0000 (10:39 +0100)]
net: irda: fix wait_until_sent poll timeout

In case an infinite timeout (0) is requested, the irda wait_until_sent
implementation would use a zero poll timeout rather than the default
200ms.

Note that wait_until_sent is currently never called with a 0-timeout
argument due to a bug in tty_wait_until_sent.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org> # v2.6.12
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial: uapi: Declare all userspace-visible io types
Peter Hurley [Sun, 1 Mar 2015 15:24:28 +0000 (10:24 -0500)]
serial: uapi: Declare all userspace-visible io types

ioctl(TIOCGSERIAL|TIOCSSERIAL) report and can change the port->iotype.
UART drivers use the UPIO_* definitions, but the uapi header defines
parallel values and userspace uses these parallel values for ioctls;
thus the userspace values are definitive.

Define UPIO_* iotypes in terms of the uapi defines, SERIAL_IO_*;
extend the uapi defines to include all values in use by the serial
core.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial: core: Fix iotype userspace breakage
Peter Hurley [Sun, 1 Mar 2015 15:18:16 +0000 (10:18 -0500)]
serial: core: Fix iotype userspace breakage

commit 3ffb1a8193bea ("serial: core: Add big-endian iotype")
re-numbered userspace-dependent values; ioctl(TIOCSSERIAL) can
assign the port iotype (which is expected to match the selected
i/o accessors), so iotype values must not be changed.

Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: <stable@vger.kernel.org> # 3.19+
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Reviewed-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial: sprd: Fix missing spin_unlock in sprd_handle_irq()
Axel Lin [Mon, 16 Feb 2015 14:39:04 +0000 (22:39 +0800)]
serial: sprd: Fix missing spin_unlock in sprd_handle_irq()

Fix return from sprd_handle_irq() with spin_lock held.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoconsole: Fix console name size mismatch
Peter Hurley [Sun, 1 Mar 2015 15:11:05 +0000 (10:11 -0500)]
console: Fix console name size mismatch

commit 6ae9200f2cab7 ("enlarge console.name") increased the storage
for the console name to 16 bytes, but not the corresponding
struct console_cmdline::name storage. Console names longer than
8 bytes cause read beyond end-of-string and failure to match
console; I'm not sure if there are other unexpected consequences.

Cc: <stable@vger.kernel.org> # 2.6.22+
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agotty: fix up atime/mtime mess, take four
Jiri Slaby [Fri, 27 Feb 2015 17:40:31 +0000 (18:40 +0100)]
tty: fix up atime/mtime mess, take four

This problem was taken care of three times already in
b0de59b5733d18b0d1974a060860a8b5c1b36a2e (TTY: do not update
  atime/mtime on read/write),
37b7f3c76595e23257f61bd80b223de8658617ee (TTY: fix atime/mtime
  regression), and
b0b885657b6c8ef63a46bc9299b2a7715d19acde (tty: fix up atime/mtime
  mess, take three)

But it still misses one point. As John Paul correctly points out, we
do not care about setting date. If somebody ever changes wall
time backwards (by mistake for example), tty timestamps are never
updated until the original wall time passes.

So check the absolute difference of times and if it large than "8
seconds or so", always update the time. That means we will update
immediatelly when changing time. Ergo, CAP_SYS_TIME can foul the
check, but it was always that way.

Thanks John for serving me this so nicely debugged.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: John Paul Perry <john_paul.perry@alcatel-lucent.com>
Cc: <stable@vger.kernel.org> # all, as b0b885657 was backported
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial: 8250_dw: Fix get_mctrl behaviour
Desmond Liu [Fri, 27 Feb 2015 00:35:57 +0000 (16:35 -0800)]
serial: 8250_dw: Fix get_mctrl behaviour

Fixed behaviour of get_mctrl() serial driver function as documented in:
https://www.kernel.org/doc/Documentation/serial/driver

Added device-tree properties 'dcd-override', 'dsr-override',
'cts-override', and 'ri-override' specific to the Synopsis 8250
DesignWare UART driver. Allows one to force Data Carrier Detect,
Clear To Send, and Data Set Ready signals to permanently be reported as
active. The Ring indicator can be forced to be reported as inactive.

It is possible that if modem control signalling is enabled on a port
that doesn't have these pins (e.g. - a simple two wire Tx/Rx port), the
driver can hang indefinitely waiting for the state to change. The new
DT properties allow the driver to ignore the state of these pins on
serial ports that don't support them, as recommended in the kernel
documentation.

Reviewed-by: JD (Jiandong) Zheng <jdzheng@broadcom.com>
Signed-off-by: Jonathan Richardson <jonathar@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial:8250:8250_pci: delete unneeded quirk entries
Wang YanQing [Fri, 6 Mar 2015 17:08:35 +0000 (01:08 +0800)]
serial:8250:8250_pci: delete unneeded quirk entries

These quirk entries have the same effect as default
quirk entry, so we can just delete them.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial:8250:8250_pci: fix redundant entry report for WCH_CH352_2S
Wang YanQing [Fri, 6 Mar 2015 17:13:03 +0000 (01:13 +0800)]
serial:8250:8250_pci: fix redundant entry report for WCH_CH352_2S

Commit 8b5c913f7ee6464849570bacb6bcd9ef0eaf7dce
("serial: 8250_pci: Add WCH CH352 quirk to avoid Xscale detection")
trigger one redundant entry report message.

This patch fix it.

Reported-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoChange email address for 8250_pci
Russell King [Fri, 6 Mar 2015 10:49:21 +0000 (10:49 +0000)]
Change email address for 8250_pci

I'm still receiving reports to my email address, so let's point this
at the linux-serial mailing list instead.

Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoserial: 8250: Revert "tty: serial: 8250_core: read only RX if there is something...
Sebastian Andrzej Siewior [Sun, 15 Feb 2015 17:32:16 +0000 (18:32 +0100)]
serial: 8250: Revert "tty: serial: 8250_core: read only RX if there is something in the FIFO"

This reverts commit 0aa525d11859c1a4d5b78fdc704148e2ae03ae13.

The conditional RX-FIFO read seems to cause spurious interrupts and we
see just:
|serial8250: too much work for irq29

The previous behaviour was "default" for decades and Marvell's 88f6282 SoC
might not be the only that relies on it. Therefore the Omap fix is
reverted for now.

Fixes: 0aa525d11859 ("tty: serial: 8250_core: read only RX if there is
something in the FIFO")
Reported-By: Nicolas Schichan <nschichan@freebox.fr>
Debuged-By: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoRevert "tty/serial: of_serial: add DT alias ID handling"
Baruch Siach [Mon, 16 Feb 2015 06:27:49 +0000 (08:27 +0200)]
Revert "tty/serial: of_serial: add DT alias ID handling"

This reverts commit 6d01bb9dc82a60580f749062a48cb47cd5caca07.

The exact same code was added in commit 3239fd31d4 (serial: of-serial: fetch
line number from DT) a few lined above. Doing this once should be enough.

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sat, 7 Mar 2015 00:54:22 +0000 (16:54 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Radeon, imx, msm, and i915 fixes.

  The msm, imx and i915 ones are fairly run of the mill.

  Radeon had some DP audio and posting reads for irq fixes, along with a
  fix for 32-bit kernels with new cards, we were using unsigned long to
  represent GPU side memory space, but since that changed size on 32 vs
  64 cards with lots of VRAM failed, so the change has no effect on
  x86-64, just moves to using uint64_t instead"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (35 commits)
  drm/msm: kexec fixes
  drm/msm/mdp5: fix cursor blending
  drm/msm/mdp5: fix cursor ROI
  drm/msm/atomic: Don't leak atomic commit object when commit fails
  drm/msm/mdp5: Avoid flushing registers when CRTC is disabled
  drm/msm: update generated headers (add 6th lm.base entry)
  drm/msm/mdp5: fixup "drm/msm: fix fallout of atomic dpms changes"
  drm/ttm: device address space != CPU address space
  drm/mm: Support 4 GiB and larger ranges
  drm/i915: gen4: work around hang during hibernation
  drm/i915: Check for driver readyness before handling an underrun interrupt
  drm/radeon: fix interlaced modes on DCE8
  drm/radeon: fix DRM_IOCTL_RADEON_CS oops
  drm/radeon: do a posting read in cik_set_irq
  drm/radeon: do a posting read in si_set_irq
  drm/radeon: do a posting read in evergreen_set_irq
  drm/radeon: do a posting read in r600_set_irq
  drm/radeon: do a posting read in rs600_set_irq
  drm/radeon: do a posting read in r100_set_irq
  radeon/audio: fix DP audio on DCE6
  ...

9 years agoi2c: imx: add required clocks property to binding
Matt Porter [Tue, 3 Mar 2015 16:57:08 +0000 (11:57 -0500)]
i2c: imx: add required clocks property to binding

A clock specifier is required for i.MX I2C and is
provided in all DTS implementations. Add this to the
list of required properties in the binding.

Signed-off-by: Matt Porter <mporter@konsulko.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
9 years agoi2c: designware-baytrail: baytrail_i2c_acquire() might sleep
Andy Shevchenko [Tue, 10 Feb 2015 17:06:10 +0000 (19:06 +0200)]
i2c: designware-baytrail: baytrail_i2c_acquire() might sleep

This patch marks baytrail_i2c_acquire() that it might sleep. Also it chages
while-loop to do-while and, though it is matter of taste, gives a chance to
check one more time before report a timeout.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
9 years agoi2c: designware-baytrail: cross-check lock functions
Andy Shevchenko [Tue, 10 Feb 2015 17:06:09 +0000 (19:06 +0200)]
i2c: designware-baytrail: cross-check lock functions

It seems the idea behind the cross-check is to prevent acquire semaphore when
there is no release callback and vice versa. Thus, patch fixes a typo.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
9 years agoi2c: designware-baytrail: fix sparse warnings
Andy Shevchenko [Tue, 10 Feb 2015 17:06:08 +0000 (19:06 +0200)]
i2c: designware-baytrail: fix sparse warnings

There is no need to export functions that are used as the callbacks in the
struct dw_i2c_dev. Otherwise we get the following warnings:

drivers/i2c/busses/i2c-designware-baytrail.c:63:5: warning: symbol 'baytrail_i2c_acquire' was not declared. Should it be static?
drivers/i2c/busses/i2c-designware-baytrail.c:114:6: warning: symbol 'baytrail_i2c_release' was not declared. Should it be static?

While here, do few indentation fixes, remove i2c_dw_eval_lock_support() from
functions exported to the modules and redundant assignment of local sem
variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
9 years agoi2c: designware-baytrail: fix typo in error path
Andy Shevchenko [Tue, 10 Feb 2015 17:06:07 +0000 (19:06 +0200)]
i2c: designware-baytrail: fix typo in error path

It seems we have same message for different return values in get_sem() and
baytrail_i2c_acquire(). I suspect this is just a typo, so this patch fixes it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
9 years agoi2c: designware-baytrail: describe magic numbers
Andy Shevchenko [Tue, 10 Feb 2015 17:06:06 +0000 (19:06 +0200)]
i2c: designware-baytrail: describe magic numbers

The patch converts hardcoded numerical constants to a named ones.

While here, align the variable name in get_sem() and reset_semaphore().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>