Commit graph

889,574 commits

Author SHA1 Message Date
Shaleen Agrawal
7b4422b5a6 sched: Improve the scheduler
This change is for general scheduler improvement.

Change-Id: I4d4a3ca2068be977f8d6d06cd5c7be576abb629a
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2020-08-07 19:18:54 -07:00
Harshdeep Dhatt
2a1ab962b3 msm: kgsl: Add back power tracepoints to gmu and rgmu targets
This ensures compatibility with existing tools that rely on the important
power related tracepoints. Only need to print the tracepoints and no
need to modify the states.

Change-Id: I87432aff998cb21a22452a152bd5e6b8f59c0f75
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2020-08-07 17:54:11 -06:00
Harshdeep Dhatt
f91275238f msm: kgsl: Fix device check when enabling counters via cmdstream
This is because gmu and rgmu based targets don't use the
ADRENO_DEVICE_STARTED anymore. Instead, we can use KGSL_STATE_ACTIVE
which also indicates that the device is active.

Change-Id: I485c9366ee570084a0d6a8eb93423c568009fc19
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2020-08-07 17:50:56 -06:00
Harshdeep Dhatt
f4721b63c8 msm: kgsl: Do not capture DTCM on gmu boot failure
Accessing DTCM can cause NoC error sometimes if GMU is accessing
any of its TCMs at the same time as host.

Change-Id: I3d7a3169620854dbd659f378c216a7b15435c914
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2020-08-07 17:47:10 -06:00
Subbaraman Narayanamurthy
27ca1ceb92 leds: qti-flash: Fix error logging in qti_flash_led_symmetry_config()
If symmetry is enabled and user sets the brightness on switch
device directly without setting brightness on flash or torch
devices, then an error log is printed. Fix it.

Change-Id: I10cc9e3143173fb4ea9dad0ed078fde3594b6e54
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2020-08-07 16:31:03 -07:00
Jeya R
29854ac2bb msm: adsprpc: Put upper limit on IOMMU mapping size
Place appropriate validation checks for IOMMU mapping size. Without
these checks, a mapping in an invalid kernel space could be created
and fail during access.

Change-Id: I995c8c2a9ef8d746b8fc2433d6510dfa92596adc
Signed-off-by: Jeya R <jeyr@codeaurora.org>
2020-08-07 16:16:28 -07:00
Mike Tipton
f489c7adcf clk: qcom: gpucc-lahaina: Fix "stuck at on" warning
The gpu_cc_hlos1_vote_gpu_smmu_clk clock is votable by multiple masters,
so it won't always turn off when requested, since other masters can
still be voting for it. Change its halt_check to BRANCH_HALT_VOTED to
skip polling for it to turn off.

Change-Id: I8c8a0160a0055b3462c76df3fdd3403e12352e53
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
2020-08-07 11:31:03 -07:00
Anmolpreet Kaur
3a2a52e392 qseecom : Pass proper device node pointer
Pass proper device node pointer to
of_reserved_mem_device_init_by_idx so that
it contains the of_node data which is needed
by the api.

Change-Id: I327f95657628eaa2e0e4bf98a919e003cdae7a86
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-08-07 21:03:10 +05:30
Nitin Rawat
977028c755 scsi: ufs: Add workaround to bypass cfgready signal for UFS gear4
The tx_cfg_rdy signal from PHY to Controller to indicate
EOB(END OF BURST) runs using TX CFG clock which is half the Uniproclk
freq. But it is observed that tx_cfg_rdyn signal is getting sampled in
controller using Uniproclk (300 MHz) instead of TX CFG clock (150 MHz)
and hence FSM in controller is going into unwanted state when only
one of tx_cfg_rdyn_0 and tx_cfg_rdyn_1 is 0 around sampling clock edge.

To workaround this issue, control should bypass the Cfgready
signal(TX_CFGREADY and RX_CFGREDY) because controller stills wait
for another signal tx_savestatusn which will serve same purpose.

Change-Id: I2f32542682571ba6e7b1266393dfb1168dc68658
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
2020-08-07 17:55:42 +05:30
priyankar
e540b89dd6 Add support for returning power sources status
This patch contains changes for returning power sources status
to BT HAL and also setting value of SW CTRL for CHE chip.

Change-Id: I8a0349171a5bbd516b098cc5a070804a454c2b7d
Signed-off-by: priyankar <prigup@codeaurora.org>
2020-08-07 16:20:14 +05:30
Greg Kroah-Hartman
3f413d0ec7 This is the 5.4.57 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl8tBFAACgkQONu9yGCS
 aT6R3Q//aGf+Xj12a/Mi+uE7QwNxct2YA3ZM52Wd9NRf8bTcPkgNPijyC0G3Ug5g
 N5sl0lyUax74AkV+AbXzMlYsV47VOh5YmmHQVBpnR7IA6a2S5XalGYAttoLr/0YR
 SwqLzKWXPAcfxju2phdRQovMisljnzT/1pICV6zX2c/eFznTk/ZXVZjzAopwg4lS
 a3l7nots4zy9C8v8zRXm8shQNw+jnU3rXdhwA6yc8Tri+xM8ua7rrI/uHTJK4z//
 137/B5pcOAC4UVG1xWvAwfFz2j8CDnJIgahnNAxnAtYUe/auWwAzAhg3CMjknNNi
 ypOCxvRc3W6s5IuRh3mnIVTJ1TTA/4bEStZmC9RR8US//XgAQie09AA4e1UbXHxl
 8/RUe3O1P3wdaLkrntOG2hVHdMbxj+d/Ou4uNwf5iFq9nCuoCJJxZxEdZIojo/Rg
 9rWg9GdjNLgP0imk/4e586MgR41u+MSAHNqqxa3te58mvD9CQbsvwriYIXs2uGre
 HeuRfI4dFJya/txOYaVV7irPKZK1wdLbOj36+Rh/ARKkjjHU4RjfIh2h6+ACOzc0
 ncX21Lv9qfiSJeKcYyYZ3Xc4SlxF+GnUW1NmOsHwrBIx9RRUvnNWFEM6oQL4WiyJ
 QyYgqmuD44HdUvd4/iXVRelrYYrf3aHyLoVBVcjiAjnlb/LEkKM=
 =xcgc
 -----END PGP SIGNATURE-----

Merge 5.4.57 into android11-5.4

Changes in 5.4.57
	random32: update the net random state on interrupt and activity
	ARM: percpu.h: fix build error
	random: fix circular include dependency on arm64 after addition of percpu.h
	random32: remove net_rand_state from the latent entropy gcc plugin
	random32: move the pseudo-random 32-bit definitions to prandom.h
	arm64: Workaround circular dependency in pointer_auth.h
	ext4: fix direct I/O read error
	selftests: bpf: Fix detach from sockmap tests
	bpf: sockmap: Require attach_bpf_fd when detaching a program
	Linux 5.4.57

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3f51a779843eb1bc50ac6dc7fd9c3db66b2aea7f
2020-08-07 10:07:58 +02:00
Greg Kroah-Hartman
d9939285fc Linux 5.4.57
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:02 +02:00
Lorenz Bauer
ca7ace8fd2 bpf: sockmap: Require attach_bpf_fd when detaching a program
commit bb0de3131f4c60a9bf976681e0fe4d1e55c7a821 upstream.

The sockmap code currently ignores the value of attach_bpf_fd when
detaching a program. This is contrary to the usual behaviour of
checking that attach_bpf_fd represents the currently attached
program.

Ensure that attach_bpf_fd is indeed the currently attached
program. It turns out that all sockmap selftests already do this,
which indicates that this is unlikely to cause breakage.

Fixes: 604326b41a ("bpf, sockmap: convert to generic sk_msg interface")
Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200629095630.7933-5-lmb@cloudflare.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:02 +02:00
Lorenz Bauer
9fe975acb5 selftests: bpf: Fix detach from sockmap tests
commit f43cb0d672aa8eb09bfdb779de5900c040487d1d upstream.

Fix sockmap tests which rely on old bpf_prog_dispatch behaviour.
In the first case, the tests check that detaching without giving
a program succeeds. Since these are not the desired semantics,
invert the condition. In the second case, the clean up code doesn't
supply the necessary program fds.

Fixes: bb0de3131f4c ("bpf: sockmap: Require attach_bpf_fd when detaching a program")
Reported-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20200709115151.75829-1-lmb@cloudflare.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:02 +02:00
Jiang Ying
c776104353 ext4: fix direct I/O read error
This patch is used to fix ext4 direct I/O read error when
the read size is not aligned with block size.

Then, I will use a test to explain the error.

(1) Make a file that is not aligned with block size:
	$dd if=/dev/zero of=./test.jar bs=1000 count=3

(2) I wrote a source file named "direct_io_read_file.c" as following:

	#include <stdio.h>
	#include <stdlib.h>
	#include <unistd.h>
	#include <sys/file.h>
	#include <sys/types.h>
	#include <sys/stat.h>
	#include <string.h>
	#define BUF_SIZE 1024

	int main()
	{
		int fd;
		int ret;

		unsigned char *buf;
		ret = posix_memalign((void **)&buf, 512, BUF_SIZE);
		if (ret) {
			perror("posix_memalign failed");
			exit(1);
		}
		fd = open("./test.jar", O_RDONLY | O_DIRECT, 0755);
		if (fd < 0){
			perror("open ./test.jar failed");
			exit(1);
		}

		do {
			ret = read(fd, buf, BUF_SIZE);
			printf("ret=%d\n",ret);
			if (ret < 0) {
				perror("write test.jar failed");
			}
		} while (ret > 0);

		free(buf);
		close(fd);
	}

(3) Compile the source file:
	$gcc direct_io_read_file.c -D_GNU_SOURCE

(4) Run the test program:
	$./a.out

	The result is as following:
	ret=1024
	ret=1024
	ret=952
	ret=-1
	write test.jar failed: Invalid argument.

I have tested this program on XFS filesystem, XFS does not have
this problem, because XFS use iomap_dio_rw() to do direct I/O
read. And the comparing between read offset and file size is done
in iomap_dio_rw(), the code is as following:

	if (pos < size) {
		retval = filemap_write_and_wait_range(mapping, pos,
				pos + iov_length(iov, nr_segs) - 1);

		if (!retval) {
			retval = mapping->a_ops->direct_IO(READ, iocb,
						iov, pos, nr_segs);
		}
		...
	}

...only when "pos < size", direct I/O can be done, or 0 will be return.

I have tested the fix patch on Ext4, it is up to the mustard of
EINVAL in man2(read) as following:
	#include <unistd.h>
	ssize_t read(int fd, void *buf, size_t count);

	EINVAL
		fd is attached to an object which is unsuitable for reading;
		or the file was opened with the O_DIRECT flag, and either the
		address specified in buf, the value specified in count, or the
		current file offset is not suitably aligned.

So I think this patch can be applied to fix ext4 direct I/O error.

However Ext4 introduces direct I/O read using iomap infrastructure
on kernel 5.5, the patch is commit <b1b4705d54ab>
("ext4: introduce direct I/O read using iomap infrastructure"),
then Ext4 will be the same as XFS, they all use iomap_dio_rw() to do direct
I/O read. So this problem does not exist on kernel 5.5 for Ext4.

>From above description, we can see this problem exists on all the kernel
versions between kernel 3.14 and kernel 5.4. It will cause the Applications
to fail to read. For example, when the search service downloads a new full
index file, the search engine is loading the previous index file and is
processing the search request, it can not use buffer io that may squeeze
the previous index file in use from pagecache, so the serch service must
use direct I/O read.

Please apply this patch on these kernel versions, or please use the method
on kernel 5.5 to fix this problem.

Fixes: 9fe55eea7e ("Fix race when checking i_size on direct i/o read")
Reviewed-by: Jan Kara <jack@suse.cz>
Co-developed-by: Wang Long <wanglong19@meituan.com>
Signed-off-by: Wang Long <wanglong19@meituan.com>
Signed-off-by: Jiang Ying <jiangying8582@126.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:02 +02:00
Marc Zyngier
6330b0cb2a arm64: Workaround circular dependency in pointer_auth.h
With the backport of f227e3ec3b5c ("random32: update the net random
state on interrupt and activity") and its associated fixes, the
arm64 build explodes early:

In file included from ../include/linux/smp.h:67,
                  from ../include/linux/percpu.h:7,
                  from ../include/linux/prandom.h:12,
                  from ../include/linux/random.h:118,
                  from ../arch/arm64/include/asm/pointer_auth.h:6,
                  from ../arch/arm64/include/asm/processor.h:39,
                  from ../include/linux/mutex.h:19,
                  from ../include/linux/kernfs.h:12,
                  from ../include/linux/sysfs.h:16,
                  from ../include/linux/kobject.h:20,
                  from ../include/linux/of.h:17,
                  from ../include/linux/irqdomain.h:35,
                  from ../include/linux/acpi.h:13,
                  from ../include/acpi/apei.h:9,
                  from ../include/acpi/ghes.h:5,
                  from ../include/linux/arm_sdei.h:8,
                  from ../arch/arm64/kernel/asm-offsets.c:10:
../arch/arm64/include/asm/smp.h💯29: error: field ‘ptrauth_key’ has
incomplete type

This is due to struct ptrauth_keys_kernel not being defined before
we transitively include asm/smp.h from linux/random.h.

Paper over it by moving the inclusion of linux/random.h *after* the
type has been defined.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:01 +02:00
Linus Torvalds
f06d60ff79 random32: move the pseudo-random 32-bit definitions to prandom.h
commit c0842fbc1b18c7a044e6ff3e8fa78bfa822c7d1a upstream.

The addition of percpu.h to the list of includes in random.h revealed
some circular dependencies on arm64 and possibly other platforms.  This
include was added solely for the pseudo-random definitions, which have
nothing to do with the rest of the definitions in this file but are
still there for legacy reasons.

This patch moves the pseudo-random parts to linux/prandom.h and the
percpu.h include with it, which is now guarded by _LINUX_PRANDOM_H and
protected against recursive inclusion.

A further cleanup step would be to remove this from <linux/random.h>
entirely, and make people who use the prandom infrastructure include
just the new header file.  That's a bit of a churn patch, but grepping
for "prandom_" and "next_pseudo_random32" "struct rnd_state" should
catch most users.

But it turns out that that nice cleanup step is fairly painful, because
a _lot_ of code currently seems to depend on the implicit include of
<linux/random.h>, which can currently come in a lot of ways, including
such fairly core headfers as <linux/net.h>.

So the "nice cleanup" part may or may never happen.

Fixes: 1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:01 +02:00
Linus Torvalds
c131009987 random32: remove net_rand_state from the latent entropy gcc plugin
commit 83bdc7275e6206f560d247be856bceba3e1ed8f2 upstream.

It turns out that the plugin right now ends up being really unhappy
about the change from 'static' to 'extern' storage that happened in
commit f227e3ec3b5c ("random32: update the net random state on interrupt
and activity").

This is probably a trivial fix for the latent_entropy plugin, but for
now, just remove net_rand_state from the list of things the plugin
worries about.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Emese Revfy <re.emese@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:01 +02:00
Willy Tarreau
7471f3228e random: fix circular include dependency on arm64 after addition of percpu.h
commit 1c9df907da83812e4f33b59d3d142c864d9da57f upstream.

Daniel Díaz and Kees Cook independently reported that commit
f227e3ec3b5c ("random32: update the net random state on interrupt and
activity") broke arm64 due to a circular dependency on include files
since the addition of percpu.h in random.h.

The correct fix would definitely be to move all the prandom32 stuff out
of random.h but for backporting, a smaller solution is preferred.

This one replaces linux/percpu.h with asm/percpu.h, and this fixes the
problem on x86_64, arm64, arm, and mips.  Note that moving percpu.h
around didn't change anything and that removing it entirely broke
differently.  When backporting, such options might still be considered
if this patch fails to help.

[ It turns out that an alternate fix seems to be to just remove the
  troublesome <asm/pointer_auth.h> remove from the arm64 <asm/smp.h>
  that causes the circular dependency.

  But we might as well do the whole belt-and-suspenders thing, and
  minimize inclusion in <linux/random.h> too. Either will fix the
  problem, and both are good changes.   - Linus ]

Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
Reported-by: Kees Cook <keescook@chromium.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Fixes: f227e3ec3b5c
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:01 +02:00
Grygorii Strashko
50bf89625b ARM: percpu.h: fix build error
commit aa54ea903abb02303bf55855fb51e3fcee135d70 upstream.

Fix build error for the case:
  defined(CONFIG_SMP) && !defined(CONFIG_CPU_V6)

config: keystone_defconfig

  CC      arch/arm/kernel/signal.o
  In file included from ../include/linux/random.h:14,
                    from ../arch/arm/kernel/signal.c:8:
  ../arch/arm/include/asm/percpu.h: In function ‘__my_cpu_offset’:
  ../arch/arm/include/asm/percpu.h:29:34: error: ‘current_stack_pointer’ undeclared (first use in this function); did you mean ‘user_stack_pointer’?
      : "Q" (*(const unsigned long *)current_stack_pointer));
                                     ^~~~~~~~~~~~~~~~~~~~~
                                     user_stack_pointer

Fixes: f227e3ec3b5c ("random32: update the net random state on interrupt and activity")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:01 +02:00
Willy Tarreau
c15a77bdda random32: update the net random state on interrupt and activity
commit f227e3ec3b5cad859ad15666874405e8c1bbc1d4 upstream.

This modifies the first 32 bits out of the 128 bits of a random CPU's
net_rand_state on interrupt or CPU activity to complicate remote
observations that could lead to guessing the network RNG's internal
state.

Note that depending on some network devices' interrupt rate moderation
or binding, this re-seeding might happen on every packet or even almost
never.

In addition, with NOHZ some CPUs might not even get timer interrupts,
leaving their local state rarely updated, while they are running
networked processes making use of the random state.  For this reason, we
also perform this update in update_process_times() in order to at least
update the state when there is user or system activity, since it's the
only case we care about.

Reported-by: Amit Klein <aksecurity@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:34:01 +02:00
George Shen
a0ca0f0929 msm: cvp: Add DSP error handling
CVP driver will retry and bail out in case DSP reports error.

Change-Id: I595cc31b40ce61aaa000a68f62400aacc1508e76
Signed-off-by: George Shen <sqiao@codeaurora.org>
2020-08-06 22:25:53 -07:00
Saravana Kannan
221bf83690 ANDROID: Update ABI xml
Leaf changes summary: 642 artifacts changed (2214 filtered out)
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 632 Changed (2201 filtered out), 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 9 Changed (13 filtered out), 0 Added variable

632 functions with some sub-type change:
... lots of CRC changes ...

'struct device_link at device.h:1139:1' changed:
  type size changed from 704 to 7808 (in bits)
  1 data member insertion:
    'device device_link::link_dev', at offset 384 (in bits) at device.h:1366:1
  there are data member changes:
    'device_link_state device_link::status' offset changed from 384 to 7488 (in bits) (by +7104 bits)
    'u32 device_link::flags' offset changed from 416 to 7520 (in bits) (by +7104 bits)
    'refcount_t device_link::rpm_active' offset changed from 448 to 7552 (in bits) (by +7104 bits)
    'kref device_link::kref' offset changed from 480 to 7584 (in bits) (by +7104 bits)
    'callback_head device_link::callback_head' offset changed from 512 to 7616 (in bits) (by +7104 bits)
    'bool device_link::supplier_preactivated' offset changed from 640 to 7744 (in bits) (by +7104 bits)
  2 impacted interfaces

Bug: 163090256
Bug: 157691602
Change-Id: Ia4d75e7d43fb546a88e682c3c66aac0bd47304fc
Signed-off-by: Saravana Kannan <saravanak@google.com>
2020-08-06 19:53:54 -07:00
Saravana Kannan
36f846bb22 UPSTREAM: of: property: Add device link support for pinctrl-0 through pinctrl-8
Add support for pinctrl-0 through pinctrl-8 explicitly instead of trying
to add support for pinctrl-%d properties.

Of all the pinctrl-* properties in dts files (20322), only 47% (9531)
are pinctrl-%d properties. Of all the pinctrl-%d properties, 99.5%
(9486) are made up of pinctrl-[0-2]. 'pinctrl-8' is the current maximum
found in dts files.

Trying to parse all pinctrl-* properties and checking for pinctrl-%d is
unnecessarily complicated. So, just add support for pinctrl-[0-8] for
now. In the unlikely event we ever exceed pinctrl-8, we can come back
and improve this.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200724234415.1651639-2-saravanak@google.com
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit fb820b494acb70e3a20e50935118239c7e5c94dd)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163091301
Change-Id: I1ad8ba1b784a59a4230ac04331139c13da5d32ed
2020-08-06 19:53:54 -07:00
Saravana Kannan
59356725e0 UPSTREAM: of: property: Add device link support for multiple DT bindings
Add support for creating device links out of the following DT bindings:
- interrupts-extended
- nvmem-cells
- phys
- wakeup-parent

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200724234415.1651639-1-saravanak@google.com
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit 53e6a671f70abc2c30fa94ae33c0f1c2fe24985e)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163091301
Bug: 160823849
Change-Id: I99c29fd21b7e559db9fb9fa79ea24a7deefd717f
2020-08-06 19:53:54 -07:00
Saravana Kannan
30e88e79b6 UPSTREAM: of: property: Add device link support for extcon
Add support for creating device links out of more DT properties.

Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit 78056e701c61132d15e0942e415926a6393fcf17)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163091301
Change-Id: Ifbf40d33788e59003a80c918098b08e94257d350
2020-08-06 19:53:54 -07:00
Saravana Kannan
660cd67d1e UPSTREAM: driver core: Change delimiter in devlink device's name to "--"
The devlink device name is of the form "supplier:consumer". But ":" is
fairly common in device names and makes it visually hard to distinguish
supplier and consumer. So, replace it with "--" to make it easier.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200724180523.1393383-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 90b109d50da09ddaa179732c01ccba7f759c125d)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163090256
Change-Id: Ibda7db293de6c2e0d9f963e61f2cec0321c82e09
2020-08-06 19:53:54 -07:00
Saravana Kannan
d75aed2721 UPSTREAM: driver core: Fix sleeping in invalid context during device link deletion
Marek and Guenter reported that commit 287905e68dd2 ("driver core:
Expose device link details in sysfs") caused sleeping/scheduling while
atomic warnings.

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 12, name: kworker/0:1
2 locks held by kworker/0:1/12:
  #0: ee8074a8 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x174/0x7dc
  #1: ee921f20 ((work_completion)(&sdp->work)){+.+.}-{0:0}, at: process_one_work+0x174/0x7dc
Preemption disabled at:
[<c01b10f0>] srcu_invoke_callbacks+0xc0/0x154
----- 8< ----- SNIP
[<c064590c>] (device_del) from [<c0645c9c>] (device_unregister+0x24/0x64)
[<c0645c9c>] (device_unregister) from [<c01b10fc>] (srcu_invoke_callbacks+0xcc/0x154)
[<c01b10fc>] (srcu_invoke_callbacks) from [<c01493c4>] (process_one_work+0x234/0x7dc)
[<c01493c4>] (process_one_work) from [<c01499b0>] (worker_thread+0x44/0x51c)
[<c01499b0>] (worker_thread) from [<c0150bf4>] (kthread+0x158/0x1a0)
[<c0150bf4>] (kthread) from [<c0100114>] (ret_from_fork+0x14/0x20)
Exception stack(0xee921fb0 to 0xee921ff8)

This was caused by the device link device being released in the context
of srcu_invoke_callbacks().  There is no need to wait till the RCU
callback to release the device link device.  So release the device
earlier and move the call_srcu() into the device release code. That way,
the memory will get freed only after the device is released AND the RCU
callback is called.

Fixes: 287905e68dd2 ("driver core: Expose device link details in sysfs")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200716214523.2924704-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 843e600b8a2b01463c4d873a90b2c2ea8033f1f6)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163090256
Change-Id: I3381dcf475ff55ee5971a57968f847eeef36e05b
2020-08-06 19:53:54 -07:00
Saravana Kannan
86cf413468 BACKPORT: driver core: Add waiting_for_supplier sysfs file for devices
This would be useful to check if a device is not probing because it's
waiting for a supplier to be added and then linked to before it can
probe.

To reduce sysfs clutter, this file is added only if it can ever be 1.
So, if fw_devlink is disabled or set to permissive, this file is not
added. Also, this file is removed once the device probes as it's no
longer relevant.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200521191800.136035-4-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit da6d647598a6d182eb6a0344a7b14ae005244399)
[Conflicts due to missing fw_devlink_is_permissive() and fw_devlink_flags]
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163090256
Change-Id: Ief4b9e35aff600f2eb88d15839e98a610f1c252f
2020-08-06 19:53:19 -07:00
Kamal Agrawal
602b7e4794 msm: kgsl: Fix kgsl context debug stat
Use cmdobj priv and context priv as masks instead of bit index.

Change-Id: I7216077102a1d9cbfc78adb720b5dd9192deb1df
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
2020-08-06 19:35:45 -07:00
Hui Li
449d29fb0f msm: kgsl: Fix HFI start failed on SA8155
In current code GMU can't startup properly on SA8155,
because of HFI start failure, we can fix this by moving
load pdc and rsc before HFI start.

Fixes: 90da593e71 ("msm: kgsl: Create a6xx gmu power ops")
Change-Id: Ie373cb89a54e88b3eedd62df65153e0c931b019b
Signed-off-by: Hui Li <hul@codeaurora.org>
2020-08-07 10:33:25 +08:00
Hui Li
cb216dbe93 msm: kgsl: Fix stuck issue while booting legacy
Restore offset value of RSCC_OFFSET_LEGACY to fix a error
while booting the legacy RSC.

Fixes: c832a7c974 ("msm: kgsl: Move rscc to a6xx gmu space")
Change-Id: I079ef1108ea5fd244db8f6f759d937640194af07
Signed-off-by: Hui Li <hul@codeaurora.org>
2020-08-07 10:21:24 +08:00
Saravana Kannan
e157d387e1 UPSTREAM: driver core: Add state_synced sysfs file for devices that support it
This can be used to check if a device supports sync_state() callbacks
and therefore keeps resources left on by the bootloader enabled till all
its consumers have probed.

This can also be used to check if sync_state() has been called for a
device or whether it is still trying to keep resources enabled because
they were left enabled by the bootloader and all its consumers haven't
probed yet.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200521191800.136035-3-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8fd456ec0cf03875908d6b67c1cd20cf0a7b4474)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163090256
Change-Id: I15b6db469e545eed9ecc97aca02ea90e7d318f2c
2020-08-06 18:55:34 -07:00
Saravana Kannan
3b499928c2 UPSTREAM: driver core: Expose device link details in sysfs
It's helpful to be able to look at device link details from sysfs. So,
expose it in sysfs.

Say device-A is supplier of device-B. These are the additional files
this patch would create:

/sys/class/devlink/device-A:device-B/
	auto_remove_on
	consumer/ -> .../device-B/
	runtime_pm
	status
	supplier/ -> .../device-A/
	sync_state_only

/sys/devices/.../device-A/
	consumer:device-B/ -> /sys/class/devlink/device-A:device-B/

/sys/devices/.../device-B/
	supplier:device-A/ -> /sys/class/devlink/device-A:device-B/

That way:
To get a list of all the device link in the system:
ls /sys/class/devlink/

To get the consumer names and links of a device:
ls -d /sys/devices/.../device-X/consumer:*

To get the supplier names and links of a device:
ls -d /sys/devices/.../device-X/supplier:*

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20200521191800.136035-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 287905e68dd29873bcb7986a8290cd1e4cfde600)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 163090256
Change-Id: I41dafdd731b8d429b5a21fd2e8d4d396b2bb571e
2020-08-06 18:53:28 -07:00
Saravana Kannan
c88a69f0e9 UPSTREAM: driver core: Avoid deferred probe due to fw_devlink_pause/resume()
With the earlier patch in this series, all devices that deferred probe
due to fw_devlink_pause() will have their probes delayed till the
deferred probe thread is kicked off during late_initcall. This will also
affect all their consumers.

This delayed probing in unnecessary. So this patch just keeps track of
the devices that had their probe deferred due to fw_devlink_pause() and
attempts to probe them once during fw_devlink_resume().

Fixes: 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing")
Signed-off-by: Saravana Kannan <saravanak@google.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200701194259.3337652-4-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2451e746478a6a6e981cfa66b62b791ca93b90c8)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 157691602
Change-Id: I76205ec0851fa251da5df485b1503b65b3296c7c
2020-08-06 18:51:07 -07:00
Saravana Kannan
7d2718b6ff UPSTREAM: driver core: Rename dev_links_info.defer_sync to defer_hook
The defer_sync field is used as a hook to add the device to the
deferred_sync list. Rename it so that it's more meaningful for the next
patch that'll also use this field as a hook to a deferred_fw_devlink
list.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200701194259.3337652-3-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ec7bd78498f29680f536451fbdf9464e851273ed)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 157691602
Change-Id: Ia213a9b8b6efc33882f5b2cfaad284ee0eca8cd4
2020-08-06 18:50:58 -07:00
Saravana Kannan
2b2b5b944c UPSTREAM: driver core: Don't do deferred probe in parallel with kernel_init thread
The current deferred probe implementation can mess up suspend/resume
ordering if deferred probe thread is kicked off in parallel with the
main initcall thread (kernel_init thread) [1].

For example:

Say device-B is a consumer of device-A.

Initcall thread					Deferred probe thread
===============					=====================
1. device-A is added.
2. device-B is added.
3. dpm_list is now [device-A, device-B].
4. driver-A defers probe of device-A.
						5. device-A is moved to
						   end of dpm_list
						6. dpm_list is now
						   [device-B, device-A]
7. driver-B is registereed and probes device-B.
8. dpm_list stays as [device-B, device-A].

The reverse order of dpm_list is used for suspend. So in this case
device-A would incorrectly get suspended before device-B.

Commit 716a7a259690 ("driver core: fw_devlink: Add support for batching
fwnode parsing") kicked off the deferred probe thread early during boot
to run in parallel with the initcall thread and caused suspend/resume
regressions.  This patch removes the parallel run of the deferred probe
thread to avoid the suspend/resume regressions.

[1] - https://lore.kernel.org/lkml/CAGETcx8W96KAw-d_siTX4qHB_-7ddk0miYRDQeHE6E0_8qx-6Q@mail.gmail.com/

Fixes: 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing")
Signed-off-by: Saravana Kannan <saravanak@google.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200701194259.3337652-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit cec72f3efc6272420c2c2c699607f03d09b93e41)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 157691602
Change-Id: I13f61a7cbeb705eb6ca1c67b07df5a9b69045029
2020-08-06 18:50:43 -07:00
Saravana Kannan
31a348791a UPSTREAM: arm64/module: Optimize module load time by optimizing PLT counting
When loading a module, module_frob_arch_sections() tries to figure out
the number of PLTs that'll be needed to handle all the RELAs. While
doing this, it tries to dedupe PLT allocations for multiple
R_AARCH64_CALL26 relocations to the same symbol. It does the same for
R_AARCH64_JUMP26 relocations.

To make checks for duplicates easier/faster, it sorts the relocation
list by type, symbol and addend. That way, to check for a duplicate
relocation, it just needs to compare with the previous entry.

However, sorting the entire relocation array is unnecessary and
expensive (O(n log n)) because there are a lot of other relocation types
that don't need deduping or can't be deduped.

So this commit partitions the array into entries that need deduping and
those that don't. And then sorts just the part that needs deduping. And
when CONFIG_RANDOMIZE_BASE is disabled, the sorting is skipped entirely
because PLTs are not allocated for R_AARCH64_CALL26 and R_AARCH64_JUMP26
if it's disabled.

This gives significant reduction in module load time for modules with
large number of relocations with no measurable impact on modules with a
small number of relocations. In my test setup with CONFIG_RANDOMIZE_BASE
enabled, these were the results for a few downstream modules:

Module		Size (MB)
wlan		14
video codec	3.8
drm		1.8
IPA		2.5
audio		1.2
gpu		1.8

Without this patch:
Module		Number of entries sorted	Module load time (ms)
wlan		243739				283
video codec	74029				138
drm		53837				67
IPA		42800				90
audio		21326				27
gpu		20967				32

Total time to load all these module: 637 ms

With this patch:
Module		Number of entries sorted	Module load time (ms)
wlan		22454				61
video codec	10150				47
drm		13014				40
IPA		8097				63
audio		4606				16
gpu		6527				20

Total time to load all these modules: 247

Time saved during boot for just these 6 modules: 390 ms

Signed-off-by: Saravana Kannan <saravanak@google.com>
Acked-by: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Link: https://lore.kernel.org/r/20200623011803.91232-1-saravanak@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit d4e0340919fb9190a57e879fb3125c4acce0d9b2)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Bug: 159681305
Change-Id: I6660f6e5d5e950340445f388d047c306fb0dfe6d
2020-08-06 18:50:27 -07:00
Blagovest Kolenichev
66b69d62de Merge android11-5.4.56 (fcb0d3e) into msm-5.4
* refs/heads/tmp-fcb0d3e:
  Linux 5.4.56
  perf bench: Share some global variables to fix build with gcc 10
  perf env: Do not return pointers to local variables
  perf tests bp_account: Make global variable static
  x86/i8259: Use printk_deferred() to prevent deadlock
  KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
  KVM: arm64: Don't inherit exec permission across page-table levels
  drivers/net/wan: lapb: Corrected the usage of skb_cow
  RISC-V: Set maximum number of mapped pages correctly
  xen-netfront: fix potential deadlock in xennet_remove()
  cxgb4: add missing release on skb in uld_send()
  x86/stacktrace: Fix reliable check for empty user task stacks
  x86/unwind/orc: Fix ORC for newly forked tasks
  Revert "i2c: cadence: Fix the hold bit setting"
  net: ethernet: ravb: exit if re-initialization fails in tx timeout
  parisc: add support for cmpxchg on u8 pointers
  scsi: core: Run queue in case of I/O resource contention failure
  nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame
  selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
  qed: Disable "MFW indication via attention" SPAM every 5 minutes
  selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion
  usb: hso: Fix debug compile warning on sparc32
  vxlan: fix memleak of fdb
  perf tools: Fix record failure when mixed with ARM SPE event
  net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq
  net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe()
  net: nixge: fix potential memory leak in nixge_probe()
  Bluetooth: fix kernel oops in store_pending_adv_report
  arm64: csum: Fix handling of bad packets
  arm64/alternatives: move length validation inside the subsection
  mac80211: mesh: Free pending skb when destroying a mpath
  mac80211: mesh: Free ie data when leaving mesh
  bpf: Fix map leak in HASH_OF_MAPS map
  ibmvnic: Fix IRQ mapping disposal in error path
  mlxsw: core: Free EMAD transactions using kfree_rcu()
  mlxsw: core: Increase scope of RCU read-side critical section
  mlx4: disable device on shutdown
  rhashtable: Fix unprotected RCU dereference in __rht_ptr
  net: lan78xx: fix transfer-buffer memory leak
  net: lan78xx: add missing endpoint sanity check
  net/mlx5e: Fix kernel crash when setting vf VLANID on a VF dev
  net/mlx5e: Modify uplink state on interface up/down
  net/mlx5: Verify Hardware supports requested ptp function on a given pin
  net/mlx5e: Fix error path of device attach
  net/mlx5: E-switch, Destroy TSAR when fail to enable the mode
  net: hns3: fix aRFS FD rules leftover after add a user FD rule
  net: hns3: fix a TX timeout issue
  sh: Fix validation of system call number
  sh/tlb: Fix PGTABLE_LEVELS > 2
  selftests/net: so_txtime: fix clang issues for target arch PowerPC
  selftests/net: psock_fanout: fix clang issues for target arch PowerPC
  selftests/net: rxtimestamp: fix clang issues for target arch PowerPC
  nvme-tcp: fix possible hang waiting for icresp response
  ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds
  xfrm: Fix crash when the hold queue is used.
  ARM: dts sunxi: Relax a bit the CMA pool allocation range
  xfrm: policy: match with both mark and mask on user interfaces
  net/x25: Fix null-ptr-deref in x25_disconnect
  net/x25: Fix x25_neigh refcnt leak when x25 disconnect
  libtraceevent: Fix build with binutils 2.35
  rds: Prevent kernel-infoleak in rds_notify_queue_get()
  drm: hold gem reference until object is no longer accessed
  drm/dbi: Fix SPI Type 1 (9-bit) transfer
  drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()
  drm/amd/display: Clear dm_state for fast updates
  Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
  virtio_balloon: fix up endian-ness for free cmd id
  ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect
  ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2
  ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2
  ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints
  wireless: Use offsetof instead of custom macro.
  9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work
  vhost/scsi: fix up req type endian-ness
  IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE
  ALSA: hda/hdmi: Fix keep_power assignment for non-component devices
  ALSA: hda/realtek - Fixed HP right speaker no sound
  ALSA: hda/realtek: Fix add a "ultra_low_power" function for intel reference board (alc256)
  ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus G14(GA401) series with ALC289
  ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series with ALC289
  ALSA: usb-audio: Add implicit feedback quirk for SSL2
  mm/filemap.c: don't bother dropping mmap_sem for zero size readahead
  PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge
  ath10k: enable transmit data ack RSSI for QCA9884
  sunrpc: check that domain table is empty at module unload.
  media: rc: prevent memory leak in cx23888_ir_probe
  crypto: ccp - Release all allocated memory if sha type is invalid
  ANDROID: ABI: Update allowed list for QCOM
  Revert "ANDROID: GKI: update abi symbol lists now that CONFIG_DWC3 is enabled."
  ANDROID: kallsyms: increase KSYM_NAME_LEN
  ANDROID: GKI: update KMI after RCU CONFIGs added
  ANDROID: GKI: enable RCU configs
  ANDROID: KABI updates for db845c (USB_DWC3 whiplash fixups)
  ANDROID: Revert "ANDROID: db845c_gki.fragment: Remove DWC3 modules built into GKI"
  ANDROID: Open-code OWNERS emails for now
  ANDROID: Initial OWNERS for abi metafiles
  ANDROID: ABI: update symbols of charger-manager.ko to unisoc
  ANDROID: GKI: fix symbol_get/put() build error on arm64 defconfig
  ANDROID: GKI: Fix up "do not export symbol_get/put()" commit

Conflicts:
	android/abi_gki_aarch64_qcom
	mm/filemap.c

Change-Id: I24f59bf5cf2a9ab41ae0864beb8756eed0998345
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2020-08-06 17:12:45 -07:00
Blagovest Kolenichev
be455bc542 Merge android11-5.4.55 (53b501f) into msm-5.4
* refs/heads/tmp-53b501f:
  Revert "qrtr: orphan socket in qrtr_release()"
  ANDROID: GKI: fix up abi definition files
  Revert "ANDROID: GKI: Enable CONFIG_USB_DWC3"
  ANDROID: GKI: remove symbols from sunxi for uas driver
  Linux 5.4.55
  Revert "dpaa_eth: fix usage as DSA master, try 3"
  PM: wakeup: Show statistics for deleted wakeup sources again
  regmap: debugfs: check count when read regmap file
  udp: Improve load balancing for SO_REUSEPORT.
  udp: Copy has_conns in reuseport_grow().
  sctp: shrink stream outq when fails to do addstream reconf
  sctp: shrink stream outq only when new outcnt < old outcnt
  AX.25: Prevent integer overflows in connect and sendmsg
  tcp: allow at most one TLP probe per flight
  rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA
  rtnetlink: Fix memory(net_device) leak when ->newlink fails
  qrtr: orphan socket in qrtr_release()
  net: udp: Fix wrong clean up for IS_UDPLITE macro
  net-sysfs: add a newline when printing 'tx_timeout' by sysfs
  ip6_gre: fix null-ptr-deref in ip6gre_init_net()
  drivers/net/wan/x25_asy: Fix to make it work
  dev: Defer free of skbs in flush_backlog
  AX.25: Prevent out-of-bounds read in ax25_sendmsg()
  AX.25: Fix out-of-bounds read in ax25_connect()
  Revert "Revert "ANDROID: ALSA: jack: Update supported jack switch types""
  Revert "Revert "ANDROID: ASoC: compress: fix unsigned integer overflow check""
  ANDROID: GKI: enable CONFIG_VIDEO_V4L2_SUBDEV_API
  FROMLIST: power: add "Wireless" to power_supply_type and power_supply_type_text
  Revert "ANDROID: ASoC: compress: fix unsigned integer overflow check"
  Revert "ANDROID: ALSA: jack: Update supported jack switch types"
  BACKPORT: FROMLIST: cpuidle: change enter_s2idle() prototype

Change-Id: I0dfd8e6b5e2a26997f144e542498f18f5f89408a
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2020-08-06 16:52:09 -07:00
Bhaumik Bhatt
4580871a15 mhi: core: Make sure to powerdown if mhi_sync_power_up fails
Power down is necessary if mhi_sync_power_up fails due to any
timeout, to clean up the resources. Otherwise, an assert could
be triggered when attempting to clean up MSIs because the IRQ is
still active from a request_irq(). Do not allow this for RDDM
supported controllers, as ramdump collection prior to powering
down maybe needed.

Change-Id: I7469e6ad190d21ed69bb2a03fde56c969a672fa3
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
2020-08-06 14:01:10 -07:00
qctecmdr
d8534164bb Merge "build.config.common: Move to clang-11" 2020-08-06 12:39:32 -07:00
qctecmdr
e434ce8db2 Merge "arm64: defconfig: Enable interconnect driver for Holi" 2020-08-06 12:39:32 -07:00
qctecmdr
d0debf0f84 Merge "iommu/arm-smmu: add support to configure IOVA range" 2020-08-06 12:39:32 -07:00
qctecmdr
15a4ecc85f Merge "msm: cvp: adding new target and read fw name from dtsi" 2020-08-06 12:39:31 -07:00
qctecmdr
11a6194bdd Merge "soc: qcom: llcc: Add support for CPU TLB System Cache Id" 2020-08-06 12:39:31 -07:00
qctecmdr
b186c50739 Merge "msm: adsprpc: Fix concurrency in early wake of fastrpc" 2020-08-06 12:39:30 -07:00
Mike Tipton
1b93788f31 clk: qcom: clk-debug: Fix clk_measure files not being created
The clk_measure debugfs files are created in the debug_init() callback
and require the debugcc provider to have probed first and to have called
clk_debug_measure_register(). However, the debugcc provider itself
requires all other clock providers to have probed first in order to
lookup their regmaps. So they are essentially interdependent.

This has worked previously since when everything is built-in, all clock
providers and debugcc generally probe prior to late_init. Prior to
late_init, the debug_init() callbacks aren't called, so there are no
interdependencies and it's only debugcc that depends on the other clock
providers. At late_init, the debug_init() callbacks are called for any
clocks already registered. After late-init, the debug_init() callbacks
are called when each clock is registered, which introduces the
interdependencies. If the probes are delayed to after late_init, then
the clk_measure nodes aren't created in debug_init() due to the missing
debugcc provider. The debug_init() callback is never called again and
the files are never created.

We can't rely on clock controllers being probed prior to late_init. Even
if built-in, they can be delayed for various reasons as has been
observed after recent kernel changes. If built as DLKMs, then they are
guaranteed to be loaded after late_init.

Update the code to always create the clk_measure files when debug_init()
is called, even if the debugcc provider hasn't probed yet. If the
clk_measure files are read prior to debugcc probe, then just return an
error.

Change-Id: Ia05a1dba86a84d70a03c8f05533ca9e1d1e18a90
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
2020-08-06 11:19:06 -07:00
Manikandan Mohan
657d9f2ce9 cnss2: Fix for static analysis issue
Fix a potential null pointer issue with DT based bus bandwidth
setup feature.

Change-Id: I66187ac31a23886cd5279c81f001c69e401303a4
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
2020-08-06 10:54:02 -07:00
Manikandan Mohan
f92b9ec232 cnss2: Fix SBL logging for invalid log location address
Fix SBL log dump for invalid log location address. Also remove
SBL / PBL dumping from forced FW assert handler as it is
needed only to debug pre mission mode failures.

Change-Id: I9e7f84ca8f0b9afc8c9d035f068169c03c3be5f9
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
2020-08-06 10:41:17 -07:00