platform/adaptation/renesas_rcar/renesas_kernel.git
9 years agoASoC: rsnd: Get correct SCU ID
Kuninori Morimoto [Tue, 4 Mar 2014 04:50:00 +0000 (20:50 -0800)]
ASoC: rsnd: Get correct SCU ID

Current rsnd driver is assuming that SCU/SRU ID is
same as SSIU/SSI ID, because Gen1 can't select it.
But, Gen2 can select it.
The SCU/SRU/SSIU/SSI pair depends on the platform.
This patch get correct SCU ID from platform info.
To keep compatible, it still assuming SCU ID = SSI ID
if platform doesn't have info

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 389933d9f6e55a1ef3a71549c36f6283b9f8c145)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add struct rsnd_dai_platform_info
Kuninori Morimoto [Tue, 4 Mar 2014 04:49:50 +0000 (20:49 -0800)]
ASoC: rsnd: add struct rsnd_dai_platform_info

R-Car sound DAI consists from SSI/SCU/SSIU/SRU...
Current R-Car sound DAI is decided from these settings,
but it is intuitively unclear, and is not good design for DT support.
This patch adds new rsnd_dai_platform_info to solve this issue.

But now, many platform is using this driver without
rsnd_dai_platform_info.
So, this patch still supports DAI settings via SSI to keep compatible.
It will be removed in next Linux version.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 78f13d0c5a2888564b2bed7f8433c8ec889997ff)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: share reg_field and reduce memory
Kuninori Morimoto [Mon, 3 Mar 2014 07:43:40 +0000 (23:43 -0800)]
ASoC: rsnd: share reg_field and reduce memory

Gen1/Gen2 code never be used in same time.
Thus, driver can share Gen1 only register and Gen2 only register.
It can reduce memory too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c82e1c8874e5abaf52f9ed886386cbe08ec98a5b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: modify rsnd_adg_ssi_ws_timing_gen2() parameter
Kuninori Morimoto [Mon, 3 Mar 2014 07:43:33 +0000 (23:43 -0800)]
ASoC: rsnd: modify rsnd_adg_ssi_ws_timing_gen2() parameter

rsnd_adg_ssi_ws_timing_gen2() returns SSI WS timing,
and it used "mod" as parameter.
but, this "mod" is sometimes not ssi mod.
Get SSI mod from rsnd_dai_stream

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8467dedc9dae3630a2ede49a43120af3ed54ba19)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove unused SSI_CONTROL
Kuninori Morimoto [Mon, 3 Mar 2014 07:43:26 +0000 (23:43 -0800)]
ASoC: rsnd: remove unused SSI_CONTROL

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 685fb3eb31445bd872ab30ae301404b2cac7cd75)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: use function pointer for each probe
Kuninori Morimoto [Mon, 3 Mar 2014 07:43:18 +0000 (23:43 -0800)]
ASoC: rsnd: use function pointer for each probe

R-Car sound consists of many devices.
It will have more device support in the future.
Thus, for each probe become now function pointer array.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d1ac970f5de94bef9e094b46f016899d04e8178b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: use devm_clk_get() instead of clk_get()
Kuninori Morimoto [Mon, 3 Mar 2014 07:43:11 +0000 (23:43 -0800)]
ASoC: rsnd: use devm_clk_get() instead of clk_get()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 468be93eb4e28c5710ed8acc1b938937707e537c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: get ssi/scu from rsnd_dai_stream
Kuninori Morimoto [Mon, 3 Mar 2014 07:43:03 +0000 (23:43 -0800)]
ASoC: rsnd: get ssi/scu from rsnd_dai_stream

Current driver is assuming that SSI id = SCU id.
But, now, it can get correct SSI/SCU from
rsnd_dai_stream. use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 374e5426377604a94d672650ef22dd2b4285de17)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: use mod array instead of list on rdai
Kuninori Morimoto [Mon, 3 Mar 2014 07:42:55 +0000 (23:42 -0800)]
ASoC: rsnd: use mod array instead of list on rdai

struct rsnd_dai_stream used list for mod list.
It added only odd flexibility to current driver, and
it is a factor which makes extendibility difficult.
rsnd use mod array instead of list from now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a126021d144bae88a563db2b57b0ad5eb1ee66d9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: run rsnd_path_init() when probe() timing
Kuninori Morimoto [Mon, 3 Mar 2014 07:42:47 +0000 (23:42 -0800)]
ASoC: rsnd: run rsnd_path_init() when probe() timing

Current rsnd SSIU/SSI/SCU/SRU path is set
when playback/capture starts up.
But it is meaningless method, since the path is based
on platform and can be set in probe() timing.
This patch sets the path on probe() timing.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9bfed6cf4fa2cd2c5e80431244348b0c5d933cf5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: tidyup RSND_SSI_xxx flags
Kuninori Morimoto [Tue, 25 Feb 2014 06:15:33 +0000 (22:15 -0800)]
ASoC: rsnd: tidyup RSND_SSI_xxx flags

6f3ab6c1c022e7a4877d38940cd45ae7804a15e2
(ASoC: rsnd: remove pin sync option)
added unused RSND_SSI_CLK_FROM_ADG flag.
It should remove RSND_SSI_SYNC.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 697dce94ed37e0653e5bba593f11e2b14877cd63)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: unify rdai naming
Kuninori Morimoto [Tue, 25 Feb 2014 06:15:18 +0000 (22:15 -0800)]
ASoC: rsnd: unify rdai naming

struct rsnd_dai is called as "rdai",
but its size has been called as "dai_nr".
Unify these as "rdai"

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ecba9e724c5775aebd3a28e831643160c7146e83)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove verbose debug message from scu/ssi
Kuninori Morimoto [Tue, 25 Feb 2014 06:15:07 +0000 (22:15 -0800)]
ASoC: rsnd: remove verbose debug message from scu/ssi

scu/ssi probe() already have more detail debug message.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 98455ed5ddbfbcbcd0adb300c6cb1964ed0a6931)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove verbose function parameter
Kuninori Morimoto [Tue, 25 Feb 2014 06:15:00 +0000 (22:15 -0800)]
ASoC: rsnd: remove verbose function parameter

priv has rcar_snd_info pointer.
having priv and info in same time is verbose.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 5da39cf30454bbf3e92f56935e7d137e5bd2c830)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: move rsnd_mod_call() macro
Kuninori Morimoto [Tue, 25 Feb 2014 06:14:41 +0000 (22:14 -0800)]
ASoC: rsnd: move rsnd_mod_call() macro

core.c is the only user of rsnd_mod_call() macro.
Move it to core.c from rsnd.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d870a91e9d0eae524ac2da7cbdc7e399a71b86c4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: move priv member settings to upper side
Kuninori Morimoto [Tue, 25 Feb 2014 06:14:33 +0000 (22:14 -0800)]
ASoC: rsnd: move priv member settings to upper side

There is no big meaning, but preparation for platform dai support

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 498480731e232d7c9a96a338924b5a275121e091)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: print error if there is SRC settings mismatch
Kuninori Morimoto [Wed, 12 Feb 2014 05:05:26 +0000 (21:05 -0800)]
ASoC: rsnd: print error if there is SRC settings mismatch

rsnd request clock master if SRC is used

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a2070feede404484296aace813b6c518582a3f8e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: set DIV_EN register on rsnd_adg_set_convert_clk_gen2()
Kuninori Morimoto [Wed, 12 Feb 2014 05:04:12 +0000 (21:04 -0800)]
ASoC: rsnd: set DIV_EN register on rsnd_adg_set_convert_clk_gen2()

DIV_EN register enable bit is required when you use Gen2 SRC

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ee2c828d21b2381c813df257235d3c635269e435)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: tidyup original for_each_rsnd_xxx macro
Kuninori Morimoto [Wed, 12 Feb 2014 01:15:51 +0000 (17:15 -0800)]
ASoC: rsnd: tidyup original for_each_rsnd_xxx macro

Current for_each_rsnd_xxx macro will read out-of-array's
memory after last loop operation.
It was not good C language operation, and the binary which was
compiled by (at least) gcc 4.8.1 is broken
This patch tidyup these issues

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 00463c113b6ba6506b4f1ebb9b3c5dd249f8750f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: use device dependency clock
Kuninori Morimoto [Fri, 7 Feb 2014 08:53:06 +0000 (00:53 -0800)]
ASoC: rsnd: use device dependency clock

Current R-Car sound driver is using device
independent audio clock, but it is not good
design for DT support.
This patch adds device dependent clock support.
But, there are some platform which is using
independent audio clock.
It is still supported at this point,
but it will be removed soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8691d0748e566f8708f7a9139e760134f5dc3130)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add Gen2 SRC and DMAEngine support
Kuninori Morimoto [Fri, 24 Jan 2014 02:42:00 +0000 (18:42 -0800)]
ASoC: rsnd: add Gen2 SRC and DMAEngine support

Renesas sound Gen2 has SRC (= Sampling Rate Converter)
which needs 2 DMAC.
The data path image when you use SRC on Gen2 is

[mem] -> Audio-DMAC -> SRC -> Audio-DMAC-peri-peri -> SSIU -> SSI

This patch support SRC and DMAEnine.
It is tested on R-Car H2 Lager board

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 629509c5bc478c0343d94c8c70812396f44447fb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: rsnd_ssi_probe() goes forwarder than rsnd_scu_probe()
Kuninori Morimoto [Fri, 24 Jan 2014 02:41:51 +0000 (18:41 -0800)]
ASoC: rsnd: rsnd_ssi_probe() goes forwarder than rsnd_scu_probe()

rsnd_ssi_probe() goes forwarder than rsnd_scu_probe(),
since scu will need ssi information on Gen2

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit eb854f6dff24a59378acc8d8eda57a3543a25acc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove SSI dependent DMAEngine callback
Kuninori Morimoto [Fri, 24 Jan 2014 02:41:44 +0000 (18:41 -0800)]
ASoC: rsnd: remove SSI dependent DMAEngine callback

Renesas Gen2 sound will use 2 DMAC
which are Audio-DMAC, and Audio-DMAC-peri-peri.
Current driver has callback function for each DMAC,
because it assumed each DMAC needs special settings.
But it became clear that these can share settings.
This patch removes unnecessary callback

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4686a0ad9aaee89495f181e5755d153e7fe7ffe6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: extracts Gen1/Gen2 common parts
Kuninori Morimoto [Fri, 24 Jan 2014 02:41:36 +0000 (18:41 -0800)]
ASoC: rsnd: extracts Gen1/Gen2 common parts

Renesas sound IP Gen1/Gen2 are similar, but different.
This patch extracts Gen1/Gen2 common and dependency parts,
and create Gen1/Gen2 ops to control it.

According to this structure, SSIU setup which
has been implemented on ssi.c can be moved to scu.c
(SRU/SSIU/SCU should be implemented on scu.c)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 1b7b08efbe7419cc3e082f2b5ec8ae89f7af43d1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add rsnd_ssi_is_play()
Kuninori Morimoto [Fri, 24 Jan 2014 02:41:17 +0000 (18:41 -0800)]
ASoC: rsnd: add rsnd_ssi_is_play()

SCU needs SSI direction if Gen2.
Add rsnd_ssi_is_play() function for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 32f27ebf9b625df610c12408ea15bae37be75eaf)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: merge SRC clock timing/setting
Kuninori Morimoto [Fri, 24 Jan 2014 02:41:10 +0000 (18:41 -0800)]
ASoC: rsnd: merge SRC clock timing/setting

SRC clock and timing setting register
exist in SRU and ADG on Gen1.
But, these are merged into ADG on Gen2.
Current driver is supporting Gen1 SRC only
at this point, but, above settings are
set as different function.
This patch merges these as preparation of Gen2 support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 28dc4b63cdb96f2448a677320fcc0eb112e13e3f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: rsnd_scu_hpbif_is_enable() become macro
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:54 +0000 (18:40 -0800)]
ASoC: rsnd: rsnd_scu_hpbif_is_enable() become macro

rsnd_scu_hpbif_is_enable() is used only scu.c now.
It can be local macro

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 96c7c0d6f8c6e09e9123f0518130c047c5de40f6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: Merge macros in scu.c
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:47 +0000 (18:40 -0800)]
ASoC: rsnd: Merge macros in scu.c

Merge #define lines, since these are defined
in the scattering place

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 39cf3c4064b8db25efe501fec8e3c48a578b4b58)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: clarify scu.c area
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:41 +0000 (18:40 -0800)]
ASoC: rsnd: clarify scu.c area

scu.c cares SRU(Gen1) / SCU(Gen2) / SSIU(Gen2)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c926b746055adfd915936c67244e635e9c7a3d84)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: SCU should be called before SSI
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:34 +0000 (18:40 -0800)]
ASoC: rsnd: SCU should be called before SSI

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit be213ac1af893410eb8256010edf136b4099e827)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: don't use schedule_work() when rsnd_dma_start()
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:27 +0000 (18:40 -0800)]
ASoC: rsnd: don't use schedule_work() when rsnd_dma_start()

rsnd_dma_start() is the function to start DMAEngine.
Current code is using schedule_work() for it,
but it breaks DMAC/SSI register setting timing.
Don't use schedule_work() on it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f5cab3b8976d59c6166228874a5af3d87c94c723)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: fixup Gen2 module naming
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:20 +0000 (18:40 -0800)]
ASoC: rsnd: fixup Gen2 module naming

Gen2 has SCU, not SRU

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 64de62b38641dec05905930024133726c540040e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: non 0 is error on probe
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:13 +0000 (18:40 -0800)]
ASoC: rsnd: non 0 is error on probe

Some xxx_probe() returns not only -Exx, but also PTR_ERR().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 106d2eff563b2abdb34872cb8ec7b19766edaffc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove duplicate *priv from rsnd_dma
Kuninori Morimoto [Fri, 24 Jan 2014 02:40:03 +0000 (18:40 -0800)]
ASoC: rsnd: remove duplicate *priv from rsnd_dma

*priv pointer exists under rsnd_mod,
and, it can get rsnd_mod pointer from rsnd_dma.
remove duplicate rsnd_dma :: priv

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 9b5ab573a81b9ac0df90b74d732651fdf8b24525)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: explain SRC bypass mode settings in comment
Kuninori Morimoto [Fri, 24 Jan 2014 02:39:56 +0000 (18:39 -0800)]
ASoC: rsnd: explain SRC bypass mode settings in comment

SRC bypass mode is useful for debugging.
This patch explains SRC bypass mode settings in comment

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 41c6221c39accdc4fe2b0c0fa196b6302b704e57)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: rename rsnd_scu_convert_rate_ctrl()
Kuninori Morimoto [Fri, 24 Jan 2014 02:39:48 +0000 (18:39 -0800)]
ASoC: rsnd: rename rsnd_scu_convert_rate_ctrl()

rsnd_scu_convert_rate_ctrl() is unclear naming,
and there is "rsnd_scu_convert_rate" variable.
These are confusable.
it renamed to rsnd_scu_set_convert_rate()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f80e1c96339a45992b5dded0474288e52bd3b18d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove ssiu from ssi.c
Kuninori Morimoto [Fri, 24 Jan 2014 02:39:40 +0000 (18:39 -0800)]
ASoC: rsnd: remove ssiu from ssi.c

Now, SSI_MODE0/1 are controlled under scu.c
ssiu is no longer needed on ssi.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit dd27d808f9e084e7e9c4719c17f17d1fa35c45a6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: SSI_MODE0/1 settings goes to scu.c
Kuninori Morimoto [Fri, 24 Jan 2014 02:39:32 +0000 (18:39 -0800)]
ASoC: rsnd: SSI_MODE0/1 settings goes to scu.c

SRU (Gen1) / SCU (Gen2) / SSIU (Gen2) are controlled under scu.c.
(SCU + SSIU (Gen2) was SRU (Gen1))
And register of SSI_MODE0/1 are mapped on these IP.
But these have been implemented under ssi.c on this driver.
The naming is very confusable,
but it should be implemented under scu.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 7b5ce9759a60ebdffa1e76224ccb3d85bd06e4ac)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove pin sync option
Kuninori Morimoto [Fri, 24 Jan 2014 02:39:23 +0000 (18:39 -0800)]
ASoC: rsnd: remove pin sync option

Renesas Chip is supporting multi pin sound,
but the HW setting is very difficult and confusable.
But driver is supporting it halfway.
Remove SYNC option at this point.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6f3ab6c1c022e7a4877d38940cd45ae7804a15e2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: rsnd_dai_is_clk_master() can be shared
Kuninori Morimoto [Fri, 24 Jan 2014 02:39:12 +0000 (18:39 -0800)]
ASoC: rsnd: rsnd_dai_is_clk_master() can be shared

Current rsnd driver is using ssi local
rsnd_rdai_is_clk_master() for checking clock master.
But it can be rsnd_dai_is_clk_master(), and share in each file

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e779a20da90b12d17af74fe544fafd814b66dc63)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: merge rsnd_scu_start/stop() and rsnd_scu_transfer_start/stop()
Kuninori Morimoto [Fri, 24 Jan 2014 02:38:50 +0000 (18:38 -0800)]
ASoC: rsnd: merge rsnd_scu_start/stop() and rsnd_scu_transfer_start/stop()

rsnd_scu_transfer_start/stop() are no longer needed.
merge into rsnd_scu_start/stop()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e7ce74eaa76591e5a4905d0fc07a278533447b80)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove meaningless function parameter
Kuninori Morimoto [Fri, 24 Jan 2014 02:38:42 +0000 (18:38 -0800)]
ASoC: rsnd: remove meaningless function parameter

struct rsnd_priv *priv on rsnd_scu_init/start/stop()
are no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 47718dc7d8ca5f5509ac9beb13486642306bb36b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add rsnd_scu_init(), and separate init/start
Kuninori Morimoto [Fri, 24 Jan 2014 02:38:33 +0000 (18:38 -0800)]
ASoC: rsnd: add rsnd_scu_init(), and separate init/start

Current scu.c has rsnd_scu_start(),
and, operation of initialization/start
are implemented in this function.
This patch adds new rsnd_scu_init() and separates
rsnd_scu_start(), since rsnd_mod_ops has .init/.start callbacks.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a204d90c91208d9b63ba309a1c44f582751e58c9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: control SCU ops in probe timing
Kuninori Morimoto [Fri, 24 Jan 2014 02:38:26 +0000 (18:38 -0800)]
ASoC: rsnd: control SCU ops in probe timing

SCU will be used if platform requested to use.
Current driver is checking it in runtime,
but, it can be decided in probe timing.
This patch do it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 013f38fe260af6f505ad5da5f6b0db3e42ca1fbb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove meaningless rsnd_ssi_non()
Kuninori Morimoto [Fri, 24 Jan 2014 02:38:17 +0000 (18:38 -0800)]
ASoC: rsnd: remove meaningless rsnd_ssi_non()

rsnd_ssi_non_ops callback functions are never called.
remove these meaningless callback

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6acef1721c1046be8b5f44b839c28817cfbd66c6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: cleanup debug information method
Kuninori Morimoto [Fri, 24 Jan 2014 02:38:08 +0000 (18:38 -0800)]
ASoC: rsnd: cleanup debug information method

rsnd_mod debug information is implemented
in each callback functions now.
But, it can be implemented in rsnd_mod_call(),
and share this code.
This patch adds it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 92d9587ede108a7e73f80d0767aedf2c4edb47d8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: tidyup register naming of BUSIF_MODE
Kuninori Morimoto [Fri, 24 Jan 2014 02:37:39 +0000 (18:37 -0800)]
ASoC: rsnd: tidyup register naming of BUSIF_MODE

Gen1:SRU has only 1 BUSIF_MODE,
but Gen2:SSIU/SCU has SRCm_BUSIF_MODE, and SSIn_BUSIF_MODE.
This patch rename current BUSIF_MODE to SRC_BUSIF_MODE.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 0290d2a42cb476358303d05fbe2475dd50889907)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agodrm/rcar-du: Handle encoder initialization failures
Laurent Pinchart [Tue, 1 Apr 2014 11:03:52 +0000 (13:03 +0200)]
drm/rcar-du: Handle encoder initialization failures

The rcar_du_encoder_init() function can fail and return an error code.
Don't ignore it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d9961b22716ddf59ca307fe862f93ff0ea919952)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agopinctrl: Quiet logging about missing DT nodes when not using DT
Mark Brown [Thu, 30 Jan 2014 18:57:20 +0000 (18:57 +0000)]
pinctrl: Quiet logging about missing DT nodes when not using DT

On systems which were not booted using DT it is entirely unsurprising that
device nodes don't have any DT information and this is going to happen for
every single device in the system. Make pinctrl be less chatty about this
situation by only logging in the case where we have DT.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 5d88dceac736a779fdf6208bbd0a06e81fe25300)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomtd: m25p80: add Macronix mx66l1g55g 1Gbit SPI flash
Brian Norris [Wed, 29 Jan 2014 21:39:43 +0000 (13:39 -0800)]
mtd: m25p80: add Macronix mx66l1g55g 1Gbit SPI flash

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
(cherry picked from commit 6f7db7f3203a0bd48170807adeb53dd401d29110)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomtd: m25p80: add support for the Spansion s25fl008k chip
Kuninori Morimoto [Tue, 11 Feb 2014 08:51:18 +0000 (09:51 +0100)]
mtd: m25p80: add support for the Spansion s25fl008k chip

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit bec44c45c245b38662f1e61bf0bde95fac1e7fb5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomtd: m25p80: Use positive logic to check JEDEC ID
Axel Lin [Tue, 21 Jan 2014 07:56:34 +0000 (15:56 +0800)]
mtd: m25p80: Use positive logic to check JEDEC ID

For slightly better readability.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit b2fda1296bb8e213a6bad3937326ae98c4c4773c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomtd: delete non-required instances of include <linux/init.h>
Paul Gortmaker [Tue, 21 Jan 2014 21:22:52 +0000 (16:22 -0500)]
mtd: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
[Brian: dropped one incorrect hunk]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit 3ea5b037e750274659648b58fb97426566a90373)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomtd: m25p80: Enable Dual SPI read transfers for s25fl256s1 and s25fl512s
Geert Uytterhoeven [Tue, 21 Jan 2014 12:59:19 +0000 (13:59 +0100)]
mtd: m25p80: Enable Dual SPI read transfers for s25fl256s1 and s25fl512s

Spansion s25fl256s1 and s25fl512s support Dual SPI transfers, hence set the
M25P80_DUAL_READ flag.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit f5e00838e83f6fc93f42c7a01b0c612031955b31)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agomtd: m25p80: Add dual read support
Geert Uytterhoeven [Tue, 21 Jan 2014 12:59:18 +0000 (13:59 +0100)]
mtd: m25p80: Add dual read support

Add support for Dual SPI read transfers, which is supported by some
Spansion SPI FLASHes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit dbbafb74239e8296bc20f86366b3f38e13650900)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agogpio: rcar: Add helper variable dev = &pdev->dev
Geert Uytterhoeven [Thu, 27 Mar 2014 20:47:36 +0000 (21:47 +0100)]
gpio: rcar: Add helper variable dev = &pdev->dev

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-gpio@vger.kernel.org
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit b22978fc33dec72e5f8e17f90eb63ea9137aafd5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclk: shmobile: clk-mstp: change to using clock-indices
Ben Dooks [Tue, 15 Apr 2014 16:06:34 +0000 (17:06 +0100)]
clk: shmobile: clk-mstp: change to using clock-indices

With the addition of clock-indices, we need to change the renesas
clock implementation to use these instead of the local definition
of "renesas,clock-indices".

Since this will break booting with older device trees, we add a
simple auto-detection of which properties are present.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
(cherry picked from commit 8e33f91a0b84ae1964bef77cb92f5d41d97530c8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclk: shmobile: fix setting paretn clock rate
Ben Dooks [Mon, 31 Mar 2014 17:47:27 +0000 (18:47 +0100)]
clk: shmobile: fix setting paretn clock rate

If the driver needs to change a clock rate, then it must be propogated
through the MSTP clock to the parent clock (such as shdi0 -> sd0). Without
this we cannot up-rate default clocks which are really slow (such as the
mmcif1 which defaults to 12MHz where it could be running at 97MHz)

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
(cherry picked from commit e44df332f30bf3040c60c1ed6674d1431fdb48b9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclk: shmobile: rcar-gen2: fix lb/sd0/sd1/sdh clock parent to pll1
Ben Dooks [Mon, 31 Mar 2014 14:50:34 +0000 (15:50 +0100)]
clk: shmobile: rcar-gen2: fix lb/sd0/sd1/sdh clock parent to pll1

The clock generator for rcar-gen2 has the lb, sdh, sd0 and sd1 clocks
parented to pll1_div2 where the hardware diagram shows these to be
directly fed from pll1.

This fixes the initial rate for sdh0 clock to be 97.5MHz instead of
the reported 48MHz where the manual says the default register values
are for 97.5MHz.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
(cherry picked from commit 365b01869bca1c9d5ecb05be7857739fa18a9b8c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclk: shmobile: add CPG driver for rz-platforms
Wolfram Sang [Fri, 7 Mar 2014 16:00:37 +0000 (17:00 +0100)]
clk: shmobile: add CPG driver for rz-platforms

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
(cherry picked from commit a665962e8f4484647e7a19b4d6329d42ed8bc804)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoclk: shmobile: div6: use proper description in kernel doc
Wolfram Sang [Mon, 24 Feb 2014 19:57:11 +0000 (20:57 +0100)]
clk: shmobile: div6: use proper description in kernel doc

These variable clocks have nothing to do with MSTP gating, probably a
copy&paste leftover.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
(cherry picked from commit 95aa4f9b5fe577de902aa780e91140c6e89c73a2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: wait for MSTP clock status to toggle, when enabling it
Guennadi Liakhovetski [Sat, 14 Dec 2013 15:23:51 +0000 (16:23 +0100)]
ARM: shmobile: wait for MSTP clock status to toggle, when enabling it

On r-/sh-mobile SoCs MSTP clocks are used by the runtime PM to dynamically
enable and disable peripheral clocks. To make sure the clock has really
started we have to read back its status register until it confirms success.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit a028c6da34d434e35ba8322568c756ea97ff3c18)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agov4l: vsp1: Update copyright notice
Laurent Pinchart [Thu, 6 Feb 2014 17:42:31 +0000 (14:42 -0300)]
v4l: vsp1: Update copyright notice

The "Renesas Corporation" listed in the copyright notice doesn't exist.
Replace it with "Renesas Electronics Corporation" and update the
copyright years.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 8a1edc55c1ec1ff3624c25b4ac6c1ce776d872b8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoktap-0.4
Li xin [Fri, 17 Oct 2014 12:06:28 +0000 (15:06 +0300)]
ktap-0.4

9 years agoLTTng 2.3.4 release
Mathieu Desnoyers [Mon, 9 Dec 2013 20:34:09 +0000 (12:34 -0800)]
LTTng 2.3.4 release

This was taken from the git://git.lttng.org/lttng-modules.git stable-2.3
branch, and turned into a patch for the 3.10.y kernel by Greg.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoLTSI Makefile addition
Greg Kroah-Hartman [Mon, 13 Feb 2012 07:09:28 +0000 (23:09 -0800)]
LTSI Makefile addition

Change the extra version to have -ltsi to have a chance to realize what
kernel version we are using.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoLinux 3.14.24
Greg Kroah-Hartman [Fri, 14 Nov 2014 17:10:29 +0000 (09:10 -0800)]
Linux 3.14.24

9 years agomm: page_alloc: fix zone allocation fairness on UP
Johannes Weiner [Thu, 2 Oct 2014 23:21:10 +0000 (16:21 -0700)]
mm: page_alloc: fix zone allocation fairness on UP

commit abe5f972912d086c080be4bde67750630b6fb38b upstream.

The zone allocation batches can easily underflow due to higher-order
allocations or spills to remote nodes.  On SMP that's fine, because
underflows are expected from concurrency and dealt with by returning 0.
But on UP, zone_page_state will just return a wrapped unsigned long,
which will get past the <= 0 check and then consider the zone eligible
until its watermarks are hit.

Commit 3a025760fc15 ("mm: page_alloc: spill to remote nodes before
waking kswapd") already made the counter-resetting use
atomic_long_read() to accomodate underflows from remote spills, but it
didn't go all the way with it.

Make it clear that these batches are expected to go negative regardless
of concurrency, and use atomic_long_read() everywhere.

Fixes: 81c0a2bb515f ("mm: page_alloc: fair zone allocator policy")
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: <stable@vger.kernel.org> [3.12+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 agoregulator: max77693: Fix use of uninitialized regulator config
Krzysztof Kozlowski [Mon, 3 Nov 2014 14:07:05 +0000 (15:07 +0100)]
regulator: max77693: Fix use of uninitialized regulator config

commit ca0c37a0b489bb14bf3e1549e7a8d0c9a17f4919 upstream.

Driver allocated on stack struct regulator_config but didn't initialize
it fully. Few fields (driver_data, ena_gpio) were left untouched. This
lead to using random ena_gpio values as GPIOs for max77693 regulators.

On occasion these values could match real GPIO numbers leading to
interfering with other drivers and to unsuccessful enable/disable of
regulator.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 80b022e29bfd ("regulator: max77693: Add max77693 regualtor driver.")
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agopowerpc: use device_online/offline() instead of cpu_up/down()
Dan Streetman [Fri, 31 Oct 2014 19:41:34 +0000 (15:41 -0400)]
powerpc: use device_online/offline() instead of cpu_up/down()

commit 10ccaf178b2b961d8bca252d647ed7ed8aae2a20 upstream.

In powerpc pseries platform dlpar operations, use device_online() and
device_offline() instead of cpu_up() and cpu_down().

Calling cpu_up/down() directly does not update the cpu device offline
field, which is used to online/offline a cpu from sysfs. Calling
device_online/offline() instead keeps the sysfs cpu online value
correct. The hotplug lock, which is required to be held when calling
device_online/offline(), is already held when dlpar_online/offline_cpu()
are called, since they are called only from cpu_probe|release_store().

This patch fixes errors on phyp (PowerVM) systems that have cpu(s)
added/removed using dlpar operations; without this patch, the
/sys/devices/system/cpu/cpuN/online nodes do not correctly show the
online state of added/removed cpus.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Fixes: 0902a9044fa5 ("Driver core: Use generic offline/online for CPU offline/online")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agopinctrl: baytrail: show output gpio state correctly on Intel Baytrail
David Cohen [Tue, 14 Oct 2014 17:54:37 +0000 (10:54 -0700)]
pinctrl: baytrail: show output gpio state correctly on Intel Baytrail

commit d90c33818967c5e5371961604ad98b4dea4fa3f4 upstream.

Even if a gpio pin is set to output, we still need to set INPUT_EN
functionality (by clearing INPUT_EN bit) to be able to read the pin's
level.

E.g. without this change, we'll always read low level state from sysfs.

Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
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 agodrm/radeon/dpm: disable ulv support on SI
Alex Deucher [Mon, 13 Oct 2014 16:44:49 +0000 (12:44 -0400)]
drm/radeon/dpm: disable ulv support on SI

commit 6fa455935ab956248b165f150ec6ae9106210077 upstream.

Causes problems on some boards.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=82889

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size.
Sinclair Yeh [Fri, 31 Oct 2014 08:58:06 +0000 (09:58 +0100)]
drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size.

commit 9a72384d86b26cb8a2b25106677e1197f606668f upstream.

When screen objects are enabled, the bpp is assumed to be 32, otherwise
it is set to 16.

v2:
* Use u32 instead of u64 for assumed_bpp.
* Fixed mechanism to check for screen objects
* Limit the back buffer size to VRAM.

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agosched: Use rq->rd in sched_setaffinity() under RCU read lock
Kirill Tkhai [Mon, 22 Sep 2014 18:36:36 +0000 (22:36 +0400)]
sched: Use rq->rd in sched_setaffinity() under RCU read lock

commit f1e3a0932f3a9554371792a7daaf1e0eb19f66d5 upstream.

Probability of use-after-free isn't zero in this place.

Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140922183636.11015.83611.stgit@localhost
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agousb: gadget: f_fs: remove redundant ffs_data_get()
Robert Baldyga [Mon, 10 Nov 2014 15:19:57 +0000 (09:19 -0600)]
usb: gadget: f_fs: remove redundant ffs_data_get()

[ Upstream commit a3058a5d82e296daaca07411c3738a9ddd79f302 ]

During FunctionFS bind, ffs_data_get() function was called twice
(in functionfs_bind() and in ffs_do_functionfs_bind()), while on unbind
ffs_data_put() was called once (in functionfs_unbind() function).
In result refcount never reached value 0, and ffs memory resources has
been never released.

Since ffs_data_get() call in ffs_do_functionfs_bind() is redundant
and not neccessary, we remove it to have equal number of gets ans puts,
and free allocated memory after refcount reach 0.

Fixes: 5920cda (usb: gadget: FunctionFS: convert to new function
interface with backward compatibility)
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.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 agoxfs: avoid false quotacheck after unclean shutdown
Eric Sandeen [Mon, 4 Aug 2014 01:35:44 +0000 (11:35 +1000)]
xfs: avoid false quotacheck after unclean shutdown

commit 5ef828c4152726f56751c78ea844f08d2b2a4fa3 upstream.

The commit

83e782e xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD

added a new function xfs_sb_quota_from_disk() which swaps
on-disk XFS_OQUOTA_* flags for in-core XFS_GQUOTA_* and XFS_PQUOTA_*
flags after the superblock is read.

However, if log recovery is required, the superblock is read again,
and the modified in-core flags are re-read from disk, so we have
XFS_OQUOTA_* flags in memory again.  This causes the
XFS_QM_NEED_QUOTACHECK() test to be true, because the XFS_OQUOTA_CHKD
is still set, and not XFS_GQUOTA_CHKD or XFS_PQUOTA_CHKD.

Change xfs_sb_from_disk to call xfs_sb_quota_from disk and always
convert the disk flags to in-memory flags.

Add a lower-level function which can be called with "false" to
not convert the flags, so that the sb verifier can verify
exactly what was on disk, per Brian Foster's suggestion.

Reported-by: Cyril B. <cbay@excellency.fr>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Cc: Arkadiusz Miƛkiewicz <arekm@maven.pl>
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 agoPCI: Rename sysfs 'enabled' file back to 'enable'
Greg Kroah-Hartman [Thu, 30 Oct 2014 16:30:28 +0000 (09:30 -0700)]
PCI: Rename sysfs 'enabled' file back to 'enable'

commit d8e7d53a2fc14e0830ab728cb84ee19933d3ac8d upstream.

Back in commit 5136b2da770d ("PCI: convert bus code to use dev_groups"),
I misstyped the 'enable' sysfs filename as 'enabled', which broke the
userspace API.  This patch fixes that issue by renaming the file back.

Fixes: 5136b2da770d ("PCI: convert bus code to use dev_groups")
Reported-by: Jeff Epler <jepler@unpythonic.net>
Tested-by: Jeff Epler <jepler@unpythonic.net> # on v3.14-rt
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
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 agoRevert "iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate"
Emmanuel Grumbach [Mon, 20 Oct 2014 05:29:55 +0000 (08:29 +0300)]
Revert "iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate"

commit 1ffde699aae127e7abdb98dbdedc2cc6a973a1a1 upstream.

This reverts commit aa11bbf3df026d6b1c6b528bef634fd9de7c2619.
This commit was causing connection issues and is not needed
if IWL_MVM_RS_RSSI_BASED_INIT_RATE is set to false by default.

Regardless of the issues mentioned above, this patch added the
following WARNING:

WARNING: CPU: 0 PID: 3946 at drivers/net/wireless/iwlwifi/mvm/tx.c:190 iwl_mvm_set_tx_params+0x60a/0x6f0 [iwlmvm]()
Got an HT rate for a non data frame 0x8
CPU: 0 PID: 3946 Comm: wpa_supplicant Tainted: G           O   3.17.0+ #6
Hardware name: LENOVO 20ANCTO1WW/20ANCTO1WW, BIOS GLET71WW (2.25 ) 07/02/2014
 0000000000000009 ffffffff814fa911 ffff8804288db8f8 ffffffff81064f52
 0000000000001808 ffff8804288db948 ffff88040add8660 ffff8804291b5600
 0000000000000000 ffffffff81064fb7 ffffffffa07b73d0 0000000000000020
Call Trace:
 [<ffffffff814fa911>] ? dump_stack+0x41/0x51
 [<ffffffff81064f52>] ? warn_slowpath_common+0x72/0x90
 [<ffffffff81064fb7>] ? warn_slowpath_fmt+0x47/0x50
 [<ffffffffa07a39ea>] ? iwl_mvm_set_tx_params+0x60a/0x6f0 [iwlmvm]
 [<ffffffffa07a3cf8>] ? iwl_mvm_tx_skb+0x48/0x3c0 [iwlmvm]
 [<ffffffffa079cb9b>] ? iwl_mvm_mac_tx+0x7b/0x180 [iwlmvm]
 [<ffffffffa0746ce9>] ? __ieee80211_tx+0x2b9/0x3c0 [mac80211]
 [<ffffffffa07492f3>] ? ieee80211_tx+0xb3/0x100 [mac80211]
 [<ffffffffa0749c49>] ? ieee80211_subif_start_xmit+0x459/0xca0 [mac80211]
 [<ffffffff814116e7>] ? dev_hard_start_xmit+0x337/0x5f0
 [<ffffffff81430d46>] ? sch_direct_xmit+0x96/0x1f0
 [<ffffffff81411ba3>] ? __dev_queue_xmit+0x203/0x4f0
 [<ffffffff8142f670>] ? ether_setup+0x70/0x70
 [<ffffffff814e96a1>] ? packet_sendmsg+0xf81/0x1110
 [<ffffffff8140625c>] ? skb_free_datagram+0xc/0x40
 [<ffffffff813f7538>] ? sock_sendmsg+0x88/0xc0
 [<ffffffff813f7274>] ? move_addr_to_kernel.part.20+0x14/0x60
 [<ffffffff811c47c2>] ? __inode_wait_for_writeback+0x62/0xb0
 [<ffffffff813f7a91>] ? SYSC_sendto+0xf1/0x180
 [<ffffffff813f88f9>] ? __sys_recvmsg+0x39/0x70
 [<ffffffff8150066d>] ? system_call_fastpath+0x1a/0x1f
---[ end trace cc19a150d311fc63 ]---

which was reported here: https://bugzilla.kernel.org/show_bug.cgi?id=85691

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
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>
9 years agocpc925_edac: Report UE events properly
Jason Baron [Wed, 15 Oct 2014 20:47:28 +0000 (20:47 +0000)]
cpc925_edac: Report UE events properly

commit fa19ac4b92bc2b5024af3e868f41f81fa738567a upstream.

Fix UE event being reported as HW_EVENT_ERR_CORRECTED.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Link: http://lkml.kernel.org/r/8beb13803500076fef827eab33d523e355d83759.1413405053.git.jbaron@akamai.com
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoe7xxx_edac: Report CE events properly
Jason Baron [Sat, 18 Oct 2014 14:06:32 +0000 (16:06 +0200)]
e7xxx_edac: Report CE events properly

commit 8030122a9ccf939186f8db96c318dbb99b5463f6 upstream.

Fix CE event being reported as HW_EVENT_ERR_UNCORRECTED.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Link: http://lkml.kernel.org/r/e6dd616f2cd51583a7e77af6f639b86313c74144.1413405053.git.jbaron@akamai.com
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>