platform/kernel/linux-amlogic.git
12 months agonet: bcmdhd: Fix build error without AMLOGIC_WIFI 64/293664/1
Seung-Woo Kim [Thu, 1 Jun 2023 09:27:54 +0000 (18:27 +0900)]
net: bcmdhd: Fix build error without AMLOGIC_WIFI

Fix build error without CONFIG_AMLOGIC_WIFI.

Change-Id: Ice94923cb40d653fd0fcc0102c0f03131f1eeedb
Fixes: 20f1a0173d60 ("VIM3/VIM3L: add bcmdhd driver")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
12 months agommc: card: Fix build error without AMLOGIC_MMC 63/293663/1
Seung-Woo Kim [Thu, 1 Jun 2023 02:14:44 +0000 (11:14 +0900)]
mmc: card: Fix build error without AMLOGIC_MMC

Fix build error without CONFIG_AMLOGIC_MMC.

Change-Id: I3a76432c4441b50e372c4393030f191a9cec9b4d
Fixes: a0ed97ec7c26 ("emmc: ffu: add emmc ffu update support [1/1]")
Fixes: 4ee9cb927f1c ("sdio: optimize sdio suspend/resume [1/1]")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
12 months agonet: phy: realtek: Fix build error without KHADAS_MCU 62/293662/1
Seung-Woo Kim [Thu, 1 Jun 2023 02:09:10 +0000 (11:09 +0900)]
net: phy: realtek: Fix build error without KHADAS_MCU

Fix build error without CONFIG_KHADAS_MCU.

Change-Id: Ie30a267d435dbec1d3eaee61612273394ec8a6fb
Fixes: b17ff38132a8 ("WOL: add forcereset support")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
12 months agoarm64: cpuinfo: Fix build error without AMLOGIC_CPU_INFO 61/293661/1
Seung-Woo Kim [Thu, 1 Jun 2023 02:05:27 +0000 (11:05 +0900)]
arm64: cpuinfo: Fix build error without AMLOGIC_CPU_INFO

Fix build error without CONFIG_AMLOGIC_CPU_INFO.

Change-Id: Ie1727b8052b588166cac946e7534449829914123
Fixes: cf5cd5b660e6 ("add device model to /proc/cpuinfo")
Fixes: c99869fc131c ("ODROID-COMMON: arch/arm64: Add device information to /proc/cpuinfo")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
12 months agostaging: android: ion: Fix build error without CONFIG_AMLOGIC_ION_CODEC_MM 60/293660/1
Seung-Woo Kim [Thu, 1 Jun 2023 01:57:57 +0000 (10:57 +0900)]
staging: android: ion: Fix build error without CONFIG_AMLOGIC_ION_CODEC_MM

The amlogic codec ion is not used, threre is build error.
Fix the build error with checking config option.

Change-Id: Id21dcb4285facd5ed8c22082d8923be2c460909b
Fixes: deca8a9c7029 ("ion_dev: add codec_mm heap for omx. [3/3]")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
12 months agophy/realtek: Fix null deference for g_phydev 87/293387/1 accepted/tizen/unified/20230531.034423
Seung-Woo Kim [Thu, 25 May 2023 11:00:30 +0000 (20:00 +0900)]
phy/realtek: Fix null deference for g_phydev

Amlogic wol support adds g_phydev global variable and it can be
accessed before setting. Fix not to access null g_phydev and
instead, setting the variable with phydev.

Change-Id: I3b6860431c9d0872b1d421d124522fef51cb4f65
Fixes: 254065327d58 ("phy/realtek: fixup suspend failed issue")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agonet: bcmdhd: Fix -Waddress warnings 40/292640/1
Seung-Woo Kim [Wed, 10 May 2023 04:58:12 +0000 (13:58 +0900)]
net: bcmdhd: Fix -Waddress warnings

Remove useless address comparison with null to fix -Waddress
warning.

Change-Id: I423d47226e1cbaf321789afff9ec358f96d5c2f2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agopackaging: ignore Werror for tools 92/292592/1
Seung-Woo Kim [Tue, 2 May 2023 09:16:04 +0000 (18:16 +0900)]
packaging: ignore Werror for tools

With gcc-12 and new binutils, there are some warnings in tools.
Do not cause error for the warnings.

Change-Id: I80d61e6d0fbddb0fa8ed5de2238556e51cbe5eb5
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agolibtraceevent: Fix build with binutils 2.35 91/292591/1
Ben Hutchings [Sat, 25 Jul 2020 01:06:23 +0000 (02:06 +0100)]
libtraceevent: Fix build with binutils 2.35

In binutils 2.35, 'nm -D' changed to show symbol versions along with
symbol names, with the usual @@ separator.  When generating
libtraceevent-dynamic-list we need just the names, so strip off the
version suffix if present.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit 39efdd94e314 to resolved gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I8bb940b7c02b919b0af16a499ff33a53472ed939

13 months agoperf bench: Share some global variables to fix build with gcc 10 90/292590/1
Arnaldo Carvalho de Melo [Mon, 2 Mar 2020 15:09:38 +0000 (12:09 -0300)]
perf bench: Share some global variables to fix build with gcc 10

Noticed with gcc 10 (fedora rawhide) that those variables were not being
declared as static, so end up with:

  ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/bench/perf-in.o] Error 1

Prefix those with bench__ and add them to bench/bench.h, so that we can
share those on the tools needing to access those variables from signal
handlers.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200303155811.GD13702@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit e4d9b04b973b to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ia77c2ea85375f9558384bfb588eb97c8ae0ccead

13 months agoperf bench: Fix 2 memory sanitizer warnings 89/292589/1
Ian Rogers [Sat, 12 Sep 2020 05:37:25 +0000 (22:37 -0700)]
perf bench: Fix 2 memory sanitizer warnings

Memory sanitizer warns if a write is performed where the memory being
read for the write is uninitialized. Avoid this warning by initializing
the memory.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200912053725.1405857-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit d2c73501a767 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I5ddf75c23c88777a9cee798d72605533d3a7f318

13 months agoperf symbols: dso->name is an array, no need to check it against NULL 88/292588/1
Arnaldo Carvalho de Melo [Mon, 13 Feb 2017 20:11:03 +0000 (17:11 -0300)]
perf symbols: dso->name is an array, no need to check it against NULL

As it will always evaluate to 'true', as reported by clang:

  util/map.c:390:36: error: address of array 'map->dso->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
          if (map && map->dso && (map->dso->name || map->dso->long_name)) {
                                  ~~~~~~~~~~^~~~ ~~
  util/map.c:393:22: error: address of array 'map->dso->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                  else if (map->dso->name)
                     ~~  ~~~~~~~~~~^~~~

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-x8cu007cly40kfp8xnpi9kya@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit 5eae7d842510 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I475ce43b3563aac9846e47444ba1d029bd43659a

13 months agoperf tests record: No need to test an array against NULL 87/292587/1
Arnaldo Carvalho de Melo [Mon, 13 Feb 2017 20:04:05 +0000 (17:04 -0300)]
perf tests record: No need to test an array against NULL

It will always evaluate to 'true', as clang warns:

    CC       /tmp/build/perf/tests/perf-record.o
    CC       /tmp/build/perf/tests/evsel-roundtrip-name.o
  tests/perf-record.c:69:24: error: comparison of array 'argv' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
          if (evlist == NULL || argv == NULL) {
                                ^~~~    ~~~~
  1 error generated.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-o4977g6p9b3peak9ct6ef48q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit 9ef6839bcce7 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I73cb74d3a0562b9f8ac71321fbdc3d43585502a4

13 months agoperf jit: Avoid returning garbage for a ret variable 86/292586/1
Arnaldo Carvalho de Melo [Thu, 13 Oct 2016 20:12:35 +0000 (17:12 -0300)]
perf jit: Avoid returning garbage for a ret variable

When the loop body isn't executed at all, then the 'ret' local variable,
that is uninitialized will be used as the return value.

This triggers this error on Alpine Linux:

    CC    /tmp/build/perf/util/demangle-java.o
    CC    /tmp/build/perf/util/demangle-rust.o
    CC       /tmp/build/perf/util/jitdump.o
    CC       /tmp/build/perf/util/genelf.o
  util/jitdump.c: In function 'jit_process':
  util/jitdump.c:622:3: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     fprintf(stderr, "injected: %s (%d)\n", path, ret);
     ^
  util/jitdump.c:584:6: note: 'ret' was declared here
    int ret;
        ^
    FLEX     /tmp/build/perf/util/parse-events-flex.c

  / $ gcc -v
  Using built-in specs.
  COLLECT_GCC=gcc
  COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/5.3.0/lto-wrapper
  Target: x86_64-alpine-linux-musl
  Configured with: /home/buildozer/aports/main/gcc/src/gcc-5.3.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
  +--build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 5.3.0' --enable-checking=release
  +--disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-esp
  +--enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmudflap --disable-libsanitizer --enable-shared
  +--enable-threads --enable-tls --with-system-zlib
  Thread model: posix
  gcc version 5.3.0 (Alpine 5.3.0)

But this so far got under the radar, not causing any build problem, till the
"perf jit: enable jitdump support without dwarf" gets applied, when the above
problem takes place, some combination of inlining or whatever, the problem
is real, so fix it by initializing the variable to zero.

Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Maciej Debski <maciejd@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lkml.kernel.org/r/20161013200437.GA12815@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit ef2c3e76d98d to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I603f27faeff2eafb0c92e2f749843159eaa09da1

13 months agoperf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename) 85/292585/1
Arnaldo Carvalho de Melo [Tue, 18 Jan 2022 12:02:43 +0000 (09:02 -0300)]
perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename)

Its more intention revealing, and if we're interested in the odd cases
where this may end up truncating we can do debug checks at one
centralized place.

Motivation, of all the container builds, fedora rawhide started
complaining of:

  util/machine.c: In function ‘machine__create_modules’:
  util/machine.c:1419:50: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
   1419 |                 snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name);
        |                                                  ^~
  In file included from /usr/include/stdio.h:894,
                   from util/branch.h:9,
                   from util/callchain.h:8,
                   from util/machine.c:7:
  In function ‘snprintf’,
      inlined from ‘maps__set_modules_path_dir’ at util/machine.c:1419:3,
      inlined from ‘machine__set_modules_path’ at util/machine.c:1473:9,
      inlined from ‘machine__create_modules’ at util/machine.c:1519:7:
  /usr/include/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’ output between 2 and 4352 bytes into a destination of size 4096

There are other places where we should use path__join(), but lets get rid of
this one first.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/YebZKjwgfdOz0lAs@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit 9d5f0c36438e to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Id4f265f2e11357acf0f0fcc1054a484e2bfc25ff

13 months agoperf pmu: Fix check for unset alias->unit array 84/292584/1
Arnaldo Carvalho de Melo [Wed, 15 Feb 2017 13:06:20 +0000 (10:06 -0300)]
perf pmu: Fix check for unset alias->unit array

The alias->unit field is an array, so to check that it is not set we
should see if it is an empty string, i.e. alias->unit[0], instead of
checking alias->unit != NULL, as this will _always_ evaluate to 'true'.

Pointed out by clang.

Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170214182435.GD4458@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit b30a7d1fc96d to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ia18ceb8d7176ab8fd69ce5c284064e88783553e2

13 months agoperf symbols: No need to check if sym->name is NULL 83/292583/1
Arnaldo Carvalho de Melo [Mon, 13 Feb 2017 19:52:15 +0000 (16:52 -0300)]
perf symbols: No need to check if sym->name is NULL

As it is an array, so will always evaluate to 'true', as reported by
clang:

  builtin-sched.c:2070:19: error: address of array 'sym->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                  if (sym && sym->name) {
                          ~~ ~~~~~^~~~
  1 warning generated.

So just ditch all those useless checks.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-ydpm927col06paixb775jjx5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit a7c3899c0686 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I512d780fa0d3420ee4d24d61f1fcdc78c6ed73bc

13 months agoperf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STA... 82/292582/1
Arnaldo Carvalho de Melo [Wed, 14 Jul 2021 16:06:38 +0000 (13:06 -0300)]
perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE)

In fedora rawhide the PTHREAD_STACK_MIN define may end up expanded to a
sysconf() call, and that will return 'long int', breaking the build:

    45 fedora:rawhide                : FAIL gcc version 11.1.1 20210623 (Red Hat 11.1.1-6) (GCC)
      builtin-sched.c: In function 'create_tasks':
      /git/perf-5.14.0-rc1/tools/include/linux/kernel.h:43:24: error: comparison of distinct pointer types lacks a cast [-Werror]
         43 |         (void) (&_max1 == &_max2);              \
            |                        ^~
      builtin-sched.c:673:34: note: in expansion of macro 'max'
        673 |                         (size_t) max(16 * 1024, PTHREAD_STACK_MIN));
            |                                  ^~~
      cc1: all warnings being treated as errors

  $ grep __sysconf /usr/include/*/*.h
  /usr/include/bits/pthread_stack_min-dynamic.h:extern long int __sysconf (int __name) __THROW;
  /usr/include/bits/pthread_stack_min-dynamic.h:#   define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)
  /usr/include/bits/time.h:extern long int __sysconf (int);
  /usr/include/bits/time.h:# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
  $

So cast it to int to cope with that.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: backport upstream commit d08c84e01afa to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I4dda307e1570566918ef9140f2e88da22d40d4df

13 months agonet: rtl88xx: Fix build warnings with gcc-12 81/292581/1
Seung-Woo Kim [Thu, 4 May 2023 11:16:05 +0000 (20:16 +0900)]
net: rtl88xx: Fix build warnings with gcc-12

The gcc-12 has -Wmisleading-indentation and -Waddress warnings.
Fix those build warnings.

Change-Id: I7a647b612f131061a429e6c7756ae104e855f507
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agonet: rtl88xx: Fix stringop-overread warnings 80/292580/1
Seung-Woo Kim [Mon, 8 May 2023 03:36:41 +0000 (12:36 +0900)]
net: rtl88xx: Fix stringop-overread warnings

Reading variable lenght from length 40 char array causes stringop-
overread build warnings. Fix the warnings by adjusting size with
min value.

Change-Id: I0661bd7f62cba127c965c429a5eccfce6b74fa82
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoath9k: remove unnecessary code 79/292579/1
Gustavo A. R. Silva [Tue, 9 May 2017 13:04:30 +0000 (08:04 -0500)]
ath9k: remove unnecessary code

The array field eeprom_data in struct th9k_platform_data
is a fixed size array so it can never be NULL.

Addresses-Coverity-ID: 1364903
Cc: Arend Van Spriel <arend.vanspriel@broadcom.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
[sw0312.kim: backport upstream commit 641c1f4ab7f6 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I22a7282d73ac13f190fe8acc0b433abed128d71d

13 months agoath10k: remove unnecessary code 78/292578/1
Gustavo A. R. Silva [Fri, 19 May 2017 08:54:00 +0000 (11:54 +0300)]
ath10k: remove unnecessary code

The array fields in struct wmi_start_scan_arg that are checked here are
fixed size arrays so they can never be NULL.

Addresses-Coverity-ID: 1260031
Cc: Arend Van Spriel <arend.vanspriel@broadcom.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
[sw0312.kim: backport upstream commit 8c1f20815231 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ie7096cc6bd0bc8280c44bf124e49aa06e49b9bd9

13 months agogator: Remove useless null check 77/292577/1
Seung-Woo Kim [Thu, 4 May 2023 01:11:12 +0000 (10:11 +0900)]
gator: Remove useless null check

Checking null for array address returns true always, so -Waddress
gives build warning from gcc 12. Remove the useless null check.

Change-Id: I7caecc1edc6adae3b0652a28f6eea91a9546a05d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agousb: dtc_otg: pcd: fix misleading indentation warning 76/292576/1
Seung-Woo Kim [Wed, 3 May 2023 05:28:45 +0000 (14:28 +0900)]
usb: dtc_otg: pcd: fix misleading indentation warning

Fix build warning for -Wmisleading-indentation.

Change-Id: I95f0d5b85d0b3826b53a4f68166a7824930c799c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: frame_provider: Remove useless null check 75/292575/1
Seung-Woo Kim [Thu, 4 May 2023 01:56:45 +0000 (10:56 +0900)]
amlogic: frame_provider: Remove useless null check

Checking null for array address returns true always, so -Waddress
gives build warning from gcc 12. Remove the useless null check.

Change-Id: I17b7c67627a7f1fbcdd8044be0254159f86e3693
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: stream_input: Fix misleading indentation warning 74/292574/1
Seung-Woo Kim [Thu, 4 May 2023 01:19:59 +0000 (10:19 +0900)]
amlogic: stream_input: Fix misleading indentation warning

Fix build warning from -Wmisleading-indentation.

Change-Id: Ic4b48d79e2c817c076e1a547198c990946d65b78
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: avs2: Remove useless null check 73/292573/1
Seung-Woo Kim [Thu, 4 May 2023 01:15:52 +0000 (10:15 +0900)]
amlogic: avs2: Remove useless null check

Checking null for array address returns true always, so -Waddress
gives build warning from gcc 12. Remove the useless null check.

Change-Id: Iaecf9f867f981eb59e39d217eb5a634e246b483a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: hdmitx: Fix stringop-overread warning 72/292572/1
Seung-Woo Kim [Wed, 3 May 2023 10:49:08 +0000 (19:49 +0900)]
amlogic: hdmitx: Fix stringop-overread warning

There is copying size 3 from one space string and it causes
stringop-overread warning. Fix to copy from three spaces string.

Change-Id: Iee4f9de77ab8f990d7ecc06ea18ebba1e56839ea
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: osd: Fix misleading indentation warning 71/292571/1
Seung-Woo Kim [Wed, 3 May 2023 09:50:09 +0000 (18:50 +0900)]
amlogic: osd: Fix misleading indentation warning

Fix build warning from -Wmisleading-identation.

Change-Id: I603465ae55a96bac2fb142724902c6bd030e2e99
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: ionvideo: Fix to check memory address instead of array 70/292570/1
Seung-Woo Kim [Wed, 3 May 2023 09:54:25 +0000 (18:54 +0900)]
amlogic: ionvideo: Fix to check memory address instead of array

There is wrong address null check with array. Instead, fix to
check passed physical memory address properly.

Change-Id: I2cf422795585b68d9cd216737e78d478097e7e36
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: avsync: Fix misleading indentation warning 69/292569/1
Seung-Woo Kim [Wed, 3 May 2023 09:13:45 +0000 (18:13 +0900)]
amlogic: avsync: Fix misleading indentation warning

Fix build warning form -Wmisleading-indentation.

Change-Id: I2514024301126d422401689b6bcd0cec27ec6ad0
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: amvecm: Fix misleading identation warnings 68/292568/1
Seung-Woo Kim [Wed, 3 May 2023 06:56:30 +0000 (15:56 +0900)]
amlogic: amvecm: Fix misleading identation warnings

Fix build warnings from -Wmisleading-indentation.

Change-Id: I2c03c3128062332ef2e069fbd631f57983f42707
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: deinterlace: Fix misleading indentation warning 67/292567/1
Seung-Woo Kim [Wed, 3 May 2023 06:08:53 +0000 (15:08 +0900)]
amlogic: deinterlace: Fix misleading indentation warning

Fix build warning from -Wmisleading-indentation.

Change-Id: I3ef5e29103ec379107675ec864cc9edd71ff31aa
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoamlogic: rdma: fix misleading indentation warning 66/292566/1
Seung-Woo Kim [Wed, 3 May 2023 05:31:04 +0000 (14:31 +0900)]
amlogic: rdma: fix misleading indentation warning

Fix build warning from -Wmisleading-indentation.

Change-Id: Iba756d18eb6743130f05e435c30bb983a49cc966
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agosched/core: fix build warning without CONFIG_CPUMASK_OFFSTACK 65/292565/1
Seung-Woo Kim [Wed, 3 May 2023 06:59:07 +0000 (15:59 +0900)]
sched/core: fix build warning without CONFIG_CPUMASK_OFFSTACK

Without CONFIG_CPUMASK_OFFSTACK, checking the address of the
cpumask_var_t gives warning. To resolve the warning, use
cpumask_available() instead of checking the pointer directly.

Change-Id: I00b5a90015a304a4b1151afd1074acf9c542cb55
Ref: commit e78c59fda86c ("cpumask: Add helper cpumask_available()")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agokernel/profile.c: use cpumask_available to check for NULL cpumask 64/292564/1
Nathan Chancellor [Thu, 5 Dec 2019 00:50:50 +0000 (16:50 -0800)]
kernel/profile.c: use cpumask_available to check for NULL cpumask

When building with clang + -Wtautological-pointer-compare, these
instances pop up:

  kernel/profile.c:339:6: warning: comparison of array 'prof_cpu_mask' not equal to a null pointer is always true [-Wtautological-pointer-compare]
          if (prof_cpu_mask != NULL)
              ^~~~~~~~~~~~~    ~~~~
  kernel/profile.c:376:6: warning: comparison of array 'prof_cpu_mask' not equal to a null pointer is always true [-Wtautological-pointer-compare]
          if (prof_cpu_mask != NULL)
              ^~~~~~~~~~~~~    ~~~~
  kernel/profile.c:406:26: warning: comparison of array 'prof_cpu_mask' not equal to a null pointer is always true [-Wtautological-pointer-compare]
          if (!user_mode(regs) && prof_cpu_mask != NULL &&
                                ^~~~~~~~~~~~~    ~~~~
  3 warnings generated.

This can be addressed with the cpumask_available helper, introduced in
commit f7e30f01a9e2 ("cpumask: Add helper cpumask_available()") to fix
warnings like this while keeping the code the same.

Link: https://github.com/ClangBuiltLinux/linux/issues/747
Link: http://lkml.kernel.org/r/20191022191957.9554-1-natechancellor@gmail.com
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[sw0312.kim: backport upstream commit ef70eff9dea6 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ifbe97caa3ee7b2db0f071ba036218db7fe5a58fd

13 months agoUSB: serial: console: clean up sanity checks 63/292563/1
Johan Hovold [Wed, 8 Feb 2017 17:53:09 +0000 (18:53 +0100)]
USB: serial: console: clean up sanity checks

Drop two redundant NULL checks from usb_serial_console_disconnect().

The usb_serial_console_disconnect function is called from the
USB-serial-device disconnect callback when a device is going away. Hence
there is no need to check for the serial-device pointer being NULL.

The serial-device port pointers are stored in an array that is a member
of the serial struct so the address of the first member of the array
(which the array name decays to) is never NULL either.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
[sw0312.kim: backport upstream commit 0e517c93dc02 to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ia32e9685c652ee25704be755fa5788bf93b16a82

13 months agoetherdevice: Adjust ether_addr* prototypes to silence -Wstringop-overead 62/292562/1
Kees Cook [Sat, 12 Feb 2022 17:14:49 +0000 (09:14 -0800)]
etherdevice: Adjust ether_addr* prototypes to silence -Wstringop-overead

commit 2618a0dae09ef37728dab89ff60418cbe25ae6bd upstream.

With GCC 12, -Wstringop-overread was warning about an implicit cast from
char[6] to char[8]. However, the extra 2 bytes are always thrown away,
alignment doesn't matter, and the risk of hitting the edge of unallocated
memory has been accepted, so this prototype can just be converted to a
regular char *. Silences:

net/core/dev.c: In function ‘bpf_prog_run_generic_xdp’: net/core/dev.c:4618:21: warning: ‘ether_addr_equal_64bits’ reading 8 bytes from a region of size 6 [-Wstringop-overread]
 4618 |         orig_host = ether_addr_equal_64bits(eth->h_dest, > skb->dev->dev_addr);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/core/dev.c:4618:21: note: referencing argument 1 of type ‘const u8[8]’ {aka ‘const unsigned char[8]’}
net/core/dev.c:4618:21: note: referencing argument 2 of type ‘const u8[8]’ {aka ‘const unsigned char[8]’}
In file included from net/core/dev.c:91: include/linux/etherdevice.h:375:20: note: in a call to function ‘ether_addr_equal_64bits’
  375 | static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
      |                    ^~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/netdev/20220212090811.uuzk6d76agw2vv73@pengutronix.de
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick stable linux-4.9.y commit 096879ef0c4c to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: If57b1d1c9b0027abba79c34b384de87ef9c45db2

13 months agohugetlbfs: hugetlb_fault_mutex_hash() cleanup 61/292561/1
Mike Kravetz [Sun, 1 Dec 2019 01:56:30 +0000 (17:56 -0800)]
hugetlbfs: hugetlb_fault_mutex_hash() cleanup

commit 552546366a30d88bd1d6f5efe848b2ab50fd57e5 upstream.

A new clang diagnostic (-Wsizeof-array-div) warns about the calculation
to determine the number of u32's in an array of unsigned longs.
Suppress warning by adding parentheses.

While looking at the above issue, noticed that the 'address' parameter
to hugetlb_fault_mutex_hash is no longer used.  So, remove it from the
definition and all callers.

No functional change.

Link: http://lkml.kernel.org/r/20190919011847.18400-1-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Ilie Halip <ilie.halip@gmail.com>
Cc: David Bolvansky <david.bolvansky@gmail.com>
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>
[sw0312.kim: cherry-pick stable linux-4.9.y commit 96f7d5fd6d9d to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I3919e2d8c8edc1d3ad3825789824063397083145

13 months agokernel/extable.c: use address-of operator on section symbols 60/292560/1
Nathan Chancellor [Tue, 7 Apr 2020 03:09:27 +0000 (20:09 -0700)]
kernel/extable.c: use address-of operator on section symbols

Clang warns:

../kernel/extable.c:37:52: warning: array comparison always evaluates to
a constant [-Wtautological-compare]
        if (main_extable_sort_needed && __stop___ex_table > __start___ex_table) {
                                                          ^
1 warning generated.

These are not true arrays, they are linker defined symbols, which are just
addresses.  Using the address of operator silences the warning and does
not change the resulting assembly with either clang/ld.lld or gcc/ld
(tested with diff + objdump -Dr).

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/892
Link: http://lkml.kernel.org/r/20200219202036.45702-1-natechancellor@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[sw0312.kim: cherry-pick upstream commit 63174f61dfae to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Iead005392ebb5b2b334a7eae324883cc5f75c2cc

13 months agomm: page_alloc: fix building error on -Werror=array-compare 59/292559/1
Xiongwei Song [Fri, 14 Jan 2022 22:07:24 +0000 (14:07 -0800)]
mm: page_alloc: fix building error on -Werror=array-compare

commit ca831f29f8f25c97182e726429b38c0802200c8f upstream.

Arthur Marsh reported we would hit the error below when building kernel
with gcc-12:

  CC      mm/page_alloc.o
  mm/page_alloc.c: In function `mem_init_print_info':
  mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare]
   8173 |                 if (start <= pos && pos < end && size > adj) \
        |

In C++20, the comparision between arrays should be warned.

Link: https://lkml.kernel.org/r/20211125130928.32465-1-sxwjean@me.com
Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick stable linux-4.9.y commit 27057333467c to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ifd2e97713a205497b95d26ee20a248b63dd0104b

13 months agolibsubcmd: Fix use-after-free for realloc(..., 0) 58/292558/1
Kees Cook [Sun, 13 Feb 2022 18:24:43 +0000 (10:24 -0800)]
libsubcmd: Fix use-after-free for realloc(..., 0)

commit 52a9dab6d892763b2a8334a568bd4e2c1a6fde66 upstream.

GCC 12 correctly reports a potential use-after-free condition in the
xrealloc helper. Fix the warning by avoiding an implicit "free(ptr)"
when size == 0:

In file included from help.c:12:
In function 'xrealloc',
    inlined from 'add_cmdname' at help.c:24:2: subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
   56 |                 ret = realloc(ptr, size);
      |                       ^~~~~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to 'realloc' here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
   58 |                         ret = realloc(ptr, 1);
      |                               ^~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to 'realloc' here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~

Fixes: 2f4ce5ec1d447beb ("perf tools: Finalize subcmd independence")
Reported-by: Valdis Klētnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Kees Kook <keescook@chromium.org>
Tested-by: Valdis Klētnieks <valdis.kletnieks@vt.edu>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: linux-hardening@vger.kernel.org
Cc: Valdis Klētnieks <valdis.kletnieks@vt.edu>
Link: http://lore.kernel.org/lkml/20220213182443.4037039-1-keescook@chromium.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick stable linux-4.9.y commit 3c5ba8d82f5c to resolve gcc-12 build issue]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ic5f4a0a45c6d4a0fed2612b2e66c1b5a42f6c671

14 months agoblk-mq: Create hctx for each present CPU 84/290884/2 accepted/tizen/unified/20230406.165743
Christoph Hellwig [Mon, 26 Jun 2017 10:20:57 +0000 (12:20 +0200)]
blk-mq: Create hctx for each present CPU

Currently we only create hctx for online CPUs, which can lead to a lot
of churn due to frequent soft offline / online operations.  Instead
allocate one for each present CPU to avoid this and dramatically simplify
the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <keith.busch@intel.com>
Cc: linux-block@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
Link: http://lkml.kernel.org/r/20170626102058.10200-3-hch@lst.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: backport mainline commit 4b855ad37194 to fix possible deadlock in blk-mq for cpu hotplug]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I019f976ab755a38f4c783e94c73a4ff60114a648

14 months agoblk-mq: Register <dev>/queue/mq after having registered <dev>/queue 83/290883/2
Bart Van Assche [Wed, 26 Apr 2017 20:47:48 +0000 (13:47 -0700)]
blk-mq: Register <dev>/queue/mq after having registered <dev>/queue

A later patch in this series will modify blk_mq_debugfs_register()
such that it uses q->kobj.parent to determine the name of a
request queue. Hence make sure that that pointer is initialized
before blk_mq_debugfs_register() is called. To avoid lock inversion,
protect sysfs / debugfs registration with the queue sysfs_lock
instead of the global mutex all_q_mutex.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[sw0312.kim: backport mainline commit 2d0364c8c1a9 to fix possible deadlock in blk-mq for cpu hotplug]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Id43aae4f67f6aa43b5ad0ccd19b8f40baab337b8

14 months agoblock: do not allow updates through sysfs until registration completes 82/290882/2
Tahsin Erdogan [Wed, 15 Feb 2017 03:27:38 +0000 (19:27 -0800)]
block: do not allow updates through sysfs until registration completes

When a new disk shows up, sysfs queue directory is created before elevator
is registered. This allows a user to attempt a scheduler switch even though
the initial registration hasn't completed yet.

In one scenario, blk_register_queue() calls elv_register_queue() and
right before cfq_registered_queue() is called, another process executes
elevator_switch() and replaces q->elevator with deadline scheduler. When
cfq_registered_queue() executes it interprets e->elevator_data as struct
cfq_data even though it is actually struct deadline_data.

Grab q->sysfs_lock in blk_register_queue() to synchronize with sysfs
callers.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[sw0312.kim: backport mainline commit b410aff2bd9f to fix possible deadlock in blk-mq for cpu hotplug]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ifcdada904f565a7eb456d7b69966f7408ac256a3

14 months agobcmdhd: fix possible deadlock during dhdsdio_probe() andn dhdsdio_release() 86/290786/3 accepted/tizen/unified/20230404.140026
Seung-Woo Kim [Mon, 3 Apr 2023 07:53:16 +0000 (16:53 +0900)]
bcmdhd: fix possible deadlock during dhdsdio_probe() andn dhdsdio_release()

Not only during probe but also during release, there is lock
inversion. Remove those lock inversions to fix possible deadlock.

Note: during dhdsdio_probe(), there is still lock inversion
missed from the commit cd03083b2410 ("bcmdhd: fix possible
deadlock during dhdsdio_probe()").

Change-Id: I8c1fb82c3ebaa7ccf58c1e01c94b1d005df42179
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
14 months agobcmdhd: fix possible deadlock during dhdsdio_probe() 83/290583/2
Seung-Woo Kim [Wed, 29 Mar 2023 08:06:50 +0000 (17:06 +0900)]
bcmdhd: fix possible deadlock during dhdsdio_probe()

During dhdsdio_probe, before locking rtnl_lock with
dhd_register_if(), unlock _dhd_mutex_lock_ to avoid
possible deadlock with dhd_open().

This fixes following possible deadlock:
   ======================================================
   [ INFO: possible circular locking dependency detected ]
   4.9.241-TIZEN-amlogic-kvim+ #2 Not tainted
   -------------------------------------------------------
   net-config/516 is trying to acquire lock:
    (_dhd_mutex_lock_){+.+.+.}, at: [<ffffff80021b2f44>] dhd_open+0xd4/0x4b0 [dhd]

   but task is already holding lock:
    (rtnl_mutex){+.+.+.}, at: [<ffffff8009db8028>] rtnl_lock+0x20/0x28

   which lock already depends on the new lock.

   the existing dependency chain (in reverse order) is:

   -> #1 (rtnl_mutex){+.+.+.}:
          __lock_acquire+0x1514/0x1890
          lock_acquire+0xcc/0x278
          mutex_lock_nested+0x88/0x3f8
          rtnl_lock+0x20/0x28
          wiphy_register+0x444/0x600
          wl_cfg80211_attach+0x248/0x12a0 [dhd]
          dhd_attach+0x43c/0xc98 [dhd]
          dhdsdio_probe+0x16c/0x668 [dhd]
          bcmsdh_probe+0x12c/0x238 [dhd]
          bcmsdh_sdmmc_probe+0x110/0x300 [dhd]
          sdio_bus_probe+0xac/0x180
          driver_probe_device+0x214/0x2c8
          __driver_attach+0xd0/0xd8
          bus_for_each_dev+0x78/0xd8
          driver_attach+0x30/0x40
          bus_add_driver+0x1c4/0x230
          driver_register+0x6c/0x110
          sdio_register_driver+0x30/0x40
          bcmsdh_register_client_driver+0x1c/0x30 [dhd]
          bcmsdh_register+0x44/0x90 [dhd]
          dhd_bus_register+0x28/0x68 [dhd]
          dhd_wifi_platform_load+0x2bc/0x508 [dhd]
          dhd_wifi_platform_register_drv+0xe8/0x198 [dhd]
          0xffffff80022f309c
          do_one_initcall+0x58/0x168
          do_init_module+0x64/0x1cc
          load_module+0x2010/0x2678
          SyS_finit_module+0xd4/0xf0
          __sys_trace_return+0x0/0x4

   -> #0 (_dhd_mutex_lock_){+.+.+.}:
          print_circular_bug+0x7c/0x2e0
          __lock_acquire+0x1440/0x1890
          lock_acquire+0xcc/0x278
          mutex_lock_nested+0x88/0x3f8
          dhd_open+0xd4/0x4b0 [dhd]
          __dev_open+0xe4/0x150
          __dev_change_flags+0xa0/0x160
          dev_change_flags+0x34/0x70
          devinet_ioctl+0x76c/0x868
          inet_ioctl+0x140/0x158
          sock_do_ioctl+0x40/0x80
          sock_ioctl+0x260/0x340
          do_vfs_ioctl+0xc4/0x898
          SyS_ioctl+0x8c/0xa8
          __sys_trace_return+0x0/0x4

   other info that might help us debug this:

    Possible unsafe locking scenario:

          CPU0                    CPU1
          ----                    ----
     lock(rtnl_mutex);
                                  lock(_dhd_mutex_lock_);
                                  lock(rtnl_mutex);
     lock(_dhd_mutex_lock_);

    *** DEADLOCK ***

   1 lock held by net-config/516:
    #0:  (rtnl_mutex){+.+.+.}, at: [<ffffff8009db8028>] rtnl_lock+0x20/0x28

   stack backtrace:
   CPU: 3 PID: 516 Comm: net-config Not tainted 4.9.241-TIZEN-amlogic-kvim+ #2
   Hardware name: Khadas VIM3 (DT)
   Call trace:
   [<ffffff800908baa8>] dump_backtrace+0x0/0x2a8
   [<ffffff800908bdd4>] show_stack+0x24/0x30
   [<ffffff80095b92b0>] dump_stack+0xe4/0x12c
   [<ffffff8009121bd0>] print_circular_bug+0x1d0/0x2e0
   [<ffffff8009124898>] __lock_acquire+0x1440/0x1890
   [<ffffff800912510c>] lock_acquire+0xcc/0x278
   [<ffffff800a0eb0b8>] mutex_lock_nested+0x88/0x3f8
   [<ffffff80021b2f44>] dhd_open+0xd4/0x4b0 [dhd]
   [<ffffff8009da6fd4>] __dev_open+0xe4/0x150
   [<ffffff8009da7320>] __dev_change_flags+0xa0/0x160
   [<ffffff8009da7414>] dev_change_flags+0x34/0x70
   [<ffffff8009e8e4e4>] devinet_ioctl+0x76c/0x868
   [<ffffff8009e91280>] inet_ioctl+0x140/0x158
   [<ffffff8009d78110>] sock_do_ioctl+0x40/0x80
   [<ffffff8009d79490>] sock_ioctl+0x260/0x340
   [<ffffff80092a349c>] do_vfs_ioctl+0xc4/0x898
   [<ffffff80092a3cfc>] SyS_ioctl+0x8c/0xa8
   [<ffffff8009083a1c>] __sys_trace_return+0x0/0x4

Change-Id: I8afd6cb8e5ddec5588060715b2de6986de054fee
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
14 months agoamlogic: dmc: Remove __init section macro for code used from probe 06/290206/2 accepted/tizen/unified/20230322.164707
Seung-Woo Kim [Tue, 21 Mar 2023 10:45:35 +0000 (19:45 +0900)]
amlogic: dmc: Remove __init section macro for code used from probe

Data and function used by probe function should not be in __init
section. Remove __init and __initdata macros for code called from
probe.

Change-Id: Ibf0d06e6d5751a342db3531e83a186c83812963a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
14 months agoamlogic: Remove __init from probe functions 05/290205/2
Seung-Woo Kim [Tue, 21 Mar 2023 10:41:51 +0000 (19:41 +0900)]
amlogic: Remove __init from probe functions

Driver probe function can be run several times if it is built as
module, so it should not be __init function. Remove __init macro
from probe functions from amlogic drivers.

Change-Id: I59a0b29294a7c450a201e891666240f9704b91ce
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
14 months agoamlogic: drm: meson_gem: Fix a deadlock issue 82/290182/2
Jaehoon Chung [Tue, 21 Mar 2023 05:20:27 +0000 (14:20 +0900)]
amlogic: drm: meson_gem: Fix a deadlock issue

After enabled the lock debug config, the below message is displayed.

[   20.897676@5] =============================================
[   20.899234@5] [ INFO: possible recursive locking detected ]
[   20.904782@5] 4.9.241-TIZEN-amlogic-kvim+ #6 Not tainted
[   20.910067@5] ---------------------------------------------
[   20.915614@5] enlightenment/579 is trying to acquire lock:
[   20.921074@5]  (&dev->struct_mutex){+.+...}, at: [<ffffff80096db7d8>] drm_gem_object_unreference_unlocked+0x20/0x140
[   20.931561@5]
[   20.931561@5] but task is already holding lock:
[   20.937714@5]  (&dev->struct_mutex){+.+...}, at: [<ffffff8009c8a744>] am_meson_gem_cpu_fini_ioctl+0x34/0xe8
[   20.947421@5]
[   20.947421@5] other info that might help us debug this:
[   20.954267@5]  Possible unsafe locking scenario:
[   20.954267@5]
[   20.960507@5]        CPU0
[   20.963107@5]        ----
[   20.965707@5]   lock(&dev->struct_mutex);
[   20.969693@5]   lock(&dev->struct_mutex);
[   20.973680@5]
[   20.973680@5]  *** DEADLOCK ***
[   20.973680@5]
[   20.980094@5]  May be due to missing lock nesting notation
[   20.980094@5]
[   20.987201@5] 1 lock held by enlightenment/579:
[   20.991707@5]  #0:  (&dev->struct_mutex){+.+...}, at: [<ffffff8009c8a744>] am_meson_gem_cpu_fini_ioctl+0x34/0xe8
[   21.001847@5]
[   21.001847@5] stack backtrace:
[   21.006529@5] CPU: 5 PID: 579 Comm: enlightenment Not tainted 4.9.241-TIZEN-amlogic-kvim+ #6
[   21.014934@5] Hardware name: Khadas VIM3 (DT)
[   21.019268@5] Call trace:
[   21.021871@5] [<ffffff800908b9e8>] dump_backtrace+0x0/0x268
[   21.027415@5] [<ffffff800908bc78>] show_stack+0x28/0x38
[   21.032616@5] [<ffffff80095b46d4>] dump_stack+0xe0/0x12c
[   21.037903@5] [<ffffff8009122df4>] __lock_acquire+0x1064/0x1b28
[   21.043795@5] [<ffffff8009123e80>] lock_acquire+0xe8/0x288
[   21.049255@5] [<ffffff80096db808>] drm_gem_object_unreference_unlocked+0x50/0x140
[   21.056709@5] [<ffffff8009c8a7b8>] am_meson_gem_cpu_fini_ioctl+0xa8/0xe8
[   21.063382@5] [<ffffff80096dcbe4>] drm_ioctl+0x204/0x4a8
[   21.068670@5] [<ffffff80092a1a74>] do_vfs_ioctl+0x674/0x8e0
[   21.074215@5] [<ffffff80092a1d74>] SyS_ioctl+0x94/0xa8
[   21.079328@5] [<ffffff8009083a1c>] __sys_trace_return+0x0/0x4
[   21.166643@2] input: Virtual Key Device as /devices/virtual/input/input6

Change-Id: Iadb1df81b88b288f2d6841520ce55c2ee47cedef
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
14 months agoamlogic: hdmitx: Remove undefined pm ops 11/290011/1
Seung-Woo Kim [Fri, 17 Mar 2023 06:22:09 +0000 (15:22 +0900)]
amlogic: hdmitx: Remove undefined pm ops

There is no pm ops for hdmitx, but it is called when
CONFIG_HIBERNATION is enabled. Just remove the not defined
pm ops.

Change-Id: I33a0f8a2e70490375e46850500dd52d30bdd5f8c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
14 months agoamlogic: osd: Block undefined INSTABOOT code with ifdef 10/290010/1
Seung-Woo Kim [Fri, 17 Mar 2023 06:05:33 +0000 (15:05 +0900)]
amlogic: osd: Block undefined INSTABOOT code with ifdef

In osd code, there is not defined INSTABOOT code block, but some
code is not wrapped with the config option #ifdef. Fix to block
INSTABOOT code block with ifdef properly.

Change-Id: I6b87e3f6448d70a5fff6afa15414a9a2b7490ad7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
14 months agoinclude/linux/notifier.h: SRCU: fix ctags 09/290009/1
Sam Protsenko [Fri, 2 Nov 2018 22:47:53 +0000 (15:47 -0700)]
include/linux/notifier.h: SRCU: fix ctags

ctags indexing ("make tags" command) throws this warning:

    ctags: Warning: include/linux/notifier.h:125:
    null expansion of name pattern "\1"

This is the result of DEFINE_PER_CPU() macro expansion.  Fix that by
getting rid of line break.

Similar fix was already done in commit 25528213fe9f ("tags: Fix
DEFINE_PER_CPU expansions"), but this one probably wasn't noticed.

Link: http://lkml.kernel.org/r/20181030202808.28027-1-semen.protsenko@linaro.org
Fixes: 9c80172b902d ("kernel/SRCU: provide a static initializer")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[sw0312.kim: backport upstream commit 94e297c50b52]

Change-Id: I151a20cbdf616fba7671ee805459942f48957c9f

16 months agotracing: Apply upper limit of pid to prevent buffer overflow 51/287651/2 accepted/tizen_7.0_unified tizen_7.0 accepted/tizen/7.0/unified/20230203.164135 accepted/tizen/unified/20230206.093830 accepted/tizen/unified/20230206.093947
Sung-hun Kim [Thu, 2 Feb 2023 03:05:37 +0000 (12:05 +0900)]
tracing: Apply upper limit of pid to prevent buffer overflow

A member array `map_pid_to_cmdline` is allocated as much as
PID_MAX_DEFAULT. There is no consideration when a given pid
exceeds PID_MAX_DEFAULT which can make buffer overflow.

This patch handles such cases by just returning -1 for a case
that the given pid exceeds PID_MAX_DEFAULT. For such cases,
the user of trace loses tgid information for a given pid.

Change-Id: I589eda187490eddbd26fa5300a288097842d9af0
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
17 months agoamlogic: drm: Add extcon hdmi connection uevent 51/286351/2 accepted/tizen/unified/20230106.165104
Hoegeun Kwon [Wed, 4 Jan 2023 04:02:03 +0000 (13:02 +0900)]
amlogic: drm: Add extcon hdmi connection uevent

Add extcon hdmi connection and disconnection uevent when extcon
module is enabled.

Change-Id: I95686a9ec15700966103aaa14a7fe2702bd30a3a
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
23 months agoarm64: dts: amlogic: VIM3/VIM3L/OdroidC4/OdroidN2: Use 256MB ion_cma heap 18/277218/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062824 accepted/tizen/7.0/unified/hotfix/20221116.110431 accepted/tizen/unified/20220704.213049 submit/tizen/20220704.040831 tizen_7.0_m2_release
Seung-Woo Kim [Mon, 4 Jul 2022 02:25:18 +0000 (11:25 +0900)]
arm64: dts: amlogic: VIM3/VIM3L/OdroidC4/OdroidN2: Use 256MB ion_cma heap

In amlogic target, drm gem is allocated from ion_cma heap. 128MB size is
not enough, so use 256MB ion_cma heap.

Change-Id: Idd328ec1a8cea4886c5528e815164556496a3324
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agopackaging: do not remove _localversion-rt 57/272957/2 accepted/tizen/unified/20220329.134539 submit/tizen/20220329.014943
Seung-Woo Kim [Mon, 28 Mar 2022 11:03:26 +0000 (20:03 +0900)]
packaging: do not remove _localversion-rt

The _localversion-rt is used to make localversion-rt from next
gbs incremental build. So removing it causes different result for
next gbs incremental build. Do not remove the _localversion-rt.

Change-Id: Ia9e3edad218dc3ff42698a8aba9a33510de53e3b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agopackaging: Change source name with spec name 26/272826/1 accepted/tizen/unified/20220328.131520 submit/tizen/20220328.020708
Seung-Woo Kim [Fri, 25 Mar 2022 06:42:33 +0000 (15:42 +0900)]
packaging: Change source name with spec name

To support gbs incremental build fully, the setup command in spec
should be without '-n' option. For it, change source name with
spec name to find source directory properly during build.

Change-Id: Iabe3edc88ea2792685bd1e48b1422cb732b323c2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agopackaging: Fix to use build dir path with source name 00/272700/2 accepted/tizen/unified/20220323.062707 submit/tizen/20220323.023335
Seung-Woo Kim [Wed, 23 Mar 2022 01:51:51 +0000 (10:51 +0900)]
packaging: Fix to use build dir path with source name

This spec has different spec name and source name and it causes
error during setup command if name is not set with '-n' option.
Fix to use build dir path with source name with '-n' option.

Change-Id: I5567e0bdf43836c8ee243ad894c1603fe8cce422
Fixes: commit 7ebcfd522cb2 ("spec: packaging and defconfigs")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agopackaging: Fix perf version with assigned value 99/272699/2
Seung-Woo Kim [Wed, 23 Mar 2022 01:17:11 +0000 (10:17 +0900)]
packaging: Fix perf version with assigned value

In the spec, there is no fullVersion define. Instead, fix perf
version with kernel version and build arch and chipset name.

Change-Id: Ie6ac3a66605a8bc107c5814f48a020df796f66ee
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agoscript: build RT kernels 14/272614/2 submit/tizen/20220322.224920 submit/tizen/20220323.180849
Łukasz Stelmach [Mon, 21 Mar 2022 22:18:37 +0000 (23:18 +0100)]
script: build RT kernels

Change-Id: Ie91739a89c49e8077c98d3ac34ffa1fdd3a3e5ba
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoscript: use localversion-amlogic 13/272613/2
Łukasz Stelmach [Mon, 21 Mar 2022 19:13:04 +0000 (20:13 +0100)]
script: use localversion-amlogic

Set custom version via localversion-amlogic file instead of EXTRVERSION
in the Makefile to avoid commiting automatically modified Makefile
by mistake.

Change-Id: I6c872eb26b8c6eb732fb6d47b5d05ef73a0418ea
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agospec: packaging and defconfigs 43/272443/3
Łukasz Stelmach [Tue, 22 Feb 2022 20:03:24 +0000 (21:03 +0100)]
spec: packaging and defconfigs

Add defconfig files to build RT kernels. Build additional RPM packages.

Change-Id: I2a789031f29a7c41de02e8ce980e51d0d9918403
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoRemove unused mutexes 42/272442/4
Łukasz Stelmach [Fri, 11 Mar 2022 21:21:23 +0000 (22:21 +0100)]
Remove unused mutexes

Due to changes introduced by the RT patch struct mutex no longer contains
fields that contain self-references. Without them several mutexes appear
as unused and can safely be remove to prevent compilation errors.

Change-Id: Iac3f0d26b5fb58908c69addd505b46b97b66b761
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agopatch-4.9.241-rt156-tizen.patch 41/272441/3
Clark Williams [Tue, 22 Feb 2022 19:03:47 +0000 (20:03 +0100)]
patch-4.9.241-rt156-tizen.patch

Apply patch-4.9.241-rt156 adjusted for the following commits in the history

25c6a63c469f8
6eaff2cd5830a
b7fdaa641fb95
1f998b3593797
26c2154816c76
005bf1ada3cd6
4b65a5db36278
2178e84423daa
b3ea9acfdc84f
7c4e0f0832a34
c02433dd6de32
5044292c36158
f791c42b6371b
8cd9ca2e48bc4
97d5fd27f7af6
a7e410c1359f3
91d7a0007aa40
47bbcd6bf8f92
60e98ef37d3dc
1a37dd20899c4
cffed7e631b56

Change-Id: I9421bdf156fa0b309833c83ec820ec1af8c710f0
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2 years agoscript: build: Fit to use out-of-tree build 85/272585/1
Seung-Woo Kim [Fri, 18 Mar 2022 09:50:49 +0000 (18:50 +0900)]
script: build: Fit to use out-of-tree build

The build script in amlogic has two board support. Built as
in-tree, re-build with differnt board causes almost fully changeed.
To avoid the unnecessary rebuild performance down, use out-of-tree
build with build directory for each board.

Change-Id: I9e4211c4ccfb55aed718ece7cb8b2f0a977351d3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agoscript: build: Fix to use proper odroid-n2 dt binary 84/272584/1
Seung-Woo Kim [Fri, 18 Mar 2022 09:55:21 +0000 (18:55 +0900)]
script: build: Fix to use proper odroid-n2 dt binary

The dt file meson64_odroidn2_drm.dts is merged into
meson64_odroidn2.dts fully. So fix to use proper dtb
from build script.

Change-Id: Ie867fba076dbe052675510a0060444fd00b85dfa
Fixes: commit 1156b464e225 ("arm64: dts: amlogic: Use only meson64_odroidn2.dtb for OdroidN2 boards")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agogpu/arm: utgard: Fix out of tree (O=...) builds 40/272440/2
Łukasz Stelmach [Tue, 1 Mar 2022 15:27:59 +0000 (16:27 +0100)]
gpu/arm: utgard: Fix out of tree (O=...) builds

Using file with $(src) path is not enough for out-of-tree build.
Fix with $(srctree) aslo.

Change-Id: Ibd8695a9e88afeec0eeadcb931bfee6efc103303
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agopackaging: add baselibs.conf file for VIM3 armv7l 68/269668/2 accepted/tizen/unified/20220121.001233 submit/tizen/20220120.082652
Jaehoon Chung [Thu, 20 Jan 2022 02:51:14 +0000 (11:51 +0900)]
packaging: add baselibs.conf file for VIM3 armv7l

Add baselibs.conf file to create VIM3 armv7l packages.
When it's using "prefix", it's adjusted all packages.
So it needs to copy to /boot about files under /usr/boot/.

Change-Id: Ic7473e16dcfd0fd6619b3bfc3daa9bb6e84d7f32
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agopackaging: remove unnecessary symlinks from modules 06/269606/1
Seung-Woo Kim [Wed, 19 Jan 2022 03:54:26 +0000 (12:54 +0900)]
packaging: remove unnecessary symlinks from modules

The symbolic links, build and source, are unnecessary because
source build path is not packaged in modules packages. Remove
the unnecessary symlinks from modules package.

Change-Id: Ia2dea44064d6747e89db571fa36d9ee7b695814c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2 years agof2fs: fix wrong checkpoint_changed value in f2fs_remount() 62/266762/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20211121.212438 accepted/tizen/unified/20211119.134218 submit/tizen/20211117.113146 submit/tizen_6.5/20211119.012519
Chao Yu [Thu, 18 Nov 2021 06:35:20 +0000 (15:35 +0900)]
f2fs: fix wrong checkpoint_changed value in f2fs_remount()

In f2fs_remount(), return value of test_opt() is an unsigned int type
variable, however when we compare it to a bool type variable, it cause
wrong result, fix it.

Fixes: 4354994f097d ("f2fs: checkpoint disabling")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[dwoo08.lee: backport from mainline commit 277afbde6ca2]
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Change-Id: Icd4dfff441bf84f605d8d09de7be89da88548654

2 years agof2fs: flush data when enabling checkpoint back 61/266761/1
Jaegeuk Kim [Wed, 17 Nov 2021 12:20:52 +0000 (21:20 +0900)]
f2fs: flush data when enabling checkpoint back

During checkpoint=disable period, f2fs bypasses all the synchronous IOs such as
sync and fsync. So, when enabling it back, we must flush all of them in order
to keep the data persistent. Otherwise, suddern power-cut right after enabling
checkpoint will cause data loss.

Fixes: 4354994 ("f2fs: checkpoint disabling")
Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[dwoo08.lee: backport from mainline commit b0ff4fe746fd]
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Change-Id: Ic0810d99c5a3938e191461bd66e7862a4a68e12b

2 years agof2fs: checkpoint disabling 60/266760/1
Daniel Rosenberg [Tue, 21 Aug 2018 02:21:43 +0000 (19:21 -0700)]
f2fs: checkpoint disabling

Note that, it requires "f2fs: return correct errno in f2fs_gc".

This adds a lightweight non-persistent snapshotting scheme to f2fs.

To use, mount with the option checkpoint=disable, and to return to
normal operation, remount with checkpoint=enable. If the filesystem
is shut down before remounting with checkpoint=enable, it will revert
back to its apparent state when it was first mounted with
checkpoint=disable. This is useful for situations where you wish to be
able to roll back the state of the disk in case of some critical
failure.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
[Jaegeuk Kim: use SB_RDONLY instead of MS_RDONLY]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[dwoo08.lee: port from android-common-kernel branch android-4.9-q commit f22f93a90601]
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Change-Id: I7020cb09b360b291b324baae71882e64a7776ed8

2 years agoARM: defconfig: disable ANDROID_LOGGER 91/266591/1 accepted/tizen/6.5/unified/20211116.084158 accepted/tizen/unified/20211116.130418 submit/tizen/20211116.032511 submit/tizen_6.5/20211116.032524
Jaehoon Chung [Tue, 16 Nov 2021 03:54:43 +0000 (12:54 +0900)]
ARM: defconfig: disable ANDROID_LOGGER

Disable ANDROID_LOGGER.

Change-Id: I0fa79d5f7829f59eb8467f4daa8e81a390ec57fa
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoBluetooth: Set le data length command and event 47/261647/1 accepted/tizen/6.5/unified/20211028.115810 accepted/tizen/unified/20210722.124831 submit/tizen/20210722.060806 submit/tizen_6.5/20211028.163201 tizen_6.5.m2_release
Sudha Bheemanna [Fri, 16 Sep 2016 10:07:22 +0000 (15:37 +0530)]
Bluetooth: Set le data length command and event

Sets the data length for the le data packet with in the
advised limits. MGMT command and event are added to handle
the setting of data length.

Change-Id: Ia5c2167743cc9a29190e5631973e9d52d41caa1d
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Read host suggested default le data length 46/261646/1
Sudha Bheemanna [Fri, 16 Sep 2016 07:24:31 +0000 (12:54 +0530)]
Bluetooth: Read host suggested default le data length

This patch adds MGMT command and code for supporting reading
default le data length value set at the controller.

Change-Id: I2b81982dc26ed5af4a8f8a3d3913db5d64625260
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Write host suggested default le data length 45/261645/1
Sudha Bheemanna [Fri, 16 Sep 2016 06:39:57 +0000 (12:09 +0530)]
Bluetooth: Write host suggested default le data length

This patch adds MGMT command and code for supporting write
default le data length command to the controller.

Change-Id: I3d2c8b622b7913a3ed542342e3ba8076c30dc279
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Read LE Max data length command 44/261644/1
Sudha Bheemanna [Fri, 16 Sep 2016 05:08:30 +0000 (10:38 +0530)]
Bluetooth: Read LE Max data length command

This patch adds the MGMT command and code to support reading
the maximum data length supported command for LE.

Change-Id: I4dc0041f2070de2ccb6a4164c8823612863c941e
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Fix IPSP connection callback event issue. 43/261643/1
h.sandeep [Fri, 16 Sep 2016 09:15:24 +0000 (14:45 +0530)]
Bluetooth: Fix IPSP connection callback event issue.

This patch fixes the IPSP connection callback event issue
between kernel and bluez layer.

Change-Id: Ia4d625aa8a6dbc9da89a7d9f12308af9c90d0594
Signed-off-by: h.sandeep <h.sandeep@samsung.com>
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: IPSP Connect/Disconnect apis 42/261642/1
Sudha Bheemanna [Thu, 15 Sep 2016 07:23:03 +0000 (12:53 +0530)]
Bluetooth: IPSP Connect/Disconnect apis

This patch adds MGMT code to support IPSP connect and
disconnect apis and handle connection state changed event.

Change-Id: I1c41ec4f38cf9a108e443def3bc23c1b964e2985
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add support to enable/disable IPSP 41/261641/1
Sudha Bheemanna [Thu, 15 Sep 2016 04:42:09 +0000 (10:12 +0530)]
Bluetooth: Add support to enable/disable IPSP

This patch supports MGMT commands and code to enable or disable
IPSP 6LowPan features.

Change-Id: Ia866ecfa517c7d7e4320f17d94d80dfeb9261e59
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Fix issue in the Set LE privacy function. 40/261640/1
Sudha Bheemanna [Thu, 8 Sep 2016 10:51:01 +0000 (16:21 +0530)]
Bluetooth: Fix issue in the Set LE privacy function.

This patch fixes not to check the hdev power before setting
LE Privacy.

Change-Id: I344ea13b1d90527e3e7554ec616cdc640b85159c
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Store the key if auth type is P192 39/261639/1
Sudha Bheemanna [Mon, 12 Sep 2016 07:16:44 +0000 (12:46 +0530)]
Bluetooth: Store the key if auth type is P192

This patch allows to store the key after authentication
if auth type is "HCI_LK_AUTH_COMBINATION_P192"

Change-Id: Ie44dbe7dfec361edab61aceaf9b2ca4057b88fa5
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Cancel the Sniff timer 38/261638/1
Sudha Bheemanna [Thu, 8 Sep 2016 11:31:39 +0000 (17:01 +0530)]
Bluetooth: Cancel the Sniff timer

This patch adds code to cancel the sniff timer.

Change-Id: I756d3b08acf6462044d1fb204064fe12ce1238c1
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Enable sniff mode for incoming connection 37/261637/1
Sudha Bheemanna [Thu, 8 Sep 2016 11:10:50 +0000 (16:40 +0530)]
Bluetooth: Enable sniff mode for incoming connection

Add provision to set the link poilicy to enable sniff mode
for incoming connection.

Change-Id: Ifff9e9f0838f26a6c96d81f4cbaae43429aa231f
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Modify fast connectable type. 36/261636/1
Sudha Bheemanna [Thu, 8 Sep 2016 10:31:23 +0000 (16:01 +0530)]
Bluetooth: Modify fast connectable type.

This patch modifies the fast connectable function
to just set the type.

Change-Id: I0cce96f85d823f9798ae7f147c4e33ce7b18e0e3
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Send Authentication Request command on pairing failure 35/261635/1
Sudha Bheemanna [Thu, 8 Sep 2016 09:41:28 +0000 (15:11 +0530)]
Bluetooth: Send Authentication Request command on pairing failure

This patch allows to send HCI_OP_AUTH_REQUESTED command
to the remote device if pairing failure happens because
of pin or key missing error.

Change-Id: I9c28394dc06b22fd5fe9e58ac0b7d728c086bde4
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Enable inquiry and page scan 34/261634/1
Sudha Bheemanna [Thu, 8 Sep 2016 09:24:54 +0000 (14:54 +0530)]
Bluetooth: Enable inquiry and page scan

This patch enables the inquiry and page scan after ACL
disconnection with one device and if there are no other
devices connected.

Change-Id: Ifb28be7d23f237d35112b2e0739ed55169baacf7
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Change authentication requirement. 33/261633/1
Sudha Bheemanna [Thu, 8 Sep 2016 07:34:11 +0000 (13:04 +0530)]
Bluetooth: Change authentication requirement.

This patch updates the authentication requirement to general
MITM if local and remote device IO capabilities are not
NO_INPUT_NO_OUTPUT.

Change-Id: Ie3955c3f8287418e74af20d40bdf30d0f1963e31
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Set link Supervision timeout for a connection 32/261632/1
Sudha Bheemanna [Thu, 8 Sep 2016 06:54:43 +0000 (12:24 +0530)]
Bluetooth: Set link Supervision timeout for a connection

This patch allows to set the supervision timeout for a connection
if the device role is master.

Change-Id: I7897167ec07803f3059f2ab4d3314b0b7a951533
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Set filter policy for LE connection 31/261631/1
Sudha Bheemanna [Thu, 8 Sep 2016 05:51:06 +0000 (11:21 +0530)]
Bluetooth: Set filter policy for LE connection

This patch sets the filter policy to a default value 0x01 during
LE auto connection if the destination address is not set. And it
updates the destination address once the LE connection complete
event is recieved during LE auto connection. And for it checks
valid destination address before cancelling LE connection when
connection timeout occurs.

Change-Id: I9877556c0b0ab4826f5f4934ead4d85b7837036d
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[squash patches, LE connection policy, set dest address and check dest address before cancelling connection]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Get Advertising TX power 30/261630/1
Sudha Bheemanna [Wed, 7 Sep 2016 09:52:08 +0000 (15:22 +0530)]
Bluetooth: Get Advertising TX power

This patch adds MGMT command to read the advertising TX power.

Change-Id: Ide9e5d332f034928d2eae2cbd68a025a0d42be1b
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Set the link for SCO connection 29/261629/1
Sudha Bheemanna [Thu, 8 Sep 2016 07:07:45 +0000 (12:37 +0530)]
Bluetooth: Set the link for SCO connection

This patch sets the link policy for SCO/eSCO connection.

Change-Id: I71caef5a3887f73a10329b6886c8cf52b80e8d37
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[add link policy setting in sco connection]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add MGMT command to set SCO settings 28/261628/1
Sudha Bheemanna [Tue, 6 Sep 2016 11:08:36 +0000 (16:38 +0530)]
Bluetooth: Add MGMT command to set SCO settings

Added code to set sco settings.

Change-Id: I37aa572436241b06e00d1e9e75964aac747eeba5
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[remove sco link policy part]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add multiple LE advertise state change event 27/261627/1
Sudha Bheemanna [Thu, 8 Sep 2016 05:01:17 +0000 (10:31 +0530)]
Bluetooth: Add multiple LE advertise state change event

This patch adds code for providing multiple LE advertisement state
changed event to upper layer.

Change-Id: I58fb8044e74402376ec30b121081edce7c8709d1
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[divide hci_vendor_mutli_adv_state_change_evt and remove hci event structure from mgmt]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add LE device found MGMT event 26/261626/1
Sudha Bheemanna [Thu, 8 Sep 2016 04:40:03 +0000 (10:10 +0530)]
Bluetooth: Add LE device found MGMT event

This patch adds new MGMT event for LE device discovery and allows
the handling of all advertisement packets in platform.

Change-Id: I1927acb75eff0b60a5899898c6d7a000e1a108ef
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: fix vendor ext rssi link alert event 25/261625/1
Seung-Woo Kim [Wed, 28 Sep 2016 16:59:05 +0000 (01:59 +0900)]
Bluetooth: fix vendor ext rssi link alert event

This patch fixes style for rssi link alert event from vendor
specific group ext.

Change-Id: I0e7003e417c5f5a590cce8264caccad515dd3c10
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add H/W TX timeout error MGMT event 24/261624/1
Sudha Bheemanna [Wed, 7 Sep 2016 11:17:58 +0000 (16:47 +0530)]
Bluetooth: Add H/W TX timeout error MGMT event

This patch sends the H/W TX timeout error MGMT event if HCI command
timeout occurs after sending HCI commands.

Change-Id: I5eb593f2fe4d31c404dd94ef582790e47d03b10a
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add hardware error MGMT event 23/261623/1
Sudha Bheemanna [Wed, 7 Sep 2016 10:12:22 +0000 (15:42 +0530)]
Bluetooth: Add hardware error MGMT event

Add code to handle hardware error MGMT event.

Change-Id: I5875ea2aeae7aba95c1f8e15b456704dc6bcdee4
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
2 years agoBluetooth: Add LE vendor specific event handler 22/261622/1
Sudha Bheemanna [Thu, 8 Sep 2016 05:26:15 +0000 (10:56 +0530)]
Bluetooth: Add LE vendor specific event handler

This patch adds the vendor specific LE meta event handler.
It handles the vendor specific handles like,
LE_MULTI_ADV_STATE_CHANGE_SUB_EVENT, LE_RSSI_LINK_ALERT.

Change-Id: I1f344a31e36f9c7442fe0bd8b598e67d9f5fb9bf
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[divide hci vendor speicif group event function]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>