Commit graph

892,914 commits

Author SHA1 Message Date
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
Sushmita Susheelendra
f32405fce8 msm: kgsl: Disable stall on fault for GMU context bank
Stall on fault must be disabled for the GMU context bank as
an SMMU stall will cause the GMU memory transaction to hang when
there is a pagefault. As a result, the GMU becomes unresponsive
and we do not get any CM3 state which can help debug the pagefault.
With stall on fault disabled, when there is a GMU pagefault,
a bus fault is triggered and the GMU enters the bus fault handler
as expected.

Change-Id: Id3452ad0df606eafefda4dcd8b1801c22fbf0815
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2020-08-06 13:12:42 -06: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
Lina Iyer
fe547ce1b4 firmware: psci: setup OSI mode at init
Let's switch to OSI mode for QCOM platforms if setting the OSI mode is
supported. We should do this only if the lpm-levels driver is used.
Other VMs using the same kernel but defaulting to ARM cpuidle drivers,
will default to platform coordinated.

Change-Id: I69245bf33361970f37ea2006d669368e30e2ec9d
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
2020-08-06 11:36:25 -06:00
Komal Bajaj
7f9b17b1e7 soc: qcom: Add support to enable eud if enabled in xbl
If eud driver is enabled in xbl, there was a explicit need
to enable eud from hlos side also. This change enables eud
if eud_mode_manager2 register is set, and it keeps the check
after tcsr register property check.

Change-Id: I4f99d2fddb36f196514296302c67b75e73545632
Signed-off-by: Komal Bajaj <kbajaj@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2020-08-06 21:45:23 +05:30
Shadab Naseem
12ac024c7c soc: qcom: eud: Add support for EUD TCSR register check
For some targets like Bengal, eud enablement expects a TCSR register
to be configured first. This would be one time enablement during
drivers probe. Due to this register disabled, eud was not getting
enabled on Bengal platform.

If this register is not configured for EUD, do not enable
eud-tcsr-check-enable parameter.

Change-Id: Iaabfaecf343090d964d06807dcee5ea6a2dca3dc
Signed-off-by: Shadab Naseem <snaseem@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2020-08-06 21:44:11 +05:30
Alan Stern
176bb149c6 FROMGIT: scsi: block: pm: Simplify resume handling
Commit 05d18ae1cc8a ("scsi: pm: Balance pm_only counter of request queue
during system resume") fixed a problem in the block layer's runtime-PM
code: blk_set_runtime_active() failed to call blk_clear_pm_only().
However, the commit's implementation was awkward; it forced the SCSI
system-resume handler to choose whether to call blk_post_runtime_resume()
or blk_set_runtime_active(), depending on whether or not the SCSI device
had previously been runtime suspended.

This patch simplifies the situation considerably by adding the missing
function call directly into blk_set_runtime_active() (under the condition
that the queue is not already in the RPM_ACTIVE state).  This allows the
SCSI routine to revert back to its original form.  Furthermore, making this
change reveals that blk_post_runtime_resume() (in its success pathway) does
exactly the same thing as blk_set_runtime_active().  The duplicate code is
easily removed by making one routine call the other.

No functional changes are intended.

Link: https://lore.kernel.org/r/20200706151436.GA702867@rowland.harvard.edu
CC: Can Guo <cang@codeaurora.org>
CC: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 162892567
(cherry picked from commit 8f38f8e0a30e1c33cdfc48eba2bd63ac2eae373a
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.9/scsi-queue)
Change-Id: Ibeca9786fb65ee7d782314f48fb39274b82feb57
Signed-off-by: Can Guo <cang@codeaurora.org>
2020-08-06 15:18:05 +00:00
Lingutla Chandrasekhar
98d72cd5a2 sched: rt: Fix double accounting of cpu util in task placement decision
In RT energy aware task placement, cpu utilization is double accounted
to check whether cpu would be overutilized for given task or not.

Fix the double accounting the cpu util.

Change-Id: Id51dd6c952126b870942746c0408fa387ec3bfb1
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
2020-08-06 07:19:19 -07:00
Ashish Kori
45203d00ef spi: spi-msm-geni: Propagate change form 4.14 to 5.4
Propagate following change from 4.14 to 5.4 for SPI.
'commit 0f5e798e98004 ("spi: spi-geni-qcom: Don't
initialize GSI channels for FIFO/SE_DMA mode")'.

Change-Id: I600cb1a522a09c4e9cd2ee1cad3d3f6d4c66a358
Signed-off-by: Ashish Kori <akori@codeaurora.org>
2020-08-06 19:20:13 +05:30
himta ram
6f2adbc132 RTC6226: send the SEEK COMPLETE event when seek cancel
When seek is cancelled before the seek operation completes, Some
time interrupt handler is not called for seek complete and no
SEEK COMPLETE event sent to user space.
Send the SEEK COMPLETE event when seek is cancelled.

CRs-Fixed: 2749392
Change-Id: I61473c325a637e79eb5c7e980921c3ff83381231
Signed-off-by: himta ram <hram@codeaurora.org>
2020-08-06 17:49:05 +05:30
Yuanfang Zhang
5343d04f71 defconfig: sdxlemur: add support for qdss
Enable qdss component on sdxlemur.

Change-Id: Ia832601cd02bbd0073eecbfb79d4005d57c6b993
Signed-off-by: Yuanfang Zhang <zhangyuanfang@codeaurora.org>
2020-08-06 19:05:09 +08:00
suchawla
46ad5b6720 msm: cvp: adding new target and read fw name from dtsi
Adding changes for the new target and reading the FW name
from dtsi.

Change-Id: I224ebe001126c33c55fc039e74f42555a4dce1f8
Signed-off-by: suchawla <suchawla@codeaurora.org>
2020-08-06 03:55:23 -07:00
qctecmdr
1fa28c49fb Merge "input: touchscreen: focaltech_touch: support dynamic report rate" 2020-08-06 03:32:50 -07:00
qctecmdr
50499d00d0 Merge "msm: cvp: Add support of mdt loader" 2020-08-06 03:32:50 -07:00
qctecmdr
c430af9f3a Merge "arm64: defconfig: Enable dmabuf destructor support on all targets" 2020-08-06 03:32:49 -07:00
qctecmdr
382aafa472 Merge "soc: qcom: hyp_core_ctl: Minor cleanup" 2020-08-06 03:32:49 -07:00
qctecmdr
402d0f255e Merge "defconfig: Shima: enable recommended memory configs" 2020-08-06 03:32:49 -07:00
qctecmdr
f7021dc9b9 Merge "serial: msm_geni_serial: Do not place msm_geni_console_setup under __init" 2020-08-06 03:32:48 -07:00
Odelu Kukatla
49f651e328 arm64: defconfig: Enable interconnect driver for Holi
Enable the interconnect driver so that consumers are
able to obtain their path handles properly.

Change-Id: Ic9b11ac283beb5d1c00ba98564377d214d323a82
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
2020-08-06 13:37:52 +05:30
qctecmdr
64d377e6a2 Merge "soc-compress: Update error handling to cleanup backend" 2020-08-06 00:53:21 -07:00
qctecmdr
60fd474f45 Merge "msm: msi: add support for Synopsys MSI" 2020-08-06 00:53:21 -07:00