profile/common/kernel-common.git
7 years agoProvide a common name for all Tizen kernels 76/112276/2 accepted/tizen_4.0_unified accepted/tizen_common accepted/tizen_unified tizen tizen_4.0 accepted/tizen/4.0/unified/20170816.020221 accepted/tizen/4.0/unified/20170828.222124 accepted/tizen/common/20170215.170957 accepted/tizen/unified/20170310.112627 submit/tizen/20170215.072852 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100008 submit/tizen_4.0_unified/20170814.115522 submit/tizen_unified/20170310.112216 tizen_4.0.m1_release
MyungJoo Ham [Tue, 31 Jan 2017 02:24:48 +0000 (11:24 +0900)]
Provide a common name for all Tizen kernels

So that TIC (Tizen Image Creator) can recognize whether
a kernel is included in the target image or not.

Change-Id: Idb2594f5117fc0bed6c93d86a0b687a69addc611
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
7 years agoMerge "kernel: use the gnu89 standard explicitly" into tizen accepted/tizen/common/20170206.124437 submit/tizen/20170206.105247
Maciej Wereski [Mon, 6 Feb 2017 10:48:12 +0000 (02:48 -0800)]
Merge "kernel: use the gnu89 standard explicitly" into tizen

7 years agoMerge "perf pmu: Fix misleadingly indented assignment (whitespace)" into tizen
Maciej Wereski [Mon, 6 Feb 2017 10:48:07 +0000 (02:48 -0800)]
Merge "perf pmu: Fix misleadingly indented assignment (whitespace)" into tizen

7 years agoMerge "x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id"" into...
Maciej Wereski [Mon, 6 Feb 2017 10:48:02 +0000 (02:48 -0800)]
Merge "x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id"" into tizen

7 years agoMerge "kbuild: move -Wunused-const-variable to W=1 warning level" into tizen
Maciej Wereski [Mon, 6 Feb 2017 10:47:56 +0000 (02:47 -0800)]
Merge "kbuild: move -Wunused-const-variable to W=1 warning level" into tizen

7 years agoMerge "Input: sentelic - use "static inline" instead of "inline"" into tizen
Maciej Wereski [Mon, 6 Feb 2017 10:47:51 +0000 (02:47 -0800)]
Merge "Input: sentelic - use "static inline" instead of "inline"" into tizen

7 years agoMerge "Input: lifebook - use "static inline" instead of "inline" in lifebook.h" into...
Maciej Wereski [Mon, 6 Feb 2017 10:47:38 +0000 (02:47 -0800)]
Merge "Input: lifebook - use "static inline" instead of "inline" in lifebook.h" into tizen

7 years agoperf: disabled '-Werror' to fix build error 12/112512/1
Dongkyun, Son [Tue, 31 Jan 2017 08:50:08 +0000 (17:50 +0900)]
perf: disabled '-Werror' to fix build error

error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
error: 'S_croak_memory_wrap' defined but not used [-Werror=unused-function]

Change-Id: If70d75dd3e3a7d637f91b687a6011aad8f4a80a7
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
7 years agokernel: use the gnu89 standard explicitly 45/112145/1
Kirill A. Shutemov [Mon, 20 Oct 2014 09:23:12 +0000 (12:23 +0300)]
kernel: use the gnu89 standard explicitly

commit 51b97e354ba9fce1890cf38ecc754aa49677fc89 upstream.

Sasha Levin reports:
 "gcc5 changes the default standard to c11, which makes kernel build
  unhappy

  Explicitly define the kernel standard to be gnu89 which should keep
  everything working exactly like it was before gcc5"

There are multiple small issues with the new default, but the biggest
issue seems to be that the old - and very useful - GNU extension to
allow a cast in front of an initializer has gone away.

Patch updated by Kirill:
 "I'm pretty sure all gcc versions you can build kernel with supports
  -std=gnu89.  cc-option is redunrant.

  We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"

Note by Andrew Pinski:
 "Yes it was reported and both problems relating to this extension has
  been added to gnu99 and gnu11.  Though there are other issues with the
  kernel dealing with extern inline have different semantics between
  gnu89 and gnu99/11"

End result: we may be able to move up to a newer stdc model eventually,
but right now the newer models have some annoying deficiencies, so the
traditional "gnu89" model ends up being the preferred one.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I66ec0eb5c9217f4a1068a3ceb7ecbb0db2d8ee69

7 years agoperf pmu: Fix misleadingly indented assignment (whitespace) 41/112141/1
Markus Trippelsdorf [Mon, 14 Dec 2015 15:44:40 +0000 (16:44 +0100)]
perf pmu: Fix misleadingly indented assignment (whitespace)

One line in perf_pmu__parse_unit() is indented wrongly, leading to a
warning (=> error) from gcc 6:

  util/pmu.c:156:3: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]

    sret = read(fd, alias->unit, UNIT_MAX_LEN);
    ^~~~

  util/pmu.c:153:2: note: ...this 'if' clause, but it is not
    if (fd == -1)
    ^~

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 410136f5dd96 ("tools/perf/stat: Add event unit and scale support")
Link: http://lkml.kernel.org/r/20151214154440.GC1409@x4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Change-Id: Ibc41cc944b70fb9e7b24cf06e2152fdee48fadf8

7 years agox86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id" 34/112134/1
Behan Webster [Thu, 13 Feb 2014 20:21:48 +0000 (12:21 -0800)]
x86: LLVMLinux: Fix "incomplete type const struct x86cpu_device_id"

commit c4586256f0c440bc2bdb29d2cbb915f0ca785d26 upstream.

Similar to the fix in 40413dcb7b273bda681dca38e6ff0bbb3728ef11

MODULE_DEVICE_TABLE(x86cpu, ...) expects the struct to be called struct
x86cpu_device_id, and not struct x86_cpu_id which is what is used in the rest
of the kernel code.  Although gcc seems to ignore this error, clang fails
without this define to fix the name.

Code from drivers/thermal/x86_pkg_temp_thermal.c
static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = { ... };
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);

Error from clang:
drivers/thermal/x86_pkg_temp_thermal.c:577:1: error: variable has
      incomplete type 'const struct x86cpu_device_id'
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);
^
include/linux/module.h:145:3: note: expanded from macro
      'MODULE_DEVICE_TABLE'
  MODULE_GENERIC_TABLE(type##_device, name)
  ^
include/linux/module.h:87:32: note: expanded from macro
      'MODULE_GENERIC_TABLE'
extern const struct gtype##_id __mod_##gtype##_table            \
                               ^
<scratch space>:143:1: note: expanded from here
__mod_x86cpu_device_table
^
drivers/thermal/x86_pkg_temp_thermal.c:577:1: note: forward declaration of
      'struct x86cpu_device_id'
include/linux/module.h:145:3: note: expanded from macro
      'MODULE_DEVICE_TABLE'
  MODULE_GENERIC_TABLE(type##_device, name)
  ^
include/linux/module.h:87:21: note: expanded from macro
      'MODULE_GENERIC_TABLE'
extern const struct gtype##_id __mod_##gtype##_table            \
                    ^
<scratch space>:141:1: note: expanded from here
x86cpu_device_id
^
1 error generated.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[added vmbus, mei, and rapdio #defines, needed for 3.14 - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I72c8480c649034985d6ff0bf1cdf3bcaca74cc1d

7 years agokbuild: move -Wunused-const-variable to W=1 warning level 33/112133/1
Arnd Bergmann [Tue, 10 May 2016 21:30:01 +0000 (23:30 +0200)]
kbuild: move -Wunused-const-variable to W=1 warning level

gcc-6 started warning by default about variables that are not
used anywhere and that are marked 'const', generating many
false positives in an allmodconfig build, e.g.:

arch/arm/mach-davinci/board-da830-evm.c:282:20: warning: 'da830_evm_emif25_pins' defined but not used [-Wunused-const-variable=]
arch/arm/plat-omap/dmtimer.c:958:34: warning: 'omap_timer_match' defined but not used [-Wunused-const-variable=]
drivers/bluetooth/hci_bcm.c:625:39: warning: 'acpi_bcm_default_gpios' defined but not used [-Wunused-const-variable=]
drivers/char/hw_random/omap-rng.c:92:18: warning: 'reg_map_omap4' defined but not used [-Wunused-const-variable=]
drivers/devfreq/exynos/exynos5_bus.c:381:32: warning: 'exynos5_busfreq_int_pm' defined but not used [-Wunused-const-variable=]
drivers/dma/mv_xor.c:1139:34: warning: 'mv_xor_dt_ids' defined but not used [-Wunused-const-variable=]

This is similar to the existing -Wunused-but-set-variable warning
that was added in an earlier release and that we disable by default
now and only enable when W=1 is set, so it makes sense to do
the same here. Once we have eliminated the majority of the
warnings for both, we can put them back into the default list.

We probably want this in backport kernels as well, to allow building
them with gcc-6 without introducing extra warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Lee Jones <lee.jones@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Michal Marek <mmarek@suse.com>
Change-Id: Ic3f0e3744a77892350a6ee9a0a5108bfd2dd8c82

7 years agoInput: sentelic - use "static inline" instead of "inline" 32/112132/1
Khem Raj [Fri, 22 May 2015 16:56:29 +0000 (09:56 -0700)]
Input: sentelic - use "static inline" instead of "inline"

gcc-5 defaults to gnu11 which used c99 inline semantics in c99 'inline' is
not externally visible unlike gnu89, therefore we use 'static inline' which
has same semantics between gnu89 and c99

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Change-Id: Ib7cc715c890f2106a9315ec44793e1241cab75c3

7 years agoInput: lifebook - use "static inline" instead of "inline" in lifebook.h 31/112131/1
Chen Gang [Sun, 9 Nov 2014 21:31:11 +0000 (13:31 -0800)]
Input: lifebook - use "static inline" instead of "inline" in lifebook.h

For functions defined in header files we should use static inline rather
than inline, which breaks under the latest upstream gcc (which is really
gcc issue, but static inline is better suited regardless).

The related error (with allmodconfig under tile):

    MODPOST 4002 modules
  ERROR: "lifebook_detect" [drivers/input/mouse/psmouse.ko] undefined!

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Change-Id: I91e796454fca7015ed81fdc54f287668e48c5096

7 years agoMerge remote-tracking branch 'origin/tizen_common' into tizen accepted/tizen/common/20170123.181945 submit/tizen/20170120.150201 submit/tizen/20170120.150631
Maciej Wereski [Fri, 20 Jan 2017 15:00:35 +0000 (16:00 +0100)]
Merge remote-tracking branch 'origin/tizen_common' into tizen

7 years agocompiler-gcc: disable -ftracer for __noclone functions 57/110957/1 submit/tizen/20170120.144453
Paolo Bonzini [Thu, 31 Mar 2016 07:38:51 +0000 (09:38 +0200)]
compiler-gcc: disable -ftracer for __noclone functions

commit 95272c29378ee7dc15f43fa2758cb28a5913a06d upstream.

-ftracer can duplicate asm blocks causing compilation to fail in
noclone functions.  For example, KVM declares a global variable
in an asm like

    asm("2: ... \n
         .pushsection data \n
         .global vmx_return \n
         vmx_return: .long 2b");

and -ftracer causes a double declaration.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: stable@vger.kernel.org
Cc: kvm@vger.kernel.org
Reported-by: Linda Walsh <lkml@tlinx.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I3aa7d5a11d3a0e027ad930b664930f67c84661c9

7 years agocompiler-gcc: integrate the various compiler-gcc[345].h files 56/110956/1
Joe Perches [Thu, 25 Jun 2015 22:01:02 +0000 (15:01 -0700)]
compiler-gcc: integrate the various compiler-gcc[345].h files

commit f320793e52aee78f0fbb8bcaf10e6614d2e67bfc upstream.

[ Upstream commit cb984d101b30eb7478d32df56a0023e4603cba7f ]

As gcc major version numbers are going to advance rather rapidly in the
future, there's no real value in separate files for each compiler
version.

Deduplicate some of the macros #defined in each file too.

Neaten comments using normal kernel commenting style.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Sasha Levin <levinsasha928@gmail.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Alan Modra <amodra@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ie57d2a3f395aa9bdefbe743057b3ab3edc7a5140

7 years agoARM: LLVMLinux: Change "extern inline" to "static inline" in glue-cache.h 55/110955/1
Behan Webster [Wed, 4 Sep 2013 02:27:26 +0000 (22:27 -0400)]
ARM: LLVMLinux: Change "extern inline" to "static inline" in glue-cache.h

With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). "static inline" is the correct choice
instead.

Author: Behan Webster <behanw@converseincode.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Change-Id: Ia8eed79f7bcb910db7bfbc673a5820accf979915

7 years agoARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h 54/110954/1
Behan Webster [Wed, 24 Sep 2014 00:06:46 +0000 (01:06 +0100)]
ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h

With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). In this case using static inline
and removing the NULL version of return_address in return_address.c does
the right thing.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Change-Id: Ia248e544cb8585fa7bfab5df3b4f3fca3089ab0c

7 years agoDo Not Use profile macro 56/97456/1
MyungJoo Ham [Mon, 14 Nov 2016 07:56:02 +0000 (16:56 +0900)]
Do Not Use profile macro

It is to be obsolete in 4.0.

It is allowed to use "profile" macro ONLY for backward compatibility while
keeping the compatibility with unified build environment.
- Both are false in this usage.

Change-Id: I13a3a94a49cb75dc18cedaa95e2e82f34bcedb3e
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
8 years agodefconfig: add wifi atheros modules 76/38976/2 accepted/tizen_3.0_common tizen_3.0.2015.q2_common tizen_3.0.m2 tizen_common accepted/tizen/3.0/common/20161114.112056 accepted/tizen/common/20150601.092045 submit/tizen_3.0_common/20161104.104000 submit/tizen_common/20150601.091241
Philippe Coval [Tue, 5 May 2015 14:58:01 +0000 (16:58 +0200)]
defconfig: add wifi atheros modules

Change-Id: Ib003862d100e3a4f397bfef4319ee70fc8e3c3e4
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
8 years agousbtouchscreen: adds support for inverting X or Y axis (or both) 23/40023/2
Philippe Coval [Fri, 22 May 2015 16:05:22 +0000 (18:05 +0200)]
usbtouchscreen: adds support for inverting X or Y axis (or both)

Invert Y is needed (together with swap XY) for some touchscreens :

- LeadingTouch screens (at least for some of them)
- cartft 8in4 (USB ID=0eef:0001)

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Change-Id: I3b551be8734d5d5f272c8ee8579d2233d6c11ca4

8 years agoconfig: adjusted for 3.14.28-ltsi accepted/tizen/common/20150529.082401 submit/tizen_common/20150528.135532
Stephane Desneux [Wed, 4 Feb 2015 11:25:00 +0000 (12:25 +0100)]
config: adjusted for 3.14.28-ltsi

Change-Id: I0fa7eba65b6ca62eefbd95ddff160f901def4a11
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
8 years agoEnable I2C/SMBus on intel platforms
Stephane Desneux [Mon, 26 Jan 2015 10:15:37 +0000 (11:15 +0100)]
Enable I2C/SMBus on intel platforms

Change-Id: I32e1c51a0d64b822377a56a264ac94742cbbb662
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
8 years agoEnable support of DisplayLink framebuffer driver
Stephane Desneux [Mon, 19 Jan 2015 16:32:19 +0000 (17:32 +0100)]
Enable support of DisplayLink framebuffer driver

Change-Id: I609519939f89ba6d9f10d00846a4d7d30af3dd88
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
8 years agoadjusted configurations for 3.14.25
Stephane Desneux [Tue, 25 Nov 2014 16:33:14 +0000 (17:33 +0100)]
adjusted configurations for 3.14.25

Change-Id: I891ad0800ee0dda13f0fca593d38d94f43b2062f
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
8 years agoimport configuration from old branch tizen_3.14.19
Stephane Desneux [Mon, 20 Oct 2014 14:30:51 +0000 (16:30 +0200)]
import configuration from old branch tizen_3.14.19

Change-Id: I2dcc39dd803829ba8ab0f26528e47386a2aa9222
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
8 years agopackaging: fix gummiboot missing args 22/40022/2
Philippe Coval [Tue, 5 May 2015 14:22:53 +0000 (16:22 +0200)]
packaging: fix gummiboot missing args

Change-Id: I88b2d65fc2570e1585a9886d4e28d4f6443d5711
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agodefconfig: enable CONFIG_DEVPTS_MULTIPLE_INSTANCES
Maciej Wereski [Thu, 26 Feb 2015 12:44:05 +0000 (13:44 +0100)]
defconfig: enable CONFIG_DEVPTS_MULTIPLE_INSTANCES

This is required by systemd.

Related: https://git.tizen.org/cgit/platform/upstream/systemd.git/commit/?h=upstream&id=b52a4a3b05a2a0d69868d57fd54f6e4b8fa0e7ca
Change-Id: Ib395e71a387a64bd14944b0087cb7a6e85b637ed
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
9 years agopackaging, defconfig: bump to 3.14.28-ltsi
Stephane Desneux [Wed, 4 Feb 2015 10:57:41 +0000 (11:57 +0100)]
packaging, defconfig: bump to 3.14.28-ltsi

Change-Id: I789149825987f75058b2f806cc4ac905b421433e
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agoARM: vexpress_defconfig: enable ACL and security labels for ext4
Łukasz Stelmach [Fri, 12 Dec 2014 11:08:03 +0000 (12:08 +0100)]
ARM: vexpress_defconfig: enable ACL and security labels for ext4

This patch enables security features of ext4 file-system required
by many conteporary user-space setups.

Forwarded: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310299.html
Change-Id: Ia9396b810f7d84c926b762cc33a58a2ec9dfd781
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
9 years agopackaging: adjusted upgrade procedure (documentation)
Stephane Desneux [Tue, 25 Nov 2014 16:48:07 +0000 (17:48 +0100)]
packaging: adjusted upgrade procedure (documentation)

Change-Id: I938f164f4c046426f5cacc6bb12abaa7ef262109
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agoi386, x86_64 configurations: add CONFIG_EFI_STUB
Stephane Desneux [Tue, 25 Nov 2014 11:51:43 +0000 (12:51 +0100)]
i386, x86_64 configurations: add CONFIG_EFI_STUB

It was reported that gummiboot can't boot the kernel without this option.

Change-Id: I8d963ff78b9ed1ef7b94a5d25cf0425a2fa7b1d4
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agodefconfig: set options according to systemd requirements
Łukasz Stelmach [Tue, 25 Nov 2014 10:41:49 +0000 (11:41 +0100)]
defconfig: set options according to systemd requirements

Change-Id: I74038b718861eefbb634d578cb092c4c1ce56fea
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
9 years agopackaging: bump to 3.14.25
Stephane Desneux [Tue, 25 Nov 2014 09:08:55 +0000 (10:08 +0100)]
packaging: bump to 3.14.25

Change-Id: I7984a962fc224e441b9248c538f84aec2942a04c
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agopackaging: bump to 3.14.24
Stephane Desneux [Sat, 15 Nov 2014 10:19:23 +0000 (11:19 +0100)]
packaging: bump to 3.14.24

Change-Id: Ia317c8f81dfceb145dbb450601e44f09c27be2d5
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agopackaging: bump to 3.14.23
Stephane Desneux [Thu, 6 Nov 2014 10:04:58 +0000 (11:04 +0100)]
packaging: bump to 3.14.23

Change-Id: I869f59de7a1f0d15251ae26ec87a0d9e1cb5bbae
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agopackaging: bump to 3.14.22
Stephane Desneux [Wed, 22 Oct 2014 17:28:38 +0000 (19:28 +0200)]
packaging: bump to 3.14.22

Change-Id: I06136f052e75d4e8357ea099ae2d48e60c16c749
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agoInitialize default configurations for x86,x86_64,arm
Stephane Desneux [Mon, 20 Oct 2014 13:11:09 +0000 (15:11 +0200)]
Initialize default configurations for x86,x86_64,arm

Change-Id: I3877e860311f8313d2ad09aff707484268409c1f
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agopackaging: add spec file, gbs.conf
Stephane Desneux [Tue, 7 Oct 2014 15:47:13 +0000 (17:47 +0200)]
packaging: add spec file, gbs.conf

Change-Id: I7a8abba8bc6fb7459ac4d78547b41320b63e7eba
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agoSMACK: Fix wrong copy size
José Bollo [Mon, 15 Sep 2014 09:42:04 +0000 (11:42 +0200)]
SMACK: Fix wrong copy size

The function strncpy was copying an extra character 9
when i == len (what is possible via revoke interface).

Change-Id: Ic7452da05773e620a1d7bbc55e859c25a86c65f6
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
9 years agoperf tools: define _DEFAULT_SOURCE for glibc_2.20
Chanho Park [Fri, 12 Sep 2014 02:03:01 +0000 (11:03 +0900)]
perf tools: define _DEFAULT_SOURCE for glibc_2.20

_BSD_SOURCE was deprecated in favour of _DEFAULT_SOURCE since glibc
2.20[1]. To avoid build warning on glibc2.20, _DEFAULT_SOURCE should
also be defined.

[1]: https://sourceware.org/glibc/wiki/Release/2.20

Change-Id: I01a2849bb8642cbf5c875caf227ab05e6fa0fa41
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
9 years agoSmack: Fix setting label on successful file open
Marcin Niesluchowski [Tue, 19 Aug 2014 12:26:32 +0000 (14:26 +0200)]
Smack: Fix setting label on successful file open

While opening with CAP_MAC_OVERRIDE file label is not set.
Other calls may access it after CAP_MAC_OVERRIDE is dropped from process.

Change-Id: I937d070e1c0cb251f4a0dd3291efbc94be3ca548
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Origin: git://git.gitorious.org/smack-next/kernel.git# smack-for-3.18

9 years agoSmack: remove unneeded NULL-termination from securtity label
Konstantin Khlebnikov [Thu, 7 Aug 2014 16:52:49 +0000 (20:52 +0400)]
Smack: remove unneeded NULL-termination from securtity label

Values of extended attributes are stored as binary blobs. NULL-termination
of them isn't required. It just wastes disk space and confuses command-line
tools like getfattr because they have to print that zero byte at the end.

This patch removes terminating zero byte from initial security label in
smack_inode_init_security and cuts it out in function smack_inode_getsecurity
which is used by syscall getxattr. This change seems completely safe, because
function smk_parse_smack ignores everything after first zero byte.

Change-Id: I131879e36fc9e71b65857b46714ccd0e512fc83c
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: handle zero-length security labels without panic
Konstantin Khlebnikov [Thu, 7 Aug 2014 16:52:43 +0000 (20:52 +0400)]
Smack: handle zero-length security labels without panic

Zero-length security labels are invalid but kernel should handle them.

This patch fixes kernel panic after setting zero-length security labels:

And after writing zero-length string into smackfs files syslog and onlycp:

The problem is caused by brain-damaged logic in function smk_parse_smack()
which takes pointer to buffer and its length but if length below or equal zero
it thinks that the buffer is zero-terminated. Unfortunately callers of this
function are widely used and proper fix requires serious refactoring.

Change-Id: I931735ccfaea4d8d2f0a98eacf8467f0a8359bc6
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: fix behavior of smack_inode_listsecurity
Konstantin Khlebnikov [Thu, 7 Aug 2014 16:52:33 +0000 (20:52 +0400)]
Smack: fix behavior of smack_inode_listsecurity

Security operation ->inode_listsecurity is used for generating list of
available extended attributes for syscall listxattr. Currently it's used
only in nfs4 or if filesystem doesn't provide i_op->listxattr.

The list is the set of NULL-terminated names, one after the other.
This method must include zero byte at the and into result.

Also this function must return length even if string does not fit into
output buffer or it is NULL, see similar method in selinux and man listxattr.

Change-Id: I3ba4524fead6ef6ab0c93238fa8d422e6b155efb
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoWarning in scanf string typing
Toralf Förster [Sun, 27 Apr 2014 17:33:34 +0000 (19:33 +0200)]
Warning in scanf string typing

This fixes a warning about the mismatch of types between
the declared unsigned and integer.

Change-Id: Ie7170fa22c1f641b2990721b44059d399c92ffe6
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: Verify read access on file open - v3
Casey Schaufler [Mon, 21 Apr 2014 18:10:26 +0000 (11:10 -0700)]
Smack: Verify read access on file open - v3

Smack believes that many of the operatons that can
be performed on an open file descriptor are read operations.
The fstat and lseek system calls are examples.
An implication of this is that files shouldn't be open
if the task doesn't have read access even if it has
write access and the file is being opened write only.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Change-Id: Iefff38549f9f2e242fd21fce42db067c4c4d8a12
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: bidirectional UDS connect check
Casey Schaufler [Thu, 10 Apr 2014 23:37:08 +0000 (16:37 -0700)]
Smack: bidirectional UDS connect check

Smack IPC policy requires that the sender have write access
to the receiver. UDS streams don't do per-packet checks. The
only check is done at connect time. The existing code checks
if the connecting process can write to the other, but not the
other way around. This change adds a check that the other end
can write to the connecting process.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Change-Id: I0dd9124261cb66a364322ed88e9dcb3213157cb6
Signed-off-by: Casey Schuafler <casey@schaufler-ca.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: Correctly remove SMACK64TRANSMUTE attribute
Casey Schaufler [Thu, 10 Apr 2014 23:35:36 +0000 (16:35 -0700)]
Smack: Correctly remove SMACK64TRANSMUTE attribute

Sam Henderson points out that removing the SMACK64TRANSMUTE
attribute from a directory does not result in the directory
transmuting. This is because the inode flag indicating that
the directory is transmuting isn't cleared. The fix is a tad
less than trivial because smk_task and smk_mmap should have
been broken out, too.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Change-Id: Iae25080bfd0ec247391c997a59f3e2327423e33d
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agobugfix patch for SMACK
Pankaj Kumar [Fri, 13 Dec 2013 09:42:22 +0000 (15:12 +0530)]
bugfix patch for SMACK

1. In order to remove any SMACK extended attribute from a file, a user
should have CAP_MAC_ADMIN capability. But user without having this
capability is able to remove SMACK64MMAP security attribute.

2. While validating size and value of smack extended attribute in
smack_inode_setsecurity hook, wrong error code is returned.

Change-Id: Ib4b290150f4a003733f76cbb7ccc25d228310ecb
Signed-off-by: Pankaj Kumar <pamkaj.k2@samsung.com>
Signed-off-by: Himanshu Shukla <himanshu.sh@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: adds smackfs/ptrace interface
Lukasz Pawelczyk [Tue, 11 Mar 2014 16:07:06 +0000 (17:07 +0100)]
Smack: adds smackfs/ptrace interface

This allows to limit ptrace beyond the regular smack access rules.
It adds a smackfs/ptrace interface that allows smack to be configured
to require equal smack labels for PTRACE_MODE_ATTACH access.
See the changes in Documentation/security/Smack.txt below for details.

Change-Id: If5d887a86b8d05ac46c82e1e7e123b86a5d62ddb
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: unify all ptrace accesses in the smack
Lukasz Pawelczyk [Tue, 11 Mar 2014 16:07:05 +0000 (17:07 +0100)]
Smack: unify all ptrace accesses in the smack

The decision whether we can trace a process is made in the following
functions:
smack_ptrace_traceme()
smack_ptrace_access_check()
smack_bprm_set_creds() (in case the proces is traced)

This patch unifies all those decisions by introducing one function that
checks whether ptrace is allowed: smk_ptrace_rule_check().

This makes possible to actually trace with TRACEME where first the
TRACEME itself must be allowed and then exec() on a traced process.

Additional bugs fixed:
- The decision is made according to the mode parameter that is now correctly
  translated from PTRACE_MODE_* to MAY_* instead of being treated 1:1.
  PTRACE_MODE_READ requires MAY_READ.
  PTRACE_MODE_ATTACH requires MAY_READWRITE.
- Add a smack audit log in case of exec() refused by bprm_set_creds().
- Honor the PTRACE_MODE_NOAUDIT flag and don't put smack audit info
  in case this flag is set.

Change-Id: I14d6de0c11ce190e53788a0b4fc096471506c736
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoSmack: fix the subject/object order in smack_ptrace_traceme()
Lukasz Pawelczyk [Tue, 11 Mar 2014 16:07:04 +0000 (17:07 +0100)]
Smack: fix the subject/object order in smack_ptrace_traceme()

The order of subject/object is currently reversed in
smack_ptrace_traceme(). It is currently checked if the tracee has a
capability to trace tracer and according to this rule a decision is made
whether the tracer will be allowed to trace tracee.

Change-Id: I70afd604b29e5d6515d042ab648b0513c1f77d7a
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@partner.samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoMinor improvement of 'smack_sb_kern_mount'
José Bollo [Wed, 8 Jan 2014 14:53:05 +0000 (15:53 +0100)]
Minor improvement of 'smack_sb_kern_mount'

Fix a possible memory access fault when transmute is true and isp is NULL.

Change-Id: I29708ce54b96b34b440cf349e2b1891ea8d9d34f
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agosmack: fix key permission verification
Dmitry Kasatkin [Fri, 14 Mar 2014 17:44:49 +0000 (17:44 +0000)]
smack: fix key permission verification

For any keyring access type SMACK always used MAY_READWRITE access check.
It prevents reading the key with label "_", which should be allowed for anyone.

This patch changes default access check to MAY_READ and use MAY_READWRITE in only
appropriate cases.

Change-Id: Ie357956730df93058198e2df13ef307ce4e8f675
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
9 years agoKEYS: Move the flags representing required permission to linux/key.h
David Howells [Fri, 14 Mar 2014 17:44:49 +0000 (17:44 +0000)]
KEYS: Move the flags representing required permission to linux/key.h

Move the flags representing required permission to linux/key.h as the perm
parameter of security_key_permission() is in terms of them - and not the
permissions mask flags used in key->perm.

Whilst we're at it:

 (1) Rename them to be KEY_NEED_xxx rather than KEY_xxx to avoid collisions
     with symbols in uapi/linux/input.h.

 (2) Don't use key_perm_t for a mask of required permissions, but rather limit
     it to the permissions mask attached to the key and arguments related
     directly to that.

Change-Id: Id9de84f93e5dd668a3b8ba00fc2440c6d6c6f988
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Origin: upstream

9 years agoRevert "x86/efi: Correct EFI boot stub use of code32_start"
Philippe Coval [Fri, 22 Aug 2014 08:09:19 +0000 (10:09 +0200)]
Revert "x86/efi: Correct EFI boot stub use of code32_start"

This reverts commit 45ada9fae6d836aa8e3be5302d7aeb50c44e0629.

With this change in , nexcom's vtc1010 does not boot anynore
even rebased on latest version v3.14.17
and with latest firmware :
ftp://ftp.nexcom.com/pub/BIOS/VTC1010/x86_32bit/MV11A109.rom
( md5=f5ccb5284ca5bd8668fa1031067dad27 )

The bug is now tracked upstream.

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=82891
Change-Id: I82bb1227dcbcbfe1371d685d241e985a6e58ddf3
Bug-Tizen: TC-1513/part

9 years agoSMACK: Fix handling value==NULL in post setxattr
José Bollo [Thu, 3 Apr 2014 07:51:07 +0000 (09:51 +0200)]
SMACK: Fix handling value==NULL in post setxattr

The function `smack_inode_post_setxattr` is called each
time that a setxattr is done, for any value of name.
The kernel allow to put value==NULL when size==0
to set an empty attribute value. The systematic
call to smk_import_entry was causing the dereference
of a NULL pointer hence a KERNEL PANIC!

The problem can be produced easily by issuing the
command `setfattr -n user.data file` under bash prompt
when SMACK is active.

Moving the call to smk_import_entry as proposed by this
patch is correcting the behaviour because the function
smack_inode_post_setxattr is called for the SMACK's
attributes only if the function smack_inode_setxattr validated
the value and its size (what will not be the case when size==0).

It also has a benefical effect to not fill the smack hash
with garbage values coming from any extended attribute
write.

Change-Id: Iaf0039c2be9bccb6cee11c24a3b44d209101fe47
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agoSmack: Cgroup filesystem access
Casey Schaufler [Thu, 21 Nov 2013 08:55:10 +0000 (10:55 +0200)]
Smack: Cgroup filesystem access

The cgroup filesystems are not mounted using conventional
mechanisms. This prevents the use of mount options to
set Smack attributes. This patch makes the behavior
of cgroup filesystems compatable with the way systemd
uses them.

Change-Id: I1e0429f133db9e14117dc754d682dec08221354c
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
9 years agowatchdog: iTCO_wdt: Fix the parent device upstream v3.14.28+ltsi
Jean Delvare [Wed, 5 Nov 2014 01:39:21 +0000 (09:39 +0800)]
watchdog: iTCO_wdt: Fix the parent device

The watchdog's parent is iTCO_wdt (the platform device) not lpc_ich
(the PCI device.) Setting the parent right makes it much easier for
the user to figure out which driver/module is handling the watchdog
device node.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
(cherry picked from commit c90789baa8cec363093c5ec292c989b6f22d8f32)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agowatchdog: fix checkpatch warnings and error
Jingoo Han [Wed, 5 Nov 2014 01:39:20 +0000 (09:39 +0800)]
watchdog: fix checkpatch warnings and error

Fix the following checkpatch warnings and error:
  WARNING: quoted string split across lines
  WARNING: braces {} are not necessary for single statement blocks
  WARNING: __initdata should be placed after ibmasr_id_table[]
  WARNING: please, no space before tabs
  ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
(cherry picked from commit 5f5e19093b2fa592720810154f15ffe51aa9277f)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agowatchdog: iTCO_wdt: Add support for v3 silicon
Peter Tyser [Wed, 5 Nov 2014 01:39:19 +0000 (09:39 +0800)]
watchdog: iTCO_wdt: Add support for v3 silicon

Some new Atom's, eg Avoton and Bay Trail, have slightly different iTCO
functionality:
- The watchdog timer ticks at 1 second instead of .6 seconds

- Some 8 and 16-bit registers were combined into 32-bit registers

- Some registers were removed (DAT_IN, DAT_OUT, MESSAGE)

- The BOOT_STS field in TCO_STS was removed

- The NO_REBOOT bit is in the PMC area instead of GCS

Update the driver to support the above changes and bump the version to
1.11.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Rajat Jain <rajatjain@juniper.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 24b3a1670b47e75be633ae0b5c07945c446f9d29)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Add Device IDs for Intel 9 Series PCH
James Ralston [Wed, 5 Nov 2014 01:39:18 +0000 (09:39 +0800)]
mfd: lpc_ich: Add Device IDs for Intel 9 Series PCH

This patch adds the LPC Device IDs for the Intel 9 Series PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit fea31042ff613145c7784e2ce454bf3c151b97ba)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Add PCI ID for Intel Braswell
Alan Cox [Wed, 5 Nov 2014 01:39:17 +0000 (09:39 +0800)]
mfd: lpc_ich: Add PCI ID for Intel Braswell

This is the same as used in Baytrail so add the new PCI ID to the driver's
list of supported IDs.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit ff0c9da013d2c9f1ec232926a54e536ab48c6678)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Enable GPIO for Panther Point
Guenter Roeck [Wed, 5 Nov 2014 01:39:16 +0000 (09:39 +0800)]
mfd: lpc_ich: Enable GPIO for Panther Point

Panther Point PCH GPIO configuration is similar to V5 PCHs.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 62cf2cdb99c7e870ab857bdd617e728790f8c43c)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Add support for Intel Bay Trail SoC
Peter Tyser [Wed, 5 Nov 2014 01:39:15 +0000 (09:39 +0800)]
mfd: lpc_ich: Add support for Intel Bay Trail SoC

This patch adds the LPC Controller Device IDs for Watchdog and GPIO for
the Intel Bay Trail Atom SoC.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 6111ec70357022ccd037399c13f69900431850b4)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Add support for NM10 GPIO
Peter Tyser [Wed, 5 Nov 2014 01:39:14 +0000 (09:39 +0800)]
mfd: lpc_ich: Add support for NM10 GPIO

The NM10's GPIO is compatible with ICH v7 GPIO.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Dan Weinlader <danw@vs-networks.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 117bbfe25cfc2e968be1f7976ac460a5cd3d734e)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Change Avoton to iTCO v3
Peter Tyser [Wed, 5 Nov 2014 01:39:13 +0000 (09:39 +0800)]
mfd: lpc_ich: Change Avoton to iTCO v3

The register layout of the Avoton is compatible with the iTCO v3
register layout.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Rajat Jain <rajatjain@juniper.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit c48cf59878685cc06b71bb2a3ca17b61103c8de7)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Add support for iTCO v3
Peter Tyser [Wed, 5 Nov 2014 01:39:12 +0000 (09:39 +0800)]
mfd: lpc_ich: Add support for iTCO v3

Some newer Atom CPUs, eg Avoton and Bay Trail, use slightly different
register layouts for the iTCO than the current v1 and v2 iTCO.
Differences from previous iTCO versions include:
- The ACPI space is enabled in the "ACPI base address" register instead
  of the "ACPI control register"

- The "no reboot" functionality is set in the "Power Management
  Configuration" register instead of the "General Control and Status"
  (GCS) register or PCI configuration space.

- The "ACPI Control Register" is not present on v3.  The "Power
  Management Configuration Base Address" register resides at the same
  address is Avoton/Bay Trail.

To differentiate these newer chipsets create a new v3 iTCO version and
update the MFD driver to support them.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Rajat Jain <rajatjain@juniper.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit eb71d4dec4a5e010e34b9d7afdb5af41884c388e)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Remove lpc_ich_cfg struct use
Peter Tyser [Wed, 5 Nov 2014 01:39:11 +0000 (09:39 +0800)]
mfd: lpc_ich: Remove lpc_ich_cfg struct use

Future chipsets will use different register layouts that don't map
cleanly to the lpc_ich_cfg fields.  Remove the lpc_ich_cfg struct and
add explicit fields to the higher level lpc_ich_priv structure.

This change should have no functional impact.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Rajat Jain <rajatjain@juniper.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 429b941abd503c8936e116c819362323aafdbd50)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Only configure watchdog or GPIO when present
Peter Tyser [Wed, 5 Nov 2014 01:39:10 +0000 (09:39 +0800)]
mfd: lpc_ich: Only configure watchdog or GPIO when present

Some chipsets don't currently have GPIO support enabled.  For these
chipsets don't go through the process of initializing the GPIO region.

Make the same change for the watchdog initialization for chipsets which
may not enable the WDT in the future.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Rajat Jain <rajatjain@juniper.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit f0776b8ce03ceb638c51b62f324844c71c446600)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Fix ACPI enable bitmask
Peter Tyser [Wed, 5 Nov 2014 01:39:09 +0000 (09:39 +0800)]
mfd: lpc_ich: Fix ACPI enable bitmask

The original bitmask of 0x10 was incorrect and would result in a write
to a reserved read-only bit instead of enabling the ACPI I/O
region.  Update it to the proper value of 0x80.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Rajat Jain <rajatjain@juniper.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit f5dccb15877b82a40950c6f752d5345c86189fc9)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Add support for Intel Avoton GPIOs
Vincent Donnefort [Wed, 5 Nov 2014 01:39:08 +0000 (09:39 +0800)]
mfd: lpc_ich: Add support for Intel Avoton GPIOs

Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit facd9939403cb5769190054a600474399e776e3a)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: lpc_ich: Convert ICH GPIOs IDs to enum
Vincent Donnefort [Wed, 5 Nov 2014 01:39:07 +0000 (09:39 +0800)]
mfd: lpc_ich: Convert ICH GPIOs IDs to enum

All those IDs are arbitrary and so can be encapsulated into an enumeration.

Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 6cec365e3eba3dd8c864056d8d3fd9e73ab8dd7a)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomfd: Delete non-required instances of include <linux/init.h>
Paul Gortmaker [Wed, 5 Nov 2014 01:39:06 +0000 (09:39 +0800)]
mfd: 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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
(cherry picked from commit 3c699105d0376c14940ce7cf561754a94cdff8dd)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agoi2c: i801: Add PCI ID for Intel Braswell
Alan Cox [Tue, 4 Nov 2014 08:55:25 +0000 (16:55 +0800)]
i2c: i801: Add PCI ID for Intel Braswell

The SMBus host controller is the same as used in Baytrail so add the new
PCI ID to the driver's list of supported IDs.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 39e8e30ee544a62c148033d64a979028b958ca05)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agoi2c: i801: Add device ID for Intel Wildcat Point PCH
Jean Delvare [Tue, 4 Nov 2014 08:55:24 +0000 (16:55 +0800)]
i2c: i801: Add device ID for Intel Wildcat Point PCH

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit b299de839157852c563b9f133c8b7e630545a9c3)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agoi2c: i801: Fix the alignment of the device table
Jean Delvare [Tue, 4 Nov 2014 08:55:23 +0000 (16:55 +0800)]
i2c: i801: Fix the alignment of the device table

A long name broke the alignment, shift the columns a bit to fix it and
make the table look nice again. While we're here, switch to the
standard comment style to make checkpatch happy, and use tabs instead
of spaces for column alignment.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit ce3161106ab57afbfbe1c33d95bf4a569405983a)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agoi2c: remove DEFINE_PCI_DEVICE_TABLE macro
Jingoo Han [Tue, 4 Nov 2014 08:55:22 +0000 (16:55 +0800)]
i2c: remove DEFINE_PCI_DEVICE_TABLE macro

Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 392debf11656dedd79da44416747d5b2b1747f5e)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: use c99 initializers in structures
Julia Lawall [Wed, 29 Oct 2014 00:52:58 +0000 (08:52 +0800)]
pwm: lpss: use c99 initializers in structures

Use c99 initializers for structures.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@

struct i1 i2 = { is,
+ .fld = e
- e
 ,...};
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
[thierry.reding: rebased and applied same fix for Braswell]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit b2b7adeb21745266326d453b95e5d0b1b9cb1d4e)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: Fix build failure on PowerPC
Thierry Reding [Wed, 29 Oct 2014 00:52:57 +0000 (08:52 +0800)]
pwm: lpss: Fix build failure on PowerPC

An x86 build seems to pull in the linux/io.h include indirectly. On
PowerPC that doesn't happen and the build breaks due to the readl() and
writel() functions not being declared. Fix this by explicitly including
linux/io.h.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit e0c86a3b63e948e51a47d17382c7cd8711d19750)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: Properly split driver to parts
Andy Shevchenko [Wed, 29 Oct 2014 00:52:56 +0000 (08:52 +0800)]
pwm: lpss: Properly split driver to parts

The driver consists of core, PCI, and platform parts. It would be better
to split them into separate files.

The platform driver is now called pwm-lpss-platform. Thus, previously
set CONFIG_PWM_LPSS=m is not enough to build it. But we are on the safe
side since it seems no one from outside Intel is using it for now.

While here, move to use macros module_pci_driver() and
module_platform_driver().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Alan Cox <alan@linux.intel.com>
[thierry.reding: change select to depends on PWM_LPSS, cleanup]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit c558e39e14c2372394f49e07fbe94e9708b615cb)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: Add ACPI and PCI IDs for Intel Braswell
Alan Cox [Wed, 29 Oct 2014 00:52:55 +0000 (08:52 +0800)]
pwm: lpss: Add ACPI and PCI IDs for Intel Braswell

This is pretty much the same as Baytrail PWM. Only difference is that the
input clock runs on different frequency.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit 373c57829a3f9da1405b1fbd3d17e50f8e1f476e)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: remove dependency on clk framework
Heikki Krogerus [Wed, 29 Oct 2014 00:52:54 +0000 (08:52 +0800)]
pwm: lpss: remove dependency on clk framework

Unlike other Intel LPSS devices, the PWM does not have the
clock dividers or the gate. All we get from the clock is the
rate. Since PCI case uses the driver data to get the rate,
we can drop the clk and use the same data also in case of
ACPI. The frequency is the same.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit 65accd87381ed96bf8893124b149bae08edd2740)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: Fix const qualifier and sparse warnings
Thierry Reding [Wed, 29 Oct 2014 00:52:53 +0000 (08:52 +0800)]
pwm: lpss: Fix const qualifier and sparse warnings

Fixes the following warnings reported by the 0-DAY kernel build testing
backend:

   drivers/pwm/pwm-lpss.c: In function 'pwm_lpss_probe_pci':
>> drivers/pwm/pwm-lpss.c:192:2: warning: passing argument 3 of 'pwm_lpss_probe' discards 'const' qualifier from pointer target type [enabled by default]
     lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info);
     ^
   drivers/pwm/pwm-lpss.c:130:30: note: expected 'struct pwm_lpss_boardinfo *' but argument is of type 'const struct pwm_lpss_boardinfo *'
    static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev,
                                 ^
>> drivers/pwm/pwm-lpss.c:143:28: sparse: incorrect type in return expression (different address spaces)
   drivers/pwm/pwm-lpss.c:143:28:    expected struct pwm_lpss_chip *
   drivers/pwm/pwm-lpss.c:143:28:    got void [noderef] <asn:2>*regs
>> drivers/pwm/pwm-lpss.c:192:63: sparse: incorrect type in argument 3 (different modifiers)
   drivers/pwm/pwm-lpss.c:192:63:    expected struct pwm_lpss_boardinfo *info
   drivers/pwm/pwm-lpss.c:192:63:    got struct pwm_lpss_boardinfo const *[assigned] info
   drivers/pwm/pwm-lpss.c: In function 'pwm_lpss_probe_pci':
   drivers/pwm/pwm-lpss.c:192:2: warning: passing argument 3 of 'pwm_lpss_probe' discards 'const' qualifier from pointer target type [enabled by default]
     lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info);
     ^
   drivers/pwm/pwm-lpss.c:130:30: note: expected 'struct pwm_lpss_boardinfo *' but argument is of type 'const struct pwm_lpss_boardinfo *'
    static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev,
                                 ^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit 89c0339e0aa097384b3efed894b23820814c21d3)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: lpss: Add support for PCI devices
Alan Cox [Wed, 29 Oct 2014 00:52:52 +0000 (08:52 +0800)]
pwm: lpss: Add support for PCI devices

Not all systems enumerate the PWM devices via ACPI. They can also be
exposed via the PCI interface.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit 093e00bb3f82f3c67e2d1682e316fc012bcd0d92)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agopwm: add support for Intel Low Power Subsystem PWM
Mika Westerberg [Wed, 29 Oct 2014 00:52:51 +0000 (08:52 +0800)]
pwm: add support for Intel Low Power Subsystem PWM

Add support for Intel Low Power I/O subsystem PWM controllers found on
Intel BayTrail SoC.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Chew, Kean Ho <kean.ho.chew@intel.com>
Signed-off-by: Chang, Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit d16a5aa9e821633a3095d7a88cd1d2cd108bf966)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
9 years agomicrel: fix masking off LED bits
Sergei Shtylyov [Thu, 11 Dec 2014 02:29:12 +0000 (11:29 +0900)]
micrel: fix masking off LED bits

Commit 20d8435a1cff (phy: micrel: add of configuration for LED mode) made the
obvious mistake when masking off  the LED mode bits: forgot to do a logical NOT
to the mask with which it ANDs the register value, so that unrelated bits are
cleared instead.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 28bdc499d647124fa5844453d35e6f5d1b3810dc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agophy: micrel: add of configuration for LED mode
Ben Dooks [Thu, 11 Dec 2014 02:29:11 +0000 (11:29 +0900)]
phy: micrel: add of configuration for LED mode

Add support for the led-mode property for the following PHYs
which have a single LED mode configuration value.

KSZ8001 and KSZ8041 which both use register 0x1e bits 15,14 and
KSZ8021, KSZ8031 and KSZ8051 which use register 0x1f bits 5,4
to control the LED configuration.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 20d8435a1cffa04992f1db6b199a5f0ccec2ff06)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoof/fdt: update of_get_flat_dt_prop in prep for libfdt
Rob Herring [Wed, 2 Apr 2014 04:49:03 +0000 (23:49 -0500)]
of/fdt: update of_get_flat_dt_prop in prep for libfdt

Make of_get_flat_dt_prop arguments compatible with libfdt fdt_getprop
call in preparation to convert FDT code to use libfdt. Make the return
value const and the property length ptr type an int.

Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Tested-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Stephen Chivers <schivers@csc.com>
(cherry picked from commit 9d0c4dfedd96ee54fc075b16d02f82499c8cc3a6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
arch/arm/plat-samsung/s5p-dev-mfc.c
arch/powerpc/platforms/powernv/opal.c
drivers/of/fdt.c
drivers/of/of_reserved_mem.c

9 years agoclk: add clock-indices support
Ben Dooks [Thu, 13 Feb 2014 18:02:49 +0000 (18:02 +0000)]
clk: add clock-indices support

Add a property called clock-indices to allow clock-output-names
to be used where the index used to lookup a clock is not a 1:1
mapping to the array position in the clock-output-names

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
(cherry picked from commit 7a0fc1a3df82d29e00b4c9f88a6b37450d6711f1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoi2c: rcar: fix RCAR_IRQ_ACK_{RECV|SEND}
Sergei Shtylyov [Fri, 5 Sep 2014 23:34:32 +0000 (03:34 +0400)]
i2c: rcar: fix RCAR_IRQ_ACK_{RECV|SEND}

Bits 8-31 of all registers reflect the value of bits 0-7 on reads and should be
0 on writes, according to the manuals. RCAR_IRQ_ACK_{RECV|SEND} macros have all
1's in bits 8-31, thus going against the manuals, so fix them.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: stable@vger.kernel.org
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 938916fbb8e8cb67eacb784f4eda17e2950c16c5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: fix the usb_pkt_pop()
Yoshihiro Shimoda [Fri, 22 Aug 2014 11:14:28 +0000 (20:14 +0900)]
usb: renesas_usbhs: fix the usb_pkt_pop()

This patch fixes the usb_pkt_pop(). If a gadget driver calls
usb_ep_dequeue(), this driver will call the usb_pkt_pop().
So, the usb_pkt_pop() should cancel the transaction.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 2743e7f90dc08282d027dbc2f6486f5cb85aa493)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: fix the condition of is_done in usbhsf_dma_push_done
Yoshihiro Shimoda [Fri, 22 Aug 2014 11:14:10 +0000 (20:14 +0900)]
usb: renesas_usbhs: fix the condition of is_done in usbhsf_dma_push_done

This patch fixes the condition of is_done in usbhsf_dma_push_done().
This function will be called after a transmission finished by DMAC.
So, the function should check if the transmission packet is short packet
or not. Also the function should call try_run to send the zero packet
by the pio handler if the "*is_done" is not set. Otherwize, the
transaction will not finish if a gadget driver sets the "zero" flag
in a transmission.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit c0ed8b23b257a84d103764cdbd490ee5e2749da3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: protect mod->irq_{bemp,brdy}sts by spin lock
Yoshihiro Shimoda [Fri, 22 Aug 2014 11:14:00 +0000 (20:14 +0900)]
usb: renesas_usbhs: protect mod->irq_{bemp,brdy}sts by spin lock

This patch protects the mod->irq_bempsts and mod->irq_brdysts by
spin lock in the usbhs_status_get_each_irq() because other functions
will write them during spin lock. Otherwise, the driver will clears
the BRDYSTS and/or BEMPSTS wrongly, and then, the transaction will not
finish.
Also since the driver should use the INTSTS0 and BRDYSTS and BEMPSTS
as the same timing, the patch protects them.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit c4d8199ba1a7aa390b06db23f4532e2c1875aefb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agousb: renesas_usbhs: fix the behavior of some usbhs_pkt_handle
Yoshihiro Shimoda [Fri, 22 Aug 2014 11:13:50 +0000 (20:13 +0900)]
usb: renesas_usbhs: fix the behavior of some usbhs_pkt_handle

Some gadget drivers will call usb_ep_queue() more than once before
the first queue doesn't finish. However, this driver didn't handle
it correctly. So, this patch fixes the behavior of some
usbhs_pkt_handle using the "running" flag. Otherwise, the oops below
happens if we use g_ncm driver and when the "iperf -u -c host -b 200M"
is running.

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 80000007 [#1] SMP ARM
Modules linked in: usb_f_ncm g_ncm libcomposite u_ether
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W      3.17.0-rc1-00008-g8b2be8a-dirty #20
task: c051c7e0 ti: c0512000 task.ti: c0512000
PC is at 0x0
LR is at usbhsf_pkt_handler+0xa8/0x114
pc : [<00000000>]    lr : [<c0278fb4>]    psr: 60000193
sp : c0513ce8  ip : c0513c58  fp : c0513d24
r10: 00000001  r9 : 00000193  r8 : eebec4a0
r7 : eebec410  r6 : eebe0c6c  r5 : 00000000  r4 : ee4a2774
r3 : 00000000  r2 : ee251e00  r1 : c0513cf4  r0 : ee4a2774

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 8355b2b3082d302091506703d2e4e239f7deed7f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agonet: sh_eth: fix driver dependencies
Bartlomiej Zolnierkiewicz [Mon, 1 Sep 2014 14:25:35 +0000 (16:25 +0200)]
net: sh_eth: fix driver dependencies

Renesas SuperH Ethernet support should be available only on
Renesas ARM SoCs and SuperH architecture.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f6ec9c335b502d8011971d07508589d212cb3c93)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rcar: Use && instead of & for boolean expressions
Lars-Peter Clausen [Sun, 17 Aug 2014 14:18:19 +0000 (16:18 +0200)]
ASoC: rcar: Use && instead of & for boolean expressions

Sparse spits out the following warning:
sound/soc/sh/rcar/gen.c:250:21: warning: dubious: x & !y

It does this because sometimes mixing boolean and bit-wise logic has not the
intended result. In this case we are fine, but replacing the bit-wise '&' with
the boolean '&&' silences the sparse warning. The generated code for both cases
is the same.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c8e6e960733f4a5835265c15429fced4d2f1595e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoRevert "i2c: rcar: remove spinlock"
Sergei Shtylyov [Sat, 23 Aug 2014 20:44:09 +0000 (00:44 +0400)]
Revert "i2c: rcar: remove spinlock"

This reverts commit 150b8be3cda54412ad7b54f5392b513b25c0aaa7.

The I2C core's per-adapter locks can't protect from IRQs, so the driver still
needs a spinlock to protect the register accesses.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 91bfe2989af02e709ca01ccf518c4fbda3efc70f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>