Commit Graph

979626 Commits

Author SHA1 Message Date
Lecopzer Chen
23232f84c8 UPSTREAM: arm64: kaslr: support randomized module area with KASAN_VMALLOC
After KASAN_VMALLOC works in arm64, we can randomize module region
into vmalloc area now.

Test:
	VMALLOC area ffffffc010000000 fffffffdf0000000

	before the patch:
		module_alloc_base/end ffffffc008b80000 ffffffc010000000
	after the patch:
		module_alloc_base/end ffffffdcf4bed000 ffffffc010000000

	And the function that insmod some modules is fine.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Link: https://lore.kernel.org/r/20210324040522.15548-5-lecopzer.chen@mediatek.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 201711661
(cherry picked from commit 31d02e7ab0)
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Change-Id: I513f205113752b396245e9e8d64b973fcd7ffcb1
2021-10-04 15:44:35 +00:00
Lecopzer Chen
ef61240f62 UPSTREAM: arm64: Kconfig: support CONFIG_KASAN_VMALLOC
We can backed shadow memory in vmalloc area after vmalloc area
isn't populated at kasan_init(), thus make KASAN_VMALLOC selectable.

Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210324040522.15548-4-lecopzer.chen@mediatek.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 201711661
(cherry picked from commit 71b613fc0c)
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Change-Id: I48d473cadd54ec2c8d3f92fa3d88ff456b70afdc
2021-10-04 15:44:28 +00:00
Lecopzer Chen
d0f4b61ae6 UPSTREAM: arm64: kasan: abstract _text and _end to KERNEL_START/END
Arm64 provides defined macro for KERNEL_START and KERNEL_END,
thus replace them by the abstration instead of using _text and _end.

Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210324040522.15548-3-lecopzer.chen@mediatek.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 201711661
(cherry picked from commit 7d7b88ff5f)
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Change-Id: I806cb3d57e2064c272f3c87f0eb212ceea80c424
2021-10-04 15:44:20 +00:00
Lecopzer Chen
4d91b1f6ee UPSTREAM: arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC
Linux support KAsan for VMALLOC since commit 3c5c3cfb9e
("kasan: support backing vmalloc space with real shadow memory")

Like how the MODULES_VADDR does now, just not to early populate
the VMALLOC_START between VMALLOC_END.

Before:

MODULE_VADDR: no mapping, no zero shadow at init
VMALLOC_VADDR: backed with zero shadow at init

After:

MODULE_VADDR: no mapping, no zero shadow at init
VMALLOC_VADDR: no mapping, no zero shadow at init

Thus the mapping will get allocated on demand by the core function
of KASAN_VMALLOC.

  -----------  vmalloc_shadow_start
 |           |
 |           |
 |           | <= non-mapping
 |           |
 |           |
 |-----------|
 |///////////|<- kimage shadow with page table mapping.
 |-----------|
 |           |
 |           | <= non-mapping
 |           |
 ------------- vmalloc_shadow_end
 |00000000000|
 |00000000000| <= Zero shadow
 |00000000000|
 ------------- KASAN_SHADOW_END

Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210324040522.15548-2-lecopzer.chen@mediatek.com
[catalin.marinas@arm.com: add a build check on VMALLOC_START != MODULES_END]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 201711661
(cherry picked from commit 9a0732efa7)
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Change-Id: I82c4b624685cc9e083d720904787df2326cb9cc0
2021-10-04 15:44:10 +00:00
Kever Yang
935b5c3bdd ANDROID: GKI: rockchip: Enable symbols for rk808-regulator
Functions changes summary: 0 Removed, 0 Changed (1546 filtered out), 2 Added functions
Variables changes summary: 0 Removed, 0 Changed (11 filtered out), 0 Added variables

2 Added functions:

  [A] 'function gpio_desc* devm_gpiod_get_index_optional(device*, const char*, unsigned int, gpiod_flags)'
  [A] 'function int gpiod_is_active_low(const gpio_desc*)'

Bug: 194515348
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie06fa99d6616cb389bccc1d9167f084c7cafbe89
2021-10-04 15:48:04 +02:00
Kever Yang
9a8a15b8bd ANDROID: GKI: rockchip: Enable symbols for hid
Functions changes summary: 0 Removed, 0 Changed (1546 filtered out), 1 Added functions
Variables changes summary: 0 Removed, 0 Changed (11 filtered out), 0 Added variables

1 Added function:

  [A] 'function hid_report* hid_validate_values(hid_device*, unsigned int, unsigned int, unsigned int, unsigned int)'

Leaf changes summary: 11 artifacts changed
Changed leaf types summary: 0 leaf type changed

Bug: 194515348
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I941c191d5c0fb5a01a6b9269f0afa7ea77db327a
2021-10-04 13:38:23 +02:00
Peter Collingbourne
55b0b34791 FROMGIT: arm64: kasan: mte: move GCR_EL1 switch to task switch when KASAN disabled
It is not necessary to write to GCR_EL1 on every kernel entry and
exit when HW tag-based KASAN is disabled because the kernel will not
execute any IRG instructions in that mode. Since accessing GCR_EL1
can be expensive on some microarchitectures, avoid doing so by moving
the access to task switch when HW tag-based KASAN is disabled.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Acked-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://linux-review.googlesource.com/id/I78e90d60612a94c24344526f476ac4ff216e10d2
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210924010655.2886918-1-pcc@google.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit e5af50a5df
 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/mte)
Change-Id: I0f06de2fce4dea2967c0fee608d1900915493d23
Bug: 192536783
2021-10-01 09:39:36 -07:00
Peter Collingbourne
6c6d1d7e42 UPSTREAM: arm64: add MTE supported check to thread switching and syscall entry/exit
This lets us avoid doing unnecessary work on hardware that does not
support MTE, and will allow us to freely use MTE instructions in the
code called by mte_thread_switch().

Since this would mean that we do a redundant check in
mte_check_tfsr_el1(), remove it and add two checks now required in its
callers. This also avoids an unnecessary DSB+ISB sequence on the syscall
exit path for hardware not supporting MTE.

Fixes: 65812c6921 ("arm64: mte: Enable async tag check fault")
Cc: <stable@vger.kernel.org> # 5.13.x
Signed-off-by: Peter Collingbourne <pcc@google.com>
Link: https://linux-review.googlesource.com/id/I02fd000d1ef2c86c7d2952a7f099b254ec227a5d
Link: https://lore.kernel.org/r/20210915190336.398390-1-pcc@google.com
[catalin.marinas@arm.com: adjust the commit log slightly]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 8c8a3b5bd9)
Change-Id: I131933b18581a40cea9abf556625c80b12e4e974
Bug: 192536783
2021-10-01 09:39:36 -07:00
Mark Rutland
f746714fe4 UPSTREAM: arm64: kasan: mte: use a constant kernel GCR_EL1 value
When KASAN_HW_TAGS is selected, KASAN is enabled at boot time, and the
hardware supports MTE, we'll initialize `kernel_gcr_excl` with a value
dependent on KASAN_TAG_MAX. While the resulting value is a constant
which depends on KASAN_TAG_MAX, we have to perform some runtime work to
generate the value, and have to read the value from memory during the
exception entry path. It would be better if we could generate this as a
constant at compile-time, and use it as such directly.

Early in boot within __cpu_setup(), we initialize GCR_EL1 to a safe
value, and later override this with the value required by KASAN. If
CONFIG_KASAN_HW_TAGS is not selected, or if KASAN is disabeld at boot
time, the kernel will not use IRG instructions, and so the initial value
of GCR_EL1 is does not matter to the kernel. Thus, we can instead have
__cpu_setup() initialize GCR_EL1 to a value consistent with
KASAN_TAG_MAX, and avoid the need to re-initialize it during hotplug and
resume form suspend.

This patch makes arem64 use a compile-time constant KERNEL_GCR_EL1
value, which is compatible with KASAN_HW_TAGS when this is selected.
This removes the need to re-initialize GCR_EL1 dynamically, and acts as
an optimization to the entry assembly, which no longer needs to load
this value from memory. The redundant initialization hooks are removed.

In order to do this, KASAN_TAG_MAX needs to be visible outside of the
core KASAN code. To do this, I've moved the KASAN_TAG_* values into
<linux/kasan-tags.h>.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20210714143843.56537-3-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 8286824789)
Change-Id: I397025af7051bedcdd35987af5deec46c228f8e2
Signed-off-by: Peter Collingbourne <pcc@google.com>
Bug: 192536783
2021-10-01 09:39:35 -07:00
Greg Kroah-Hartman
eb02ea0e35 ANDROID: GKI: fix mode of android/abi_gki_aarch64.xml file
Somehow the android/abi_gki_aarch64.xml file became executable in a
previous commit.  Fix this up by setting the mode properly.

Bug: 149040612
Cc: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Cc: Sandeep Patil <sspatil@google.com>
Fixes: 55d7c4eca6 ("ANDROID: Update symbol list for mtk")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iecb61df3481cf2a257d2f999297a98cdbcb38295
2021-09-30 21:51:03 +00:00
Woogeun Lee
62ad82b86b ANDROID: ABI: update allowed list for galaxy
Leaf changes summary: 84 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 67 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 17 Added variables

67 Added functions:

  [A] 'function int __hid_register_driver(hid_driver*, module*, const char*)'
  [A] 'function int __hid_request(hid_device*, hid_report*, int)'
  [A] 'function tty_driver* __tty_alloc_driver(unsigned int, module*, unsigned long int)'
  [A] 'function int __usb_get_extra_descriptor(char*, unsigned int, unsigned char, void**, size_t)'
  [A] 'function int cdc_ncm_bind_common(usbnet*, usb_interface*, u8, int)'
  [A] 'function int cdc_ncm_change_mtu(net_device*, int)'
  [A] 'function sk_buff* cdc_ncm_fill_tx_frame(usbnet*, sk_buff*, __le32)'
  [A] 'function int cdc_ncm_rx_verify_ndp16(sk_buff*, int)'
  [A] 'function int cdc_ncm_rx_verify_nth16(cdc_ncm_ctx*, sk_buff*)'
  [A] 'function u8 cdc_ncm_select_altsetting(usb_interface*)'
  [A] 'function void cdc_ncm_unbind(usbnet*, usb_interface*)'
  [A] 'function int cdc_parse_cdc_header(usb_cdc_parsed_header*, usb_interface*, u8*, int)'
  [A] 'function u16 crc16(u16, const u8*, size_t)'
  [A] 'function int driver_attach(device_driver*)'
  [A] 'function void drm_mode_sort(list_head*)'
  [A] 'function void hid_hw_close(hid_device*)'
  [A] 'function int hid_hw_open(hid_device*)'
  [A] 'function int hid_hw_start(hid_device*, unsigned int)'
  [A] 'function void hid_hw_stop(hid_device*)'
  [A] 'function int hid_open_report(hid_device*)'
  [A] 'function int hid_report_raw_event(hid_device*, int, u8*, u32, int)'
  [A] 'function void hid_unregister_driver(hid_driver*)'
  [A] 'function void in6_dev_finish_destroy(inet6_dev*)'
  [A] 'function int input_ff_create_memless(input_dev*, void*, int (input_dev*, void*, ff_effect*)*)'
  [A] 'function int phy_connect_direct(net_device*, phy_device*, void (net_device*)*, phy_interface_t)'
  [A] 'function phy_device* phy_find_first(mii_bus*)'
  [A] 'function void phy_get_pause(phy_device*, bool*, bool*)'
  [A] 'function void put_tty_driver(tty_driver*)'
  [A] 'function int smp_call_function_single_async(int, __call_single_data*)'
  [A] 'function unsigned int stack_trace_save_regs(pt_regs*, unsigned long int*, unsigned int, unsigned int)'
  [A] 'function int tcp_register_congestion_control(tcp_congestion_ops*)'
  [A] 'function void tcp_reno_cong_avoid(sock*, u32, u32)'
  [A] 'function u32 tcp_reno_ssthresh(sock*)'
  [A] 'function u32 tcp_reno_undo_cwnd(sock*)'
  [A] 'function u32 tcp_slow_start(tcp_sock*, u32)'
  [A] 'function void tcp_unregister_congestion_control(tcp_congestion_ops*)'
  [A] 'function void tty_ldisc_deref(tty_ldisc*)'
  [A] 'function tty_ldisc* tty_ldisc_ref(tty_struct*)'
  [A] 'function void tty_port_close(tty_port*, tty_struct*, file*)'
  [A] 'function void tty_port_destroy(tty_port*)'
  [A] 'function void tty_port_hangup(tty_port*)'
  [A] 'function void tty_port_init(tty_port*)'
  [A] 'function int tty_port_open(tty_port*, tty_struct*, file*)'
  [A] 'function device* tty_port_register_device(tty_port*, tty_driver*, unsigned int, device*)'
  [A] 'function void tty_port_tty_wakeup(tty_port*)'
  [A] 'function int tty_register_driver(tty_driver*)'
  [A] 'function void tty_set_operations(tty_driver*, const tty_operations*)'
  [A] 'function int tty_standard_install(tty_driver*, tty_struct*)'
  [A] 'function void tty_termios_copy_hw(ktermios*, ktermios*)'
  [A] 'function void tty_unregister_device(tty_driver*, unsigned int)'
  [A] 'function int tty_unregister_driver(tty_driver*)'
  [A] 'function void tty_vhangup(tty_struct*)'
  [A] 'function void usb_autopm_get_interface_no_resume(usb_interface*)'
  [A] 'function void usb_deregister_dev(usb_interface*, usb_class_driver*)'
  [A] 'function usb_interface* usb_find_interface(usb_driver*, int)'
  [A] 'function usb_device* usb_get_dev(usb_device*)'
  [A] 'function usb_interface* usb_get_intf(usb_interface*)'
  [A] 'function const usb_device_id* usb_match_id(usb_interface*, const usb_device_id*)'
  [A] 'function int usb_match_one_id(usb_interface*, const usb_device_id*)'
  [A] 'function void usb_poison_anchored_urbs(usb_anchor*)'
  [A] 'function void usb_put_intf(usb_interface*)'
  [A] 'function int usb_register_dev(usb_interface*, usb_class_driver*)'
  [A] 'function int usb_set_interface(usb_device*, int, int)'
  [A] 'function ssize_t usb_show_dynids(usb_dynids*, char*)'
  [A] 'function ssize_t usb_store_new_id(usb_dynids*, const usb_device_id*, device_driver*, const char*, size_t)'
  [A] 'function void usb_unpoison_urb(urb*)'
  [A] 'function void usbnet_defer_kevent(usbnet*, int)'

17 Added variables:

  [A] 'tracepoint __tracepoint_android_rvh_arm64_serror_panic'
  [A] 'tracepoint __tracepoint_android_rvh_bad_mode'
  [A] 'tracepoint __tracepoint_android_rvh_dequeue_task_idle'
  [A] 'tracepoint __tracepoint_android_rvh_do_sea'
  [A] 'tracepoint __tracepoint_android_rvh_do_undefinstr'
  [A] 'tracepoint __tracepoint_android_vh_rtmutex_wait_finish'
  [A] 'tracepoint __tracepoint_android_vh_rtmutex_wait_start'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_read_wait_finish'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_read_wait_start'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_write_wait_finish'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_write_wait_start'
  [A] 'tracepoint __tracepoint_android_vh_sched_show_task'
  [A] 'tracepoint __tracepoint_android_vh_try_to_freeze_todo'
  [A] 'tracepoint __tracepoint_android_vh_try_to_freeze_todo_unfrozen'
  [A] 'tracepoint __tracepoint_android_vh_watchdog_timer_softlockup'
  [A] 'tracepoint __tracepoint_android_vh_wq_lockup_pool'
  [A] 'ktermios tty_std_termios'

Bug: 201598560

Change-Id: I74e725575a435865af714d5cad17dd6c7c600692
Signed-off-by: Woogeun Lee <woogeun.lee@samsung.com>
2021-09-30 13:43:14 +00:00
Kever Yang
f1a5448fa7 ANDROID: GKI: rockchip: Convert symbol to order by module
This patch does not add any new symbol, but make the symbol list order
by the module.

Bug: 194515348
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I0bec2f90a46ec92d7e391ab9e9c49180c4d87ae9
2021-09-30 18:40:06 +08:00
fengmingli
18d90d0300 ANDROID: GKI: Add a symbol to symbol list
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function int ucsi_send_command(ucsi*, u64, void*, size_t)'

Bug: 194373509

Change-Id: I93707355c2e37aef92d243e5ad324bac5487a804
Signed-off-by: fengmingli <mingli.feng@vivo.com>
2021-09-30 04:35:10 +08:00
Sudarshan Rajagopalan
cb7a5d58a9 FROMLIST: arm64: mm: update max_pfn after memory hotplug
After new memory blocks have been hotplugged, max_pfn and max_low_pfn
needs updating to reflect on new PFNs being hot added to system.
Without this patch, debug-related functions that use max_pfn such as
get_max_dump_pfn() or read_page_owner() will not work with any page in
memory that is hot-added after boot.

Link: https://lore.kernel.org/lkml/cover.1632853776.git.quic_cgoldswo@quicinc.com/T/#md084740c6377eb12369bfe6eb8786f4689dc8498
Bug: 200171991
Fixes: 4ab2150615 ("arm64: Add memory hotplug support")
Signed-off-by: Sudarshan Rajagopalan <quic_sudaraja@quicinc.com>
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Georgi Djakov <quic_c_gdjako@quicinc.com>
Change-Id: I1cb50889299957c871c498e19aa05778c7583c9d
2021-09-28 19:15:36 +00:00
huangqiujun
477cd8fd78 ANDROID: GKI: Update symbols to symbol list
Update symbols to symbol list externed by oem modules.

Leaf changes summary: 18 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 13 Added
functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 5 Added
variables

13 Added functions:

  [A] 'function int __traceiter_android_vh_kmalloc_slab(void*, unsigned
int, gfp_t, kmem_cache**)'
  [A] 'function int __traceiter_android_vh_save_track_hash(void*, bool,
unsigned long int)'
  [A] 'function int __traceiter_android_vh_save_vmalloc_stack(void*,
unsigned long int, vm_struct*)'
  [A] 'function int __traceiter_android_vh_show_stack_hash(void*,
seq_file*, vm_struct*)'
  [A] 'function void cpufreq_update_limits(unsigned int)'
  [A] 'function bool inode_owner_or_capable(const inode*)'
  [A] 'function int inode_permission(inode*, int)'
  [A] 'function void on_each_cpu_cond(smp_cond_func_t, smp_call_func_t,
void*, bool)'
  [A] 'function void pm_get_active_wakeup_sources(char*, size_t)'
  [A] 'function int rtc_read_alarm(rtc_device*, rtc_wkalrm*)'
  [A] 'function int rtc_set_alarm(rtc_device*, rtc_wkalrm*)'
  [A] 'function u8 sdio_writeb_readb(sdio_func*, u8, unsigned int,
int*)'
  [A] 'function unsigned long int timespec64_to_jiffies(const
timespec64*)'

5 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_kmalloc_slab'
  [A] 'tracepoint __tracepoint_android_vh_save_track_hash'
  [A] 'tracepoint __tracepoint_android_vh_save_vmalloc_stack'
  [A] 'tracepoint __tracepoint_android_vh_show_stack_hash'
  [A] 'static_key_false memcg_kmem_enabled_key'

Bug: 193384408

Change-Id: Iafe49d5a0ca39542d7f109e79f496346009ac7b7
Signed-off-by: huangqiujun <huangqiujun@oppo.com>
2021-09-28 17:23:59 +00:00
Gao Xiang
dcd77f0b74 UPSTREAM: erofs: fix 1 lcluster-sized pcluster for big pcluster
If the 1st NONHEAD lcluster of a pcluster isn't CBLKCNT lcluster type
rather than a HEAD or PLAIN type instead, which means its pclustersize
_must_ be 1 lcluster (since its uncompressed size < 2 lclusters),
as illustrated below:

       HEAD     HEAD / PLAIN    lcluster type
   ____________ ____________
  |_:__________|_________:__|   file data (uncompressed)
   .                .
  .____________.
  |____________|                pcluster data (compressed)

Such on-disk case was explained before [1] but missed to be handled
properly in the runtime implementation.

It can be observed if manually generating 1 lcluster-sized pcluster
with 2 lclusters (thus CBLKCNT doesn't exist.) Let's fix it now.

[1] https://lore.kernel.org/r/20210407043927.10623-1-xiang@kernel.org

Link: https://lore.kernel.org/r/20210510064715.29123-1-xiang@kernel.org
Fixes: cec6e93bea ("erofs: support parsing big pcluster compress indexes")
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>

Bug: 201372112
Change-Id: I7e46baa993790f8908287ac36e19d32e536116db
(cherry picked from commit 0852b6ca94)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:33:46 +00:00
Gao Xiang
e085d3f0d0 UPSTREAM: erofs: enable big pcluster feature
Enable COMPR_CFGS and BIG_PCLUSTER since the implementations are
all settled properly.

Link: https://lore.kernel.org/r/20210407043927.10623-11-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I85a9045c146b6877eb371904e82d0481e21bbb75
(cherry picked from commit 8e6c8fa9f2)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:33:20 +00:00
Gao Xiang
ed0607cc52 UPSTREAM: erofs: support decompress big pcluster for lz4 backend
Prior to big pcluster, there was only one compressed page so it'd
easy to map this. However, when big pcluster is enabled, more work
needs to be done to handle multiple compressed pages. In detail,

 - (maptype 0) if there is only one compressed page + no need
   to copy inplace I/O, just map it directly what we did before;

 - (maptype 1) if there are more compressed pages + no need to
   copy inplace I/O, vmap such compressed pages instead;

 - (maptype 2) if inplace I/O needs to be copied, use per-CPU
   buffers for decompression then.

Another thing is how to detect inplace decompression is feasable or
not (it's still quite easy for non big pclusters), apart from the
inplace margin calculation, inplace I/O page reusing order is also
needed to be considered for each compressed page. Currently, if the
compressed page is the xth page, it shouldn't be reused as [0 ...
nrpages_out - nrpages_in + x], otherwise a full copy will be triggered.

Although there are some extra optimization ideas for this, I'd like
to make big pcluster work correctly first and obviously it can be
further optimized later since it has nothing with the on-disk format
at all.

Link: https://lore.kernel.org/r/20210407043927.10623-10-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I8e8b90bd0a401850ea81d895dc55e5d8a2772ed7
(cherry picked from commit 598162d050)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:32:20 +00:00
Gao Xiang
d34cb6cdc0 UPSTREAM: erofs: support parsing big pcluster compact indexes
Different from non-compact indexes, several lclusters are packed
as the compact form at once and an unique base blkaddr is stored for
each pack, so each lcluster index would take less space on avarage
(e.g. 2 bytes for COMPACT_2B.) btw, that is also why BIG_PCLUSTER
switch should be consistent for compact head0/1.

Prior to big pcluster, the size of all pclusters was 1 lcluster.
Therefore, when a new HEAD lcluster was scanned, blkaddr would be
bumped by 1 lcluster. However, that way doesn't work anymore for
big pcluster since we actually don't know the compressed size of
pclusters in advance (before reading CBLKCNT lcluster).

So, instead, let blkaddr of each pack be the first pcluster blkaddr
with a valid CBLKCNT, in detail,

 1) if CBLKCNT starts at the pack, this first valid pcluster is
    itself, e.g.
  _____________________________________________________________
 |_CBLKCNT0_|_NONHEAD_| .. |_HEAD_|_CBLKCNT1_| ... |_HEAD_| ...
 ^ = blkaddr base          ^ += CBLKCNT0           ^ += CBLKCNT1

 2) if CBLKCNT doesn't start at the pack, the first valid pcluster
    is the next pcluster, e.g.
  _________________________________________________________
 | NONHEAD_| .. |_HEAD_|_CBLKCNT0_| ... |_HEAD_|_HEAD_| ...
                ^ = blkaddr base        ^ += CBLKCNT0
                                               ^ += 1

When a CBLKCNT is found, blkaddr will be increased by CBLKCNT
lclusters, or a new HEAD is found immediately, bump blkaddr by 1
instead (see the picture above.)

Also noted if CBLKCNT is the end of the pack, instead of storing
delta1 (distance of the next HEAD lcluster) as normal NONHEADs,
it still uses the compressed block count (delta0) since delta1
can be calculated indirectly but the block count can't.

Adjust decoding logic to fit big pcluster compact indexes as well.

Link: https://lore.kernel.org/r/20210407043927.10623-9-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I09d6bb4c9d390dc6169cb9dd4efbc7fd6b3be5d0
(cherry picked from commit b86269f438)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:31:56 +00:00
Gao Xiang
051d76b899 UPSTREAM: erofs: support parsing big pcluster compress indexes
When INCOMPAT_BIG_PCLUSTER sb feature is enabled, legacy compress indexes
will also have the same on-disk header compact indexes to keep per-file
configurations instead of leaving it zeroed.

If ADVISE_BIG_PCLUSTER is set for a file, CBLKCNT will be loaded for each
pcluster in this file by parsing 1st non-head lcluster.

Link: https://lore.kernel.org/r/20210407043927.10623-8-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I97b8d1cc54e057789d22f1cdfafc21ed6a69b149
(cherry picked from commit cec6e93bea)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:31:46 +00:00
Gao Xiang
d149931601 UPSTREAM: erofs: adjust per-CPU buffers according to max_pclusterblks
Adjust per-CPU buffers on demand since big pcluster definition is
available. Also, bail out unsupported pcluster size according to
Z_EROFS_PCLUSTER_MAX_SIZE.

Link: https://lore.kernel.org/r/20210407043927.10623-7-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I86665be0519f328614d93aa24cb06043655576b9
(cherry picked from commit 4fea63f7d7)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:31:21 +00:00
Gao Xiang
95a1d5df84 UPSTREAM: erofs: add big physical cluster definition
Big pcluster indicates the size of compressed data for each physical
pcluster is no longer fixed as block size, but could be more than 1
block (more accurately, 1 logical pcluster)

When big pcluster feature is enabled for head0/1, delta0 of the 1st
non-head lcluster index will keep block count of this pcluster in
lcluster size instead of 1. Or, the compressed size of pcluster
should be 1 lcluster if pcluster has no non-head lcluster index.

Also note that BIG_PCLUSTER feature reuses COMPR_CFGS feature since
it depends on COMPR_CFGS and will be released together.

Link: https://lore.kernel.org/r/20210407043927.10623-6-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: Ibd33f2764f4420f370f9293ed325efdba9ea70a7
(cherry picked from commit 5404c33010)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:30:24 +00:00
Gao Xiang
8043aaed1d UPSTREAM: erofs: fix up inplace I/O pointer for big pcluster
When picking up inplace I/O pages, it should be traversed in reverse
order in aligned with the traversal order of file-backed online pages.
Also, index should be updated together when preloading compressed pages.

Previously, only page-sized pclustersize was supported so no problem
at all. Also rename `compressedpages' to `icpage_ptr' to reflect its
functionality.

Link: https://lore.kernel.org/r/20210407043927.10623-5-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I752769d004c18f74636bcfdea767572daa6f7072
(cherry picked from commit 81382f5f5c)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:29:52 +00:00
Gao Xiang
6ad2f8f169 UPSTREAM: erofs: introduce physical cluster slab pools
Since multiple pcluster sizes could be used at once, the number of
compressed pages will become a variable factor. It's necessary to
introduce slab pools rather than a single slab cache now.

This limits the pclustersize to 1M (Z_EROFS_PCLUSTER_MAX_SIZE), and
get rid of the obsolete EROFS_FS_CLUSTER_PAGE_LIMIT, which has no
use now.

Link: https://lore.kernel.org/r/20210407043927.10623-4-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I821f3cf35820dbb320eeedc3ae934fd1d455dfd7
(cherry picked from commit 9f6cc76e6f)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:29:22 +00:00
Gao Xiang
432f58b100 UPSTREAM: erofs: introduce multipage per-CPU buffers
To deal the with the cases which inplace decompression is infeasible
for some inplace I/O. Per-CPU buffers was introduced to get rid of page
allocation latency and thrash for low-latency decompression algorithms
such as lz4.

For the big pcluster feature, introduce multipage per-CPU buffers to
keep such inplace I/O pclusters temporarily as well but note that
per-CPU pages are just consecutive virtually.

When a new big pcluster fs is mounted, its max pclustersize will be
read and per-CPU buffers can be growed if needed. Shrinking adjustable
per-CPU buffers is more complex (because we don't know if such size
is still be used), so currently just release them all when unloading.

Link: https://lore.kernel.org/r/20210409190630.19569-1-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I5b3ab69ef58aaea635911b0c08cceeb4b38122da
(cherry picked from commit 524887347f)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:28:24 +00:00
Vladimir Zapolskiy
571c9a0bd3 UPSTREAM: erofs: remove a void EROFS_VERSION macro set in Makefile
Since commit 4f761fa253 ("erofs: rename errln/infoln/debugln to
erofs_{err, info, dbg}") the defined macro EROFS_VERSION has no affect,
therefore removing it from the Makefile is a non-functional change.

Link: https://lore.kernel.org/r/20201030122839.25431-1-vladimir@tuxera.com
Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I06df2883e85d4bfdc08bccb7aa7c014570cd156b
(cherry picked from commit a426ce9d67)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:27:55 +00:00
Gao Xiang
431d73396d UPSTREAM: erofs: reserve physical_clusterbits[]
Formal big pcluster design is actually more powerful / flexable than
the previous thought whose pclustersize was fixed as power-of-2 blocks,
which was obviously inefficient and space-wasting. Instead, pclustersize
can now be set independently for each pcluster, so various pcluster
sizes can also be used together in one file if mkfs wants (for example,
according to data type and/or compression ratio).

Let's get rid of previous physical_clusterbits[] setting (also notice
that corresponding on-disk fields are still 0 for now). Therefore,
head1/2 can be used for at most 2 different algorithms in one file and
again pclustersize is now independent of these.

Link: https://lore.kernel.org/r/20210407043927.10623-2-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I7db236f06b202949b882a366b347f0c4e9dc0c3e
(cherry picked from commit 54e0b6c873)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:27:22 +00:00
Ruiqi Gong
89dbc6246a UPSTREAM: erofs: Clean up spelling mistakes found in fs/erofs
zmap.c: s/correspoinding/corresponding
zdata.c: s/endding/ending

Link: https://lore.kernel.org/r/20210331093920.31923-1-gongruiqi1@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ruiqi Gong <gongruiqi1@huawei.com>
Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: Ie848ca314462a8093fe94405b260c12b23b663b9
(cherry picked from commit fe6adcce7e)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:26:25 +00:00
Gao Xiang
ac1f14e9d5 UPSTREAM: erofs: add on-disk compression configurations
Add a bitmap for available compression algorithms and a variable-sized
on-disk table for compression options in preparation for upcoming big
pcluster and LZMA algorithm, which follows the end of super block.

To parse the compression options, the bitmap is scanned one by one.
For each available algorithm, there is data followed by 2-byte `length'
correspondingly (it's enough for most cases, or entire fs blocks should
be used.)

With such available algorithm bitmap, kernel itself can also refuse to
mount such filesystem if any unsupported compression algorithm exists.

Note that COMPR_CFGS feature will be enabled with BIG_PCLUSTER.

Link: https://lore.kernel.org/r/20210329100012.12980-1-hsiangkao@aol.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I9f9c69d5cd05da8c5f17e3650511e83c5f89200e
(cherry picked from commit 14373711dd)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:26:06 +00:00
Gao Xiang
cd21e62366 UPSTREAM: erofs: introduce on-disk lz4 fs configurations
Introduce z_erofs_lz4_cfgs to store all lz4 configurations.
Currently it's only max_distance, but will be used for new
features later.

Link: https://lore.kernel.org/r/20210329012308.28743-4-hsiangkao@aol.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: Ib9873b530bdc82f8cc5e79ac85ede737d883ff12
(cherry picked from commit 46249cded1)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:25:23 +00:00
Gao Xiang
e17fd2ac9d UPSTREAM: erofs: introduce erofs_sb_has_xxx() helpers
Introduce erofs_sb_has_xxx() to make long checks short, especially
for later big pcluster & LZMA features.

Link: https://lore.kernel.org/r/20210329012308.28743-2-hsiangkao@aol.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I145fa9c670284b609b59a246f918fb09dc562356
(cherry picked from commit de06a6a375)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:24:39 +00:00
Yue Hu
ba1a3d1fb2 UPSTREAM: erofs: don't use erofs_map_blocks() any more
Currently, erofs_map_blocks() will be called only from
erofs_{bmap, read_raw_page} which are all for uncompressed files.
So, the compression branch in erofs_map_blocks() is pointless. Let's
remove it and use erofs_map_blocks_flatmode() directly. Also update
related comments.

Link: https://lore.kernel.org/r/20210325071008.573-1-zbestahu@gmail.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: Ic3362c62d7c917f05f1cd11120ee6280a22221b8
(cherry picked from commit 8137824edd)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:23:24 +00:00
Gao Xiang
384b2cdaf8 UPSTREAM: erofs: complete a missing case for inplace I/O
Add a missing case which could cause unnecessary page allocation but
not directly use inplace I/O instead, which increases runtime extra
memory footprint.

The detail is, considering an online file-backed page, the right half
of the page is chosen to be cached (e.g. the end page of a readahead
request) and some of its data doesn't exist in managed cache, so the
pcluster will be definitely kept in the submission chain. (IOWs, it
cannot be decompressed without I/O, e.g., due to the bypass queue).

Currently, DELAYEDALLOC/TRYALLOC cases can be downgraded as NOINPLACE,
and stop online pages from inplace I/O. After this patch, unneeded page
allocations won't be observed in pickup_page_for_submission() then.

Link: https://lore.kernel.org/r/20210321183227.5182-1-hsiangkao@aol.com
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Bug: 201372112
Change-Id: I639279e87b749b8625d2a8e77055a9fc52073542
(cherry picked from commit 0b964600d3)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-09-28 08:21:51 +00:00
Minchan Kim
a9ac6ae90e BACKPORT: UPSTREAM: mm: fs: invalidate bh_lrus for only cold path
kernel test robot reported the regression of fio.write_iops[1] with [2].

Since lru_add_drain is called frequently, invalidate bh_lrus there could
increase bh_lrus cache miss ratio, which needs more IO in the end.

This patch moves the bh_lrus invalidation from the hot path( e.g.,
zap_page_range, pagevec_release) to cold path(i.e., lru_add_drain_all,
lru_cache_disable).

"Xing, Zhengjun" confirmed

: I test the patch, the regression reduced to -2.9%.

[1] https://lore.kernel.org/lkml/20210520083144.GD14190@xsang-OptiPlex-9020/
[2] 8cc621d2f4, mm: fs: invalidate BH LRU during page migration

Bug: 194673488
Link: https://lkml.kernel.org/r/20210907212347.1977686-1-minchan@kernel.org
(cherry picked from commit 243418e392)
[Chris: resolved conflicts due to Minchan's AOSP LRU commits]
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: kernel test robot <oliver.sang@intel.com>
Reviewed-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
Tested-by: "Xing, Zhengjun" <zhengjun.xing@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
Change-Id: Icc5e456b058df516480b4378853464d6d7b43505
2021-09-27 17:48:37 -07:00
Guangming Cao
49af2e35d5 FROMLIST: dma-buf: support users to change dma_buf.name
User space user can call DMA_BUF_SET_NAME to set dma_buf.name,
but until now we can't set it at kernel side, it's difficult to debug
kernel dma_buf users.

There are some kernel users of dma_heap also need it at MTK,
such as camera, it's also have a allocator for other camera part,
unlike most case in userspace, it's in kernel.
For debug buffer owner, we need add it to let it can set debug name
for each dmabuf, so that we can know dmabuf owner by dma_buf.name.

Bug: 193623372
Link: https://lore.kernel.org/patchwork/patch/1459719/
Change-Id: Iac5c6b8838b9b4d976f4525d000e17a3abab94f6
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
2021-09-27 22:58:57 +00:00
Liangliang Li
3b1f439841 ANDROID: GKI: Update symbol list for vivo
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added variable:

  [A] 'tracepoint __tracepoint_android_rvh_refrigerator'

Bug: 201184466
Change-Id: I135ebbc5cf8a2ac6c41da523c4f222887b9af440
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-09-27 18:15:57 +00:00
Bicycle Tsai
c82dbcbec1 BACKPORT: ASoC: soc-pcm: Get all BEs along DAPM path
dpcm_end_walk_at_be() stops the graph walk when first BE is found for
the given FE component. In a component model we may want to connect
multiple DAIs from different components. A new flag is introduced in
'snd_soc_card', which when set allows DAI/component chaining. Later
PCM operations can be called for all these listed components for a
valid DAPM path.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link:
https://lore.kernel.org/r/1604329814-24779-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 198732156
(cherry picked from commit aa293777bf)

[ refactored to avoid breaking KMI ]
ALSA machine driver can setup component_chaining like below code slice.

static int my_board_late_probe(struct snd_soc_card *card)
{
	struct snd_soc_card_ext *card_ext =
		container_of(card, struct snd_soc_card_ext, card);

	card_ext->component_chaining = 1;

	return 0;
}

static struct snd_soc_card my_board_card = {
	.name = MY_BOARD_NAME,
	.owner = THIS_MODULE,
	.dai_link = my_board_dai_links,
	.num_links = ARRAY_SIZE(my_board_dai_links),
	.late_probe = my_board_late_probe,
};

Change-Id: Icc9e9b120e721a620f7c9f49515342422f80edb7
Signed-off-by: Bicycle Tsai <bicycle.tsai@mediatek.com>
2021-09-27 09:43:32 +00:00
Shaleen Agrawal
de7ca5e752 ANDROID: Disable CFI on trace hooks
Disable CFI on trace hooks, as this improves some lmbench
microbenchmarks by as much as 12%.

Bug: 200542217
Change-Id: I6ad1d12047c4e69743ff94cf0ea8f70f5023c7da
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-09-24 11:31:35 -07:00
Alistair Delva
38532a9f24 ANDROID: GKI: Update symbol list for new modules
virtio-snd, gs-usb and the mac80211 modularization were done without
regenerating the symbol list for the virtual device. Fix it.

Bug: 175151042
Change-Id: Ie6ca12c9dcbcb29057d4fb9c7478abac086e4088
Signed-off-by: Alistair Delva <adelva@google.com>
2021-09-24 16:09:15 +00:00
Louis Kuo
099e8c7741 ANDROID: Update symbol list for mtk
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function int __v4l2_ctrl_s_ctrl_compound(v4l2_ctrl*, v4l2_ctrl_type, void*)'

Bug: 201043981
Change-Id: I57c70790e02324767314fc84bf53fb593e3e316d
Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
2021-09-24 14:13:53 +00:00
Alessio Balsini
cfc0a49c73 ANDROID: fs/fuse: Keep FUSE file times consistent with lower file
When FUSE passthrough is used, the lower file system file is manipulated
directly, but neither mtime, atime or ctime of the referencing FUSE file
is updated.

Fix by updating the file times when passthrough operations are
performed.

Bug: 200779468
Reported-by: Fengnan Chang <changfengnan@vivo.com>
Reported-by: Ed Tsai <ed.tsai@mediatek.com>
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I35b72196b2cc1d79a9f62ddb32e2cfa934c3b6d3
2021-09-24 13:30:08 +00:00
Liangliang Li
cdbeb135e5 ANDROID: GKI: Update symbols to symbol list
Add symbol to symbol list for oem module.

Leaf changes summary: 6 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 3 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 3 Added variables

3 Added functions:

  [A] 'function int _kstrtoul(const char*, unsigned int, unsigned long int*)'
  [A] 'function int profile_event_register(profile_type, notifier_block*)'
  [A] 'function int profile_event_unregister(profile_type, notifier_block*)'

3 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_dup_task_struct'
  [A] 'tracepoint __tracepoint_android_vh_irqtime_account_process_tick'
  [A] 'tracepoint __tracepoint_android_vh_vmpressure'

Bug: 200339191

Change-Id: I7ca0bdc942d26d45b9e19568e66734517d197c73
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-09-24 11:16:27 +00:00
Todd Kjos
66e24eb093 Revert "ANDROID: mm: page_pinner: use EXPORT_SYMBOL_GPL"
This reverts commit d820d22b5d.

Reason for revert: Needed for non-GPL use of put_page() which is allowed by upstream kernel.

Change-Id: I9a2a51c1e2d11ccc5403fc5a8510f577446add92
Signed-off-by: Todd Kjos <tkjos@google.com>
2021-09-23 23:47:26 +00:00
Lee Jones
5f10883630 Revert "FROMLIST: USB: gadget: f_fs: add SuperSpeed Plus support"
This reverts commit cac70628fb.

This functionality is provided by upstream commit:

  a353397b0d ("usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus")

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Change-Id: I02ad16f4ac031f87e1567c00daaa3f6213a0a06d
(cherry picked from commit 4e307150ee)
2021-09-23 12:55:52 +00:00
Rajkumar Subbiah
4e6242598d UPSTREAM: drm/dp_mst: Fix return code on sideband message failure
Commit 2f015ec6ea ("drm/dp_mst: Add sideband down request tracing +
selftests") added some debug code for sideband message tracing. But
it seems to have unintentionally changed the behavior on sideband message
failure. It catches and returns failure only if DRM_UT_DP is enabled.
Otherwise it ignores the error code and returns success. So on an MST
unplug, the caller is unaware that the clear payload message failed and
ends up waiting for 4 seconds for the response. Fixes the issue by
returning the proper error code.

Changes in V2:
-- Revise commit text as review comment
-- add Fixes text

Changes in V3:
-- remove "unlikely" optimization

Fixes: 2f015ec6ea ("drm/dp_mst: Add sideband down request tracing + selftests")
Change-Id: Id45a9308d05134e4874144782e31bd92c7f9faae
(cherry picked from commit bb693c114e)
Cc: <stable@vger.kernel.org> # v5.5+
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1625585434-9562-1-git-send-email-khsieh@codeaurora.org
2021-09-23 00:24:57 +00:00
Wesley Cheng
bb13ff0598 BACKPORT: FROMGIT: usb: dwc3: gadget: Avoid starting DWC3 gadget during UDC unbind
There is a race present where the DWC3 runtime resume runs in parallel
to the UDC unbind sequence.  This will eventually lead to a possible
scenario where we are enabling the run/stop bit, without a valid
composition defined.

Thread#1 (handling UDC unbind):
usb_gadget_remove_driver()
-->usb_gadget_disconnect()
  -->dwc3_gadget_pullup(0)
--> continue UDC unbind sequence
-->Thread#2 is running in parallel here

Thread#2 (handing next cable connect)
__dwc3_set_mode()
  -->pm_runtime_get_sync()
    -->dwc3_gadget_resume()
      -->dwc->gadget_driver is NOT NULL yet
      -->dwc3_gadget_run_stop(1)
      --> _dwc3gadget_start()
...

Fix this by tracking the pullup disable routine, and avoiding resuming
of the DWC3 gadget.  Once the UDC is re-binded, that will trigger the
pullup enable routine, which would handle enabling the DWC3 gadget.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/20210917021852.2037-1-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 200287549
(cherry picked from commit 8217f07a50
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing)
[wcheng: Fixed KMI breakage by moving softconnect to a new parent structure]
Change-Id: I9554933826710cc68136b08176290584f9ab74df
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
2021-09-22 23:33:27 +00:00
Kamal Agrawal
0671bafa24 UPSTREAM: tracing: Fix NULL pointer dereference in start_creating
The event_trace_add_tracer() can fail. In this case, it leads to a crash
in start_creating with below call stack. Handle the error scenario
properly in trace_array_create_dir.

Call trace:
down_write+0x7c/0x204
start_creating.25017+0x6c/0x194
tracefs_create_file+0xc4/0x2b4
init_tracer_tracefs+0x5c/0x940
trace_array_create_dir+0x58/0xb4
trace_array_create+0x1bc/0x2b8
trace_array_get_by_name+0xdc/0x18c

Link: https://lkml.kernel.org/r/1627651386-21315-1-git-send-email-kamaagra@codeaurora.org

Cc: stable@vger.kernel.org
Fixes: 4114fbfd02 ("tracing: Enable creating new instance early boot")
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Bug: 200485226
Change-Id: I79946d9bfc3ffd129bbb1e5fa6460ec0a51f8e59
(cherry picked from commit ff41c28c4b)
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
2021-09-20 19:02:31 +05:30
Denis Hsu
aae44f81e3 ANDROID: enable MTK RNDIS
The performance of RNDIS driver in kernel 5.10 is insufficient to meet
the requirement introduced by 5G. MTK RNDIS driver integrates
TX/RX aggregation and fine-tune performance to achieve the goal.

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function int dev_set_mac_address(net_device*, sockaddr*, netlink_ext_ack*)'
  [A] 'function config_group* usb_os_desc_prepare_interf_dir(config_group*, int, usb_os_desc**, char**, module*)'

Bug: 198379444
Change-Id: I04d669c6d67af778a283b5358c5f1e0b1ded83d4
Signed-off-by: Denis Hsu <denis.hsu@mediatek.com>
2021-09-17 11:58:26 -07:00
Michael Adisumarta
f278b215d4 ANDROID: abi_gki_aarch64_qcom: Add 2 new symbols for gsi
Add symbols for platform_msi_domain_free_irqs and
gsi_update_almst_empty_thrshold.

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function int platform_msi_domain_alloc_irqs(device*, unsigned int, irq_write_msi_msg_t)'
  [A] 'function void platform_msi_domain_free_irqs(device*)'

Bug: 200009693
Change-Id: I91d17a944fa838b3d8be2eea7eb2f0d7a41d211f
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
Signed-off-by: Paresh Purabhiya <quic_ppurabhi@quicinc.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
2021-09-17 09:43:50 -07:00
Rick Yiu
e21fe3ef80 ANDROID: Update the ABI representation
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added function:

  [A] 'function void __rt_mutex_init(rt_mutex*, const char*, lock_class_key*)'

Bug: 198085505
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I97766c915eba89d6d085e32a20cbb416d58de90a
2021-09-17 15:44:10 +00:00