Commit Graph

1147709 Commits

Author SHA1 Message Date
Treehugger Robot
efa2b2fcf5 Merge "Merge 6.1.19 into android14-6.1" into android14-6.1 2023-03-22 13:16:37 +00:00
Greg Kroah-Hartman
10c3b0f221 ANDROID: update the db845c symbol list
In 6.1.18 a number of new symbols were needed to keep the db845c config
building properly, so add them to the list:

2 function symbol(s) added
  'void debugfs_lookup_and_remove(const char*, struct dentry*)'
  'struct drm_private_state* drm_atomic_get_old_private_obj_state(struct drm_atomic_state*, struct drm_private_obj*)'

Fixes: 1cc3fcf631 ("Linux 6.1.18")
Change-Id: I71ef20b6bfe22c3a465b34a0aed1fda78faaa9cf
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-22 10:14:03 +00:00
Greg Kroah-Hartman
9e199d3fbc ANDROID: Update the .stg file due to internal io_uring changes
Commit c6b9c79c3d ("io_uring/poll: allow some retries for poll
triggering spuriously") changes the struct io_poll internal structure,
which is not exposed to any actual module code, but is noticed by the
checking tools.  Update the signatures to handle this as it is not an
actual ABI break.

type 'struct io_poll' changed
  member 'int retries' was added

Fixes: c6b9c79c3d ("io_uring/poll: allow some retries for poll triggering spuriously")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1b29e0a9e005f56963a41daad9122062c6b21619
2023-03-22 10:14:03 +00:00
Greg Kroah-Hartman
b5a444808a Revert "netfilter: ctnetlink: make event listener tracking global"
This reverts commit ffba2d5790.

It breaks the ABI right now, but will be brought back at the next ABI
break as it will be needed for Android systems.

Bug: 161946584
Change-Id: I0476c8ac0f438e21e0fa99a746c779ecc3d5d49e
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-22 10:14:03 +00:00
Greg Kroah-Hartman
1a291b98a3 Revert "PCI: loongson: Prevent LS7A MRRS increases"
This reverts commit d8c911d3d8.

It breaks the ABI right now, but will be brought back at the next ABI
break as it will be needed for Android systems.

Bug: 161946584
Change-Id: I8543def5fb03133f4772ba1976f882d182bba677
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-22 10:14:03 +00:00
Greg Kroah-Hartman
8c8619f60e Revert "PCI: loongson: Add more devices that need MRRS quirk"
This reverts commit 2d07ad44e7.

It breaks the ABI right now, but will be brought back at the next ABI
break as it will be needed for Android systems.

Bug: 161946584
Change-Id: I0d81c2395d7e4e42c81631040b40e936f2ccdf6a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-22 10:14:03 +00:00
Greg Kroah-Hartman
9c6b68b917 ANDROID: remove CONFIG_NET_CLS_TCINDEX from gki_defconfig
The tcindex code was removed from the tree, so remove the config option
from the gki_defconfig files to fix up the build.

Fixes: 3abebc503a ("net/sched: Retire tcindex classifier")
Change-Id: Id4927815ec2fd0ebc8065d891dfb721551f3dbc6
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-22 10:14:03 +00:00
Matthias Männich
a58297e0d2 Merge "Merge 6.1.18 into android14-6.1" into android14-6.1 2023-03-22 10:14:03 +00:00
Ramji Jiyani
a1015478eb ANDROID: GKI: Enable USB C DP alternate mode support
CONFIG_TYPEC_DP_ALTMODE: DisplayPort Alternate Mode driver

DisplayPort USB Type-C Alternate Mode allows DisplayPort
displays and adapters to be attached to the USB Type-C
connectors on the system.

Bug: 273310676
Test: TH
Change-Id: Iedde3b15911674161a5a5aa658afdce26aa6d2fe
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
2023-03-22 07:55:45 +00:00
Wesley Cheng
e106fe093e ANDROID: abi_gki_aarch64_qcom: Add USB offload symbols
Add the required USB SND and XHCI symbols required for USB offload support
using Android vendor hooks.

Symbols added:
  xhci_alloc_command
  xhci_alloc_erst
  xhci_free_command
  xhci_queue_stop_endpoint
  xhci_ring_alloc
  xhci_ring_cmd_db
  xhci_ring_free
  xhci_trb_virt_to_dma
  __tracepoint_android_vh_audio_usb_offload_connect
  __tracepoint_android_rvh_audio_usb_offload_disconnect
  __traceiter_android_vh_audio_usb_offload_connect
  __traceiter_android_rvh_audio_usb_offload_disconnect
  snd_usb_autoresume
  snd_usb_autosuspend
  snd_usb_endpoint_close
  snd_usb_endpoint_open
  snd_usb_endpoint_prepare

Bug: 255912822
Change-Id: I25a708bd49cd14fd2751e10bc6787a3c83c9a7d6
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-03-22 02:29:10 +00:00
Jack Pham
c3007a3231 ANDROID: sound: usb: Add vendor hooks for connect & disconnect
Add vendor hooks to capture when a USB audio interface is probed
and disconnected.  These will allow for supporting offloading of
audio device handling to a co-processor.

The disconnect hook needs to be restricted as the additional
vendor handling may need to perform operations (such as
wait_for_completion) in non-atomic context.

Upstream discussion ongoing
  https://lore.kernel.org/linux-usb/20230308235751.495-1-quic_wcheng@quicinc.com/

Add the previously used Android vendor hooks and exported symbol changes to android14-6.1 until official patches make it upstream.

Bug: 255912822
Change-Id: Idf1da95556814e0ffbdc5f9fb5a25563ebee9be2
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-03-22 02:29:10 +00:00
Jack Pham
436cbc5a2e ANDROID: sound: usb: Export symbols for endpoint management
Export the following symbols which are needed to support
USB audio offload to a co-processor.

snd_usb_autoresume
snd_usb_autosuspend
snd_usb_endpoint_open
snd_usb_endpoint_close
snd_usb_endpoint_prepare
snd_usb_endpoint_set_params
snd_usb_power_domain_set

Upstream discussion ongoing
  https://lore.kernel.org/linux-usb/20230308235751.495-1-quic_wcheng@quicinc.com/

Add the previously used Android vendor hooks and exported symbol changes to android14-6.1 until official patches make it upstream.

Bug: 255912822
Change-Id: I8feaa225c7b869592b395815b3a7be47813c7aac
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-03-22 02:29:10 +00:00
Jack Pham
622f05f141 ANDROID: usb: host: export additional xhci symbols for ring management
Export the following xhci symbols which will allow vendor modules
to perform their own ring management. These will be used to create
and manage additional secondary rings that are used to offload to a
separate coprocessor which interacts with the xHC controller.

xhci_ring_alloc
xhci_ring_free
    - Allocate and free a struct xhci_ring.

xhci_alloc_erst
xhci_free_erst
    - Allocate and free event ring segment tables.

xhci_trb_virt_to_dma
    - Used to retrieve the DMA address of a TRB

xhci_ring_cmd_db
    - Notify the controller when a new command is issued

xhci_alloc_command
xhci_free_command
    - Allocate and free a struct xhci_command

xhci_queue_stop_endpoint
    - Issue a stop endpoint command to the controller

Upstream discussion ongoing
  https://lore.kernel.org/linux-usb/20230308235751.495-1-quic_wcheng@quicinc.com/

Add the previously used Android vendor hooks and exported symbol changes to android14-6.1 until official patches make it upstream.

Bug: 255912822
Change-Id: I9d4c5884108e656e890aca8137d4ef580bcd7a12
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-03-22 02:29:10 +00:00
Sukadev Bhattiprolu
e1288831fe ANDROID: ABI: Update QCOM symbol list
Add following symbols to the QCOM symbol list:

	__traceiter_android_rvh_iommu_alloc_insert_iova
	__traceiter_android_rvh_iommu_iovad_init_alloc_algo
	__traceiter_android_rvh_iommu_limit_align_shift

Bug: 274416898
Bug: 190519428
Change-Id: I34455fb96f69b67a494c2c6da000bb9c5e08ac2a
Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
2023-03-22 00:06:23 +00:00
Jaegeuk Kim
80b6086d4e FROMGIT: f2fs: remove entire rb_entry sharing
This is a last part to remove the memory sharing for rb_tree in extent_cache.

This should also fix arm32 memory alignment issue.

[struct extent_node]               [struct rb_entry]
[0] struct rb_node rb_node;        [0] struct rb_node rb_node;
  union {                              union {
    struct {                             struct {
[16]  unsigned int fofs;           [12]    unsigned int ofs;
      unsigned int len;                    unsigned int len;
                                         };
                                         unsigned long long key;
                                       } __packed;

Cc: <stable@vger.kernel.org>
Fixes: 13054c548a ("f2fs: introduce infra macro and data structure of rb-tree extent cache")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 6b40bc364c1073d7d26fb80c4a833025d9590311
https: //git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I5dd3b281971bf0f25c94660971ba993e09b30e35
2023-03-21 19:33:50 +00:00
Jaegeuk Kim
452772e3c4 FROMGIT: f2fs: factor out discard_cmd usage from general rb_tree use
This is a second part to remove the mixed use of rb_tree in discard_cmd from
extent_cache.

This should also fix arm32 memory alignment issue caused by shared rb_entry.

[struct discard_cmd]               [struct rb_entry]
[0] struct rb_node rb_node;        [0] struct rb_node rb_node;
  union {                              union {
    struct {                             struct {
[16]  block_t lstart;              [12]    unsigned int ofs;
      block_t len;                         unsigned int len;
                                         };
                                         unsigned long long key;
                                       } __packed;

Cc: <stable@vger.kernel.org>
Fixes: 004b686218 ("f2fs: use rb-tree to track pending discard commands")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 7e9775a516ff6c1e73ee2b42ec563cafee38f42f
https: //git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I61ee2b6bcc283406ca40f0ed7c3146de1e813d61
2023-03-21 19:33:50 +00:00
Jaegeuk Kim
2fb48c440e FROMGIT: f2fs: factor out victim_entry usage from general rb_tree use
Let's reduce the complexity of mixed use of rb_tree in victim_entry from
extent_cache and discard_cmd.

This should fix arm32 memory alignment issue caused by shared rb_entry.

[struct victim_entry]              [struct rb_entry]
[0] struct rb_node rb_node;        [0] struct rb_node rb_node;
                                       union {
                                         struct {
                                           unsigned int ofs;
                                           unsigned int len;
                                         };
[16] unsigned long long mtime;     [12] unsigned long long key;
                                       } __packed;

Cc: <stable@vger.kernel.org>
Fixes: 093749e296 ("f2fs: support age threshold based garbage collection")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit e433c78875858d5207a886a8bc3e33c02a544eb3
https: //git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
Change-Id: I0a59b05b293bfbd8479f748730b429ccfe5522a3
2023-03-21 19:33:50 +00:00
Bart Van Assche
7315ca1b05 UPSTREAM: loop: Fix use-after-free issues
do_req_filebacked() calls blk_mq_complete_request() synchronously or
asynchronously when using asynchronous I/O unless memory allocation fails.
Hence, modify loop_handle_cmd() such that it does not dereference 'cmd' nor
'rq' after do_req_filebacked() finished unless we are sure that the request
has not yet been completed. This patch fixes the following kernel crash:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000054
Call trace:
 css_put.42938+0x1c/0x1ac
 loop_process_work+0xc8c/0xfd4
 loop_rootcg_workfn+0x24/0x34
 process_one_work+0x244/0x558
 worker_thread+0x400/0x8fc
 kthread+0x16c/0x1e0
 ret_from_fork+0x10/0x20

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Dan Schatzberg <schatzberg.dan@gmail.com>
Fixes: c74d40e8b5 ("loop: charge i/o to mem and blk cg")
Fixes: bc07c10a36 ("block: loop: support DIO & AIO")
Bug: 274392428
Change-Id: I23f0508d73601dab8d4e094006f64ed7e79a5f02
(cherry picked from commit 9b0cb770f5)
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230314182155.80625-1-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
2023-03-21 18:49:56 +00:00
Paul Lawrence
47e132aed1 ANDROID: fuse-bpf: Correctly put backing files
Backing files were sometimes put twice before, this fixes it so backing
files sent in response to lookups are closed exactly once always

Test: fuse_test pases, Android no longer throws a double close
Bug: 273737310
Change-Id: Ifa75ffd846185cfabfd1f5bad504078d955c99ed
Signed-off-by: Paul Lawrence <paullawrence@google.com>
2023-03-21 17:57:55 +00:00
Greg Kroah-Hartman
d956976040 Merge 6.1.18 into android14-6.1
Changes in 6.1.18
	net/sched: Retire tcindex classifier
	auxdisplay: hd44780: Fix potential memory leak in hd44780_remove()
	fs/jfs: fix shift exponent db_agl2size negative
	driver: soc: xilinx: fix memory leak in xlnx_add_cb_for_notify_event()
	f2fs: don't rely on F2FS_MAP_* in f2fs_iomap_begin
	f2fs: fix to avoid potential deadlock
	objtool: Fix memory leak in create_static_call_sections()
	soc: mediatek: mtk-pm-domains: Allow mt8186 ADSP default power on
	memory: renesas-rpc-if: Split-off private data from struct rpcif
	memory: renesas-rpc-if: Move resource acquisition to .probe()
	soc: mediatek: mtk-svs: Enable the IRQ later
	pwm: sifive: Always let the first pwm_apply_state succeed
	pwm: stm32-lp: fix the check on arr and cmp registers update
	f2fs: introduce trace_f2fs_replace_atomic_write_block
	f2fs: correct i_size change for atomic writes
	f2fs: clear atomic_write_task in f2fs_abort_atomic_write()
	soc: mediatek: mtk-svs: restore default voltages when svs_init02() fail
	soc: mediatek: mtk-svs: reset svs when svs_resume() fail
	soc: mediatek: mtk-svs: Use pm_runtime_resume_and_get() in svs_init01()
	fs: f2fs: initialize fsdata in pagecache_write()
	f2fs: allow set compression option of files without blocks
	f2fs: fix to abort atomic write only during do_exist()
	um: vector: Fix memory leak in vector_config
	ubi: ensure that VID header offset + VID header size <= alloc, size
	ubifs: Fix build errors as symbol undefined
	ubifs: Fix memory leak in ubifs_sysfs_init()
	ubifs: Rectify space budget for ubifs_symlink() if symlink is encrypted
	ubifs: Rectify space budget for ubifs_xrename()
	ubifs: Fix wrong dirty space budget for dirty inode
	ubifs: do_rename: Fix wrong space budget when target inode's nlink > 1
	ubifs: Reserve one leb for each journal head while doing budget
	ubi: Fix use-after-free when volume resizing failed
	ubi: Fix unreferenced object reported by kmemleak in ubi_resize_volume()
	ubifs: Fix memory leak in alloc_wbufs()
	ubi: Fix possible null-ptr-deref in ubi_free_volume()
	ubifs: Re-statistic cleaned znode count if commit failed
	ubifs: dirty_cow_znode: Fix memleak in error handling path
	ubifs: ubifs_writepage: Mark page dirty after writing inode failed
	ubifs: ubifs_releasepage: Remove ubifs_assert(0) to valid this process
	ubi: fastmap: Fix missed fm_anchor PEB in wear-leveling after disabling fastmap
	ubi: Fix UAF wear-leveling entry in eraseblk_count_seq_show()
	ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed
	f2fs: fix to avoid potential memory corruption in __update_iostat_latency()
	soc: qcom: stats: Populate all subsystem debugfs files
	ext4: use ext4_fc_tl_mem in fast-commit replay path
	ext4: don't show commit interval if it is zero
	netfilter: nf_tables: allow to fetch set elements when table has an owner
	x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list
	um: virtio_uml: free command if adding to virtqueue failed
	um: virtio_uml: mark device as unregistered when breaking it
	um: virtio_uml: move device breaking into workqueue
	um: virt-pci: properly remove PCI device from bus
	f2fs: synchronize atomic write aborts
	watchdog: rzg2l_wdt: Issue a reset before we put the PM clocks
	watchdog: rzg2l_wdt: Handle TYPE-B reset for RZ/V2M
	watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
	watchdog: Fix kmemleak in watchdog_cdev_register
	watchdog: pcwd_usb: Fix attempting to access uninitialized memory
	watchdog: sbsa_wdog: Make sure the timeout programming is within the limits
	netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()
	netfilter: conntrack: fix rmmod double-free race
	netfilter: ip6t_rpfilter: Fix regression with VRF interfaces
	netfilter: ebtables: fix table blob use-after-free
	netfilter: xt_length: use skb len to match in length_mt6
	netfilter: ctnetlink: make event listener tracking global
	netfilter: x_tables: fix percpu counter block leak on error path when creating new netns
	ptp: vclock: use mutex to fix "sleep on atomic" bug
	drm/i915: move a Kconfig symbol to unbreak the menu presentation
	ipv6: Add lwtunnel encap size of all siblings in nexthop calculation
	octeontx2-pf: Recalculate UDP checksum for ptp 1-step sync packet
	net: sunhme: Fix region request
	sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop
	octeontx2-pf: Use correct struct reference in test condition
	net: fix __dev_kfree_skb_any() vs drop monitor
	9p/xen: fix version parsing
	9p/xen: fix connection sequence
	9p/rdma: unmap receive dma buffer in rdma_request()/post_recv()
	spi: tegra210-quad: Fix validate combined sequence
	mlx5: fix skb leak while fifo resync and push
	mlx5: fix possible ptp queue fifo use-after-free
	net/mlx5: ECPF, wait for VF pages only after disabling host PFs
	net/mlx5e: Verify flow_source cap before using it
	net/mlx5: Geneve, Fix handling of Geneve object id as error code
	ext4: fix incorrect options show of original mount_opt and extend mount_opt2
	nfc: fix memory leak of se_io context in nfc_genl_se_io
	net/sched: transition act_pedit to rcu and percpu stats
	net/sched: act_pedit: fix action bind logic
	net/sched: act_mpls: fix action bind logic
	net/sched: act_sample: fix action bind logic
	net: dsa: seville: ignore mscc-miim read errors from Lynx PCS
	net: dsa: felix: fix internal MDIO controller resource length
	ARM: dts: spear320-hmi: correct STMPE GPIO compatible
	tcp: tcp_check_req() can be called from process context
	vc_screen: modify vcs_size() handling in vcs_read()
	spi: tegra210-quad: Fix iterator outside loop
	rtc: sun6i: Always export the internal oscillator
	genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask()
	scsi: ipr: Work around fortify-string warning
	scsi: mpi3mr: Fix an issue found by KASAN
	scsi: mpi3mr: Use number of bits to manage bitmap sizes
	rtc: allow rtc_read_alarm without read_alarm callback
	io_uring: fix size calculation when registering buf ring
	loop: loop_set_status_from_info() check before assignment
	ASoC: adau7118: don't disable regulators on device unbind
	ASoC: apple: mca: Fix final status read on SERDES reset
	ASoC: apple: mca: Fix SERDES reset sequence
	ASoC: apple: mca: Improve handling of unavailable DMA channels
	nvme: bring back auto-removal of deleted namespaces during sequential scan
	nvme-tcp: don't access released socket during error recovery
	nvme-fabrics: show well known discovery name
	ASoC: zl38060 add gpiolib dependency
	ASoC: mediatek: mt8195: add missing initialization
	thermal: intel: quark_dts: fix error pointer dereference
	thermal: intel: BXT_PMIC: select REGMAP instead of depending on it
	tracing: Add NULL checks for buffer in ring_buffer_free_read_page()
	kernel/printk/index.c: fix memory leak with using debugfs_lookup()
	firmware/efi sysfb_efi: Add quirk for Lenovo IdeaPad Duet 3
	bootconfig: Increase max nodes of bootconfig from 1024 to 8192 for DCC support
	mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
	IB/hfi1: Update RMT size calculation
	iommu/amd: Fix error handling for pdev_pri_ats_enable()
	PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3()
	media: uvcvideo: Remove format descriptions
	media: uvcvideo: Handle cameras with invalid descriptors
	media: uvcvideo: Handle errors from calls to usb_string
	media: uvcvideo: Quirk for autosuspend in Logitech B910 and C910
	media: uvcvideo: Silence memcpy() run-time false positive warnings
	USB: fix memory leak with using debugfs_lookup()
	cacheinfo: Fix shared_cpu_map to handle shared caches at different levels
	staging: emxx_udc: Add checks for dma_alloc_coherent()
	tty: fix out-of-bounds access in tty_driver_lookup_tty()
	tty: serial: fsl_lpuart: disable the CTS when send break signal
	serial: sc16is7xx: setup GPIO controller later in probe
	mei: bus-fixup:upon error print return values of send and receive
	tools/iio/iio_utils:fix memory leak
	bus: mhi: ep: Fix the debug message for MHI_PKT_TYPE_RESET_CHAN_CMD cmd
	iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_status_word()
	iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_config_word()
	media: uvcvideo: Add GUID for BGRA/X 8:8:8:8
	soundwire: bus_type: Avoid lockdep assert in sdw_drv_probe()
	PCI: loongson: Prevent LS7A MRRS increases
	staging: pi433: fix memory leak with using debugfs_lookup()
	USB: dwc3: fix memory leak with using debugfs_lookup()
	USB: chipidea: fix memory leak with using debugfs_lookup()
	USB: ULPI: fix memory leak with using debugfs_lookup()
	USB: uhci: fix memory leak with using debugfs_lookup()
	USB: sl811: fix memory leak with using debugfs_lookup()
	USB: fotg210: fix memory leak with using debugfs_lookup()
	USB: isp116x: fix memory leak with using debugfs_lookup()
	USB: isp1362: fix memory leak with using debugfs_lookup()
	USB: gadget: gr_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: bcm63xx_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: lpc32xx_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: pxa25x_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: pxa27x_udc: fix memory leak with using debugfs_lookup()
	usb: host: xhci: mvebu: Iterate over array indexes instead of using pointer math
	USB: ene_usb6250: Allocate enough memory for full object
	usb: uvc: Enumerate valid values for color matching
	usb: gadget: uvc: Make bSourceID read/write
	PCI: Align extra resources for hotplug bridges properly
	PCI: Take other bus devices into account when distributing resources
	PCI: Distribute available resources for root buses, too
	tty: pcn_uart: fix memory leak with using debugfs_lookup()
	misc: vmw_balloon: fix memory leak with using debugfs_lookup()
	drivers: base: component: fix memory leak with using debugfs_lookup()
	drivers: base: dd: fix memory leak with using debugfs_lookup()
	kernel/fail_function: fix memory leak with using debugfs_lookup()
	PCI: loongson: Add more devices that need MRRS quirk
	PCI: Add ACS quirk for Wangxun NICs
	PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
	phy: rockchip-typec: Fix unsigned comparison with less than zero
	RDMA/cma: Distinguish between sockaddr_in and sockaddr_in6 by size
	iommu: Attach device group to old domain in error path
	soundwire: cadence: Remove wasted space in response_buf
	soundwire: cadence: Drain the RX FIFO after an IO timeout
	net: tls: avoid hanging tasks on the tx_lock
	x86/resctl: fix scheduler confusion with 'current'
	vDPA/ifcvf: decouple hw features manipulators from the adapter
	vDPA/ifcvf: decouple config space ops from the adapter
	vDPA/ifcvf: alloc the mgmt_dev before the adapter
	vDPA/ifcvf: decouple vq IRQ releasers from the adapter
	vDPA/ifcvf: decouple config IRQ releaser from the adapter
	vDPA/ifcvf: decouple vq irq requester from the adapter
	vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator from the adapter
	vDPA/ifcvf: ifcvf_request_irq works on ifcvf_hw
	vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev
	vDPA/ifcvf: allocate the adapter in dev_add()
	drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state()
	drm/display/dp_mst: Fix down/up message handling after sink disconnect
	drm/display/dp_mst: Fix down message handling after a packet reception error
	drm/display/dp_mst: Fix payload addition on a disconnected sink
	drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs
	drm/i915: Fix system suspend without fbdev being initialized
	media: uvcvideo: Fix race condition with usb_kill_urb
	io_uring: fix two assignments in if conditions
	io_uring/poll: allow some retries for poll triggering spuriously
	arm64: efi: Make efi_rt_lock a raw_spinlock
	arm64: mte: Fix/clarify the PG_mte_tagged semantics
	arm64: Reset KASAN tag in copy_highpage with HW tags only
	usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails
	Linux 6.1.18

Change-Id: Icb8e56528d481a17780bdd517c69efa9e76b94c0
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-21 08:22:15 +00:00
Suren Baghdasaryan
ac86382170 ANDROID: Revert "psi: allow unprivileged users with CAP_SYS_RESOURCE to write psi files"
This reverts commit 6db12ee045.

In Android, system_server registers psi trigger to detect memory
pressure. This commit requires processes registering new triggers to
have CAP_SYS_RESOURCE capability, which system_server does not have.
Reverting this change until a solution can be found to fix the breakage
of functionality in Android T using 5.15 kernels.

Bug: 243781242
Bug: 244148051
Reported-by: liuhailong <liuhailong@oppo.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: If6c8580af8734f3b765d48c782a536aad357e6f0
2023-03-20 20:20:07 +00:00
Elliot Berman
e0923fa7d5 ANDROID: gic: Add vendor hook for gic-v3 resume
Add vendor hook for gic-v3 resume to allow vendor to know
debug information about interrupts that are pending when
device wakes up.

Bug: 273930524
Change-Id: Id3298715355c8f592f58393db6aa903b18dd812c
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Signed-off-by: Vamsi Krishna Lanka <quic_vamslank@quicinc.com>
2023-03-20 10:53:38 -07:00
Satya Durga Srinivasu Prabhala
d34682ae48 ANDROID: abi_gki_aarch64_qcom: add system_freezable_power_efficient_wq
One of the vendor module needs system_freezable_power_efficient_wq
symbol, so, adding it to the list.

Bug: 273518985
Change-Id: I39d39ab166a2eadc3e4e602107bc63b2d4dec943
Signed-off-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
2023-03-17 23:34:09 +00:00
Ramji Jiyani
cc85c8ade8 ANDROID: GKI: arm64: Enable KMI strict mode
Enables the KMI strict mode for the aarch64;
also remove the TODO comment for aarch64-debug
as KMI strict mode shouldn't be enabled for
that target.

Bug: 269346251
Test: bazel build //common:kernel_aarch64
Test: TH
Change-Id: If8cb717d2e3dfef29004fafe1315a69caa940716
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
2023-03-17 17:21:52 +00:00
Ramji Jiyani
c2afaf7149 ANDROID: GKI: QCOM: Remove stale symbols
Enabling the KMI strict mode gave these errors:

Symbols missing from the ksymtab:
  __traceiter_android_rvh_update_cpus_allowed
  __traceiter_android_rvh_update_readahead_gfp_mask
  __tracepoint_android_rvh_update_cpus_allowed
  __tracepoint_android_rvh_update_readahead_gfp_mask
  devm_pm_opp_attach_genpd
  drm_dp_mst_dump_topology

Remove these symbols from android/abi_gki_aarch64_qcom as
they are stale and not being exported by the kernel.

Bug: 269346251
Test: bazel build //common:kernel_aarch64 (kmi_stricte_mode=True)
Test: TH
Change-Id: I3d11fd9c4b8b817415c95c0461e7ef0350338f08
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
2023-03-17 17:21:52 +00:00
Wesley Cheng
35a0e36ee8 FROMGIT: usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC
Previously, there was a 100uS delay inserted after issuing an end transfer
command for specific controller revisions.  This was due to the fact that
there was a GUCTL2 bit field which enabled synchronous completion of the
end transfer command once the CMDACT bit was cleared in the DEPCMD
register.  Since this bit does not exist for all controller revisions and
the current implementation heavily relies on utizling the EndTransfer
command completion interrupt, add the delay back in for uses where the
interrupt on completion bit is not set, and increase the duration to 1ms
for the controller to complete the command.

An issue was seen where the USB request buffer was unmapped while the DWC3
controller was still accessing the TRB.  However, it was confirmed that the
end transfer command was successfully submitted. (no end transfer timeout)
In situations, such as dwc3_gadget_soft_disconnect() and
__dwc3_gadget_ep_disable(), the dwc3_remove_request() is utilized, which
will issue the end transfer command, and follow up with
dwc3_gadget_giveback().  At least for the USB ep disable path, it is
required for any pending and started requests to be completed and returned
to the function driver in the same context of the disable call.  Without
the GUCTL2 bit, it is not ensured that the end transfer is completed before
the buffers are unmapped.

Fixes: cf2f8b63f7 ("usb: dwc3: gadget: Remove END_TRANSFER delay")
Cc: stable <stable@kernel.org>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20230306200557.29387-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 271815733
Change-Id: I9e06d4810e7052717c7b8e16facd7b765b1ce414
(cherry picked from commit d8a2bb4eb7 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2023-03-17 12:05:33 +00:00
Greg Kroah-Hartman
8da193b65d Merge 6.1.19 into android14-6.1
Changes in 6.1.19
	tpm: disable hwrng for fTPM on some AMD designs
	wifi: cfg80211: Partial revert "wifi: cfg80211: Fix use after free for wext"
	staging: rtl8192e: Remove function ..dm_check_ac_dc_power calling a script
	staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh
	Linux 6.1.19

Change-Id: I835d06275cdec67843041c30200ede87c7be5d92
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-16 17:42:23 +00:00
Greg Kroah-Hartman
ced061f88a ANDROID: remove CONFIG_NET_CLS_TCINDEX from gki_defconfig
The tcindex code was removed from the tree, so remove the config option
from the gki_defconfig files to fix up the build.

Fixes: 3abebc503a ("net/sched: Retire tcindex classifier")
Change-Id: Id4927815ec2fd0ebc8065d891dfb721551f3dbc6
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-16 17:39:12 +00:00
Greg Kroah-Hartman
a502d63667 Merge 6.1.18 into android14-6.1
Changes in 6.1.18
	net/sched: Retire tcindex classifier
	auxdisplay: hd44780: Fix potential memory leak in hd44780_remove()
	fs/jfs: fix shift exponent db_agl2size negative
	driver: soc: xilinx: fix memory leak in xlnx_add_cb_for_notify_event()
	f2fs: don't rely on F2FS_MAP_* in f2fs_iomap_begin
	f2fs: fix to avoid potential deadlock
	objtool: Fix memory leak in create_static_call_sections()
	soc: mediatek: mtk-pm-domains: Allow mt8186 ADSP default power on
	memory: renesas-rpc-if: Split-off private data from struct rpcif
	memory: renesas-rpc-if: Move resource acquisition to .probe()
	soc: mediatek: mtk-svs: Enable the IRQ later
	pwm: sifive: Always let the first pwm_apply_state succeed
	pwm: stm32-lp: fix the check on arr and cmp registers update
	f2fs: introduce trace_f2fs_replace_atomic_write_block
	f2fs: correct i_size change for atomic writes
	f2fs: clear atomic_write_task in f2fs_abort_atomic_write()
	soc: mediatek: mtk-svs: restore default voltages when svs_init02() fail
	soc: mediatek: mtk-svs: reset svs when svs_resume() fail
	soc: mediatek: mtk-svs: Use pm_runtime_resume_and_get() in svs_init01()
	fs: f2fs: initialize fsdata in pagecache_write()
	f2fs: allow set compression option of files without blocks
	f2fs: fix to abort atomic write only during do_exist()
	um: vector: Fix memory leak in vector_config
	ubi: ensure that VID header offset + VID header size <= alloc, size
	ubifs: Fix build errors as symbol undefined
	ubifs: Fix memory leak in ubifs_sysfs_init()
	ubifs: Rectify space budget for ubifs_symlink() if symlink is encrypted
	ubifs: Rectify space budget for ubifs_xrename()
	ubifs: Fix wrong dirty space budget for dirty inode
	ubifs: do_rename: Fix wrong space budget when target inode's nlink > 1
	ubifs: Reserve one leb for each journal head while doing budget
	ubi: Fix use-after-free when volume resizing failed
	ubi: Fix unreferenced object reported by kmemleak in ubi_resize_volume()
	ubifs: Fix memory leak in alloc_wbufs()
	ubi: Fix possible null-ptr-deref in ubi_free_volume()
	ubifs: Re-statistic cleaned znode count if commit failed
	ubifs: dirty_cow_znode: Fix memleak in error handling path
	ubifs: ubifs_writepage: Mark page dirty after writing inode failed
	ubifs: ubifs_releasepage: Remove ubifs_assert(0) to valid this process
	ubi: fastmap: Fix missed fm_anchor PEB in wear-leveling after disabling fastmap
	ubi: Fix UAF wear-leveling entry in eraseblk_count_seq_show()
	ubi: ubi_wl_put_peb: Fix infinite loop when wear-leveling work failed
	f2fs: fix to avoid potential memory corruption in __update_iostat_latency()
	soc: qcom: stats: Populate all subsystem debugfs files
	ext4: use ext4_fc_tl_mem in fast-commit replay path
	ext4: don't show commit interval if it is zero
	netfilter: nf_tables: allow to fetch set elements when table has an owner
	x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list
	um: virtio_uml: free command if adding to virtqueue failed
	um: virtio_uml: mark device as unregistered when breaking it
	um: virtio_uml: move device breaking into workqueue
	um: virt-pci: properly remove PCI device from bus
	f2fs: synchronize atomic write aborts
	watchdog: rzg2l_wdt: Issue a reset before we put the PM clocks
	watchdog: rzg2l_wdt: Handle TYPE-B reset for RZ/V2M
	watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path
	watchdog: Fix kmemleak in watchdog_cdev_register
	watchdog: pcwd_usb: Fix attempting to access uninitialized memory
	watchdog: sbsa_wdog: Make sure the timeout programming is within the limits
	netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()
	netfilter: conntrack: fix rmmod double-free race
	netfilter: ip6t_rpfilter: Fix regression with VRF interfaces
	netfilter: ebtables: fix table blob use-after-free
	netfilter: xt_length: use skb len to match in length_mt6
	netfilter: ctnetlink: make event listener tracking global
	netfilter: x_tables: fix percpu counter block leak on error path when creating new netns
	ptp: vclock: use mutex to fix "sleep on atomic" bug
	drm/i915: move a Kconfig symbol to unbreak the menu presentation
	ipv6: Add lwtunnel encap size of all siblings in nexthop calculation
	octeontx2-pf: Recalculate UDP checksum for ptp 1-step sync packet
	net: sunhme: Fix region request
	sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop
	octeontx2-pf: Use correct struct reference in test condition
	net: fix __dev_kfree_skb_any() vs drop monitor
	9p/xen: fix version parsing
	9p/xen: fix connection sequence
	9p/rdma: unmap receive dma buffer in rdma_request()/post_recv()
	spi: tegra210-quad: Fix validate combined sequence
	mlx5: fix skb leak while fifo resync and push
	mlx5: fix possible ptp queue fifo use-after-free
	net/mlx5: ECPF, wait for VF pages only after disabling host PFs
	net/mlx5e: Verify flow_source cap before using it
	net/mlx5: Geneve, Fix handling of Geneve object id as error code
	ext4: fix incorrect options show of original mount_opt and extend mount_opt2
	nfc: fix memory leak of se_io context in nfc_genl_se_io
	net/sched: transition act_pedit to rcu and percpu stats
	net/sched: act_pedit: fix action bind logic
	net/sched: act_mpls: fix action bind logic
	net/sched: act_sample: fix action bind logic
	net: dsa: seville: ignore mscc-miim read errors from Lynx PCS
	net: dsa: felix: fix internal MDIO controller resource length
	ARM: dts: spear320-hmi: correct STMPE GPIO compatible
	tcp: tcp_check_req() can be called from process context
	vc_screen: modify vcs_size() handling in vcs_read()
	spi: tegra210-quad: Fix iterator outside loop
	rtc: sun6i: Always export the internal oscillator
	genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask()
	scsi: ipr: Work around fortify-string warning
	scsi: mpi3mr: Fix an issue found by KASAN
	scsi: mpi3mr: Use number of bits to manage bitmap sizes
	rtc: allow rtc_read_alarm without read_alarm callback
	io_uring: fix size calculation when registering buf ring
	loop: loop_set_status_from_info() check before assignment
	ASoC: adau7118: don't disable regulators on device unbind
	ASoC: apple: mca: Fix final status read on SERDES reset
	ASoC: apple: mca: Fix SERDES reset sequence
	ASoC: apple: mca: Improve handling of unavailable DMA channels
	nvme: bring back auto-removal of deleted namespaces during sequential scan
	nvme-tcp: don't access released socket during error recovery
	nvme-fabrics: show well known discovery name
	ASoC: zl38060 add gpiolib dependency
	ASoC: mediatek: mt8195: add missing initialization
	thermal: intel: quark_dts: fix error pointer dereference
	thermal: intel: BXT_PMIC: select REGMAP instead of depending on it
	tracing: Add NULL checks for buffer in ring_buffer_free_read_page()
	kernel/printk/index.c: fix memory leak with using debugfs_lookup()
	firmware/efi sysfb_efi: Add quirk for Lenovo IdeaPad Duet 3
	bootconfig: Increase max nodes of bootconfig from 1024 to 8192 for DCC support
	mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
	IB/hfi1: Update RMT size calculation
	iommu/amd: Fix error handling for pdev_pri_ats_enable()
	PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3()
	media: uvcvideo: Remove format descriptions
	media: uvcvideo: Handle cameras with invalid descriptors
	media: uvcvideo: Handle errors from calls to usb_string
	media: uvcvideo: Quirk for autosuspend in Logitech B910 and C910
	media: uvcvideo: Silence memcpy() run-time false positive warnings
	USB: fix memory leak with using debugfs_lookup()
	cacheinfo: Fix shared_cpu_map to handle shared caches at different levels
	staging: emxx_udc: Add checks for dma_alloc_coherent()
	tty: fix out-of-bounds access in tty_driver_lookup_tty()
	tty: serial: fsl_lpuart: disable the CTS when send break signal
	serial: sc16is7xx: setup GPIO controller later in probe
	mei: bus-fixup:upon error print return values of send and receive
	tools/iio/iio_utils:fix memory leak
	bus: mhi: ep: Fix the debug message for MHI_PKT_TYPE_RESET_CHAN_CMD cmd
	iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_status_word()
	iio: accel: mma9551_core: Prevent uninitialized variable in mma9551_read_config_word()
	media: uvcvideo: Add GUID for BGRA/X 8:8:8:8
	soundwire: bus_type: Avoid lockdep assert in sdw_drv_probe()
	PCI: loongson: Prevent LS7A MRRS increases
	staging: pi433: fix memory leak with using debugfs_lookup()
	USB: dwc3: fix memory leak with using debugfs_lookup()
	USB: chipidea: fix memory leak with using debugfs_lookup()
	USB: ULPI: fix memory leak with using debugfs_lookup()
	USB: uhci: fix memory leak with using debugfs_lookup()
	USB: sl811: fix memory leak with using debugfs_lookup()
	USB: fotg210: fix memory leak with using debugfs_lookup()
	USB: isp116x: fix memory leak with using debugfs_lookup()
	USB: isp1362: fix memory leak with using debugfs_lookup()
	USB: gadget: gr_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: bcm63xx_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: lpc32xx_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: pxa25x_udc: fix memory leak with using debugfs_lookup()
	USB: gadget: pxa27x_udc: fix memory leak with using debugfs_lookup()
	usb: host: xhci: mvebu: Iterate over array indexes instead of using pointer math
	USB: ene_usb6250: Allocate enough memory for full object
	usb: uvc: Enumerate valid values for color matching
	usb: gadget: uvc: Make bSourceID read/write
	PCI: Align extra resources for hotplug bridges properly
	PCI: Take other bus devices into account when distributing resources
	PCI: Distribute available resources for root buses, too
	tty: pcn_uart: fix memory leak with using debugfs_lookup()
	misc: vmw_balloon: fix memory leak with using debugfs_lookup()
	drivers: base: component: fix memory leak with using debugfs_lookup()
	drivers: base: dd: fix memory leak with using debugfs_lookup()
	kernel/fail_function: fix memory leak with using debugfs_lookup()
	PCI: loongson: Add more devices that need MRRS quirk
	PCI: Add ACS quirk for Wangxun NICs
	PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
	phy: rockchip-typec: Fix unsigned comparison with less than zero
	RDMA/cma: Distinguish between sockaddr_in and sockaddr_in6 by size
	iommu: Attach device group to old domain in error path
	soundwire: cadence: Remove wasted space in response_buf
	soundwire: cadence: Drain the RX FIFO after an IO timeout
	net: tls: avoid hanging tasks on the tx_lock
	x86/resctl: fix scheduler confusion with 'current'
	vDPA/ifcvf: decouple hw features manipulators from the adapter
	vDPA/ifcvf: decouple config space ops from the adapter
	vDPA/ifcvf: alloc the mgmt_dev before the adapter
	vDPA/ifcvf: decouple vq IRQ releasers from the adapter
	vDPA/ifcvf: decouple config IRQ releaser from the adapter
	vDPA/ifcvf: decouple vq irq requester from the adapter
	vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator from the adapter
	vDPA/ifcvf: ifcvf_request_irq works on ifcvf_hw
	vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev
	vDPA/ifcvf: allocate the adapter in dev_add()
	drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state()
	drm/display/dp_mst: Fix down/up message handling after sink disconnect
	drm/display/dp_mst: Fix down message handling after a packet reception error
	drm/display/dp_mst: Fix payload addition on a disconnected sink
	drm/i915/dp_mst: Add the MST topology state for modesetted CRTCs
	drm/i915: Fix system suspend without fbdev being initialized
	media: uvcvideo: Fix race condition with usb_kill_urb
	io_uring: fix two assignments in if conditions
	io_uring/poll: allow some retries for poll triggering spuriously
	arm64: efi: Make efi_rt_lock a raw_spinlock
	arm64: mte: Fix/clarify the PG_mte_tagged semantics
	arm64: Reset KASAN tag in copy_highpage with HW tags only
	usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails
	Linux 6.1.18

Change-Id: Icb8e56528d481a17780bdd517c69efa9e76b94c0
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-16 17:38:40 +00:00
Satya Durga Srinivasu Prabhala
14fdf61f25 ANDROID: abi_gki_aarch64_qcom: update symbol list
Vendor modules needs below symbols, so, update symbol list accordingly.

device_get_dma_attr
rproc_set_firmware
sock_edemux
tcp_hashinfo
__inet_lookup_established
__inet6_lookup_established
udp_table
__udp4_lib_lookup
__udp6_lib_lookup

ABI difference:

6 function symbol(s) added
  'struct sock* __inet6_lookup_established(struct net*, struct inet_hashinfo*, const struct in6_addr*, __be16, const struct in6_addr*, u16, int, int)'
  'struct sock* __inet_lookup_established(struct net*, struct inet_hashinfo*, __be32, __be16, __be32, u16, int, int)'
  'struct sock* __udp4_lib_lookup(struct net*, __be32, __be16, __be32, __be16, int, int, struct udp_table*, struct sk_buff*)'
  'struct sock* __udp6_lib_lookup(struct net*, const struct in6_addr*, __be16, const struct in6_addr*, __be16, int, int, struct udp_table*, struct sk_buff*)'
  'int rproc_set_firmware(struct rproc*, const char*)'
  'void sock_edemux(struct sk_buff*)'

2 variable symbol(s) added
  'struct inet_hashinfo tcp_hashinfo'
  'struct udp_table udp_table'

Bug: 273518985
Change-Id: Ib84846939a2ca423ecc709b0832efc9fcff39df5
Signed-off-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
Signed-off-by: Giuliano Procida <gprocida@google.com>
2023-03-16 14:36:58 +00:00
Giuliano Procida
c392d5c554 ANDROID: further fix incorrectly submitted KMI update
The previous fix omitted a pair of vendor hook symbols.

Fixes: 77ba93e199 ("ANDROID: fix incorrectly submitted KMI update")
Change-Id: If5352d50edd706148dc0d2c4ba468ab4735e6a26
Signed-off-by: Giuliano Procida <gprocida@google.com>
2023-03-16 14:28:51 +00:00
Giuliano Procida
77ba93e199 ANDROID: fix incorrectly submitted KMI update
Fixes: 5a54ac0ca5 ("ANDROID: ABI: Update QCOM symbol list")
Change-Id: Iad9267962349d99d125ec71cc093987ef740a434
Signed-off-by: Giuliano Procida <gprocida@google.com>
2023-03-16 12:37:45 +00:00
Rashid Zafar
5a54ac0ca5 ANDROID: ABI: Update QCOM symbol list
Add the following symbol to allow vendor module to disable thermal
cooling device stats.

1 function symbol(s) added
  'int __traceiter_android_vh_disable_thermal_cooling_stats(void*,
struct thermal_cooling_device*, bool*)'

Bug: 218825214
Signed-off-by: Rashid Zafar <quic_rzafar@quicinc.com>
Change-Id: I38e56b2cf9b5bc78ac7ebefe2861d7a8932c09b2
2023-03-15 22:26:06 +00:00
Manaf Meethalavalappu Pallikunhi
a56bbec0f4 ANDROID: thermal: vendor hook to disable thermal cooling stats
Add vendor hook to thermal to allow vendor to selectively disable
thermal cooling device stats feature based on requirement. It helps
vendor to optimize memory footprint due to this feature especially
for low memory devices.

Bug: 218825214
Change-Id: I2ec72505f03575e09229c54765584614b16a3904
Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
(cherry picked from commit f6e47fd00f24d5e814d316b03974e970dd87879e)
Signed-off-by: Rashid Zafar <quic_rzafar@quicinc.com>
2023-03-15 20:51:32 +00:00
Todd Kjos
e3f059ee54 ANDROID: GKI: 3/15/2023 KMI update
Set KMI_GENERATION=2 for 3/15 KMI update

function symbol 'struct block_device* I_BDEV(struct inode*)' changed
  CRC changed from 0x56b2634e to 0x66b14c8d

function symbol 'void __ClearPageMovable(struct page*)' changed
  CRC changed from 0x6f60ec1b to 0xbf6e946f

function symbol 'void __SetPageMovable(struct page*, const struct movable_operations*)' changed
  CRC changed from 0xd0d79e98 to 0x8c770d3

... 3520 omitted; 3523 symbols have only CRC changes

type 'struct task_struct' changed
  member 'unsigned int in_lru_fault : 1' was added
  6 members ('unsigned int no_cgroup_migration : 1' .. 'unsigned int in_eventfd : 1') changed
    offset changed by 1

type 'struct mm_struct' changed
  byte size changed from 880 to 912
  member changed from 'struct { struct maple_tree mm_mt; unsigned long(* get_unmapped_area)(struct file*, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long task_size; pgd_t* pgd; atomic_t membarrier_state; atomic_t mm_users; atomic_t mm_count; atomic_long_t pgtables_bytes; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_lock; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; atomic64_t pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; seqcount_t write_protect_seq; spinlock_t arg_lock; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46]; struct mm_rss_stat rss_stat; struct linux_binfmt* binfmt; mm_context_t context; unsigned long flags; spinlock_t ioctx_lock; struct kioctx_table* ioctx_table; struct task_struct* owner; struct user_namespace* user_ns; struct file* exe_file; struct mmu_notifier_subscriptions* notifier_subscriptions; atomic_t tlb_flush_pending; struct uprobes_state uprobes_state; struct work_struct async_put_work; }' to 'struct { struct maple_tree mm_mt; unsigned long(* get_unmapped_area)(struct file*, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long task_size; pgd_t* pgd; atomic_t membarrier_state; atomic_t mm_users; atomic_t mm_count; atomic_long_t pgtables_bytes; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_lock; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; atomic64_t pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; seqcount_t write_protect_seq; spinlock_t arg_lock; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46]; struct mm_rss_stat rss_stat; struct linux_binfmt* binfmt; mm_context_t context; unsigned long flags; spinlock_t ioctx_lock; struct kioctx_table* ioctx_table; struct task_struct* owner; struct user_namespace* user_ns; struct file* exe_file; struct mmu_notifier_subscriptions* notifier_subscriptions; atomic_t tlb_flush_pending; struct uprobes_state uprobes_state; struct work_struct async_put_work; struct { struct list_head list; unsigned long bitmap; struct mem_cgroup* memcg; } lru_gen; }'
    type changed from 'struct { struct maple_tree mm_mt; unsigned long(* get_unmapped_area)(struct file*, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long task_size; pgd_t* pgd; atomic_t membarrier_state; atomic_t mm_users; atomic_t mm_count; atomic_long_t pgtables_bytes; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_lock; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; atomic64_t pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; seqcount_t write_protect_seq; spinlock_t arg_lock; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46]; struct mm_rss_stat rss_stat; struct linux_binfmt* binfmt; mm_context_t context; unsigned long flags; spinlock_t ioctx_lock; struct kioctx_table* ioctx_table; struct task_struct* owner; struct user_namespace* user_ns; struct file* exe_file; struct mmu_notifier_subscriptions* notifier_subscriptions; atomic_t tlb_flush_pending; struct uprobes_state uprobes_state; struct work_struct async_put_work; }' to 'struct { struct maple_tree mm_mt; unsigned long(* get_unmapped_area)(struct file*, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long task_size; pgd_t* pgd; atomic_t membarrier_state; atomic_t mm_users; atomic_t mm_count; atomic_long_t pgtables_bytes; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_lock; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; atomic64_t pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; seqcount_t write_protect_seq; spinlock_t arg_lock; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46]; struct mm_rss_stat rss_stat; struct linux_binfmt* binfmt; mm_context_t context; unsigned long flags; spinlock_t ioctx_lock; struct kioctx_table* ioctx_table; struct task_struct* owner; struct user_namespace* user_ns; struct file* exe_file; struct mmu_notifier_subscriptions* notifier_subscriptions; atomic_t tlb_flush_pending; struct uprobes_state uprobes_state; struct work_struct async_put_work; struct { struct list_head list; unsigned long bitmap; struct mem_cgroup* memcg; } lru_gen; }'
      byte size changed from 880 to 912
      member 'struct { struct list_head list; unsigned long bitmap; struct mem_cgroup* memcg; } lru_gen' was added
  member 'unsigned long cpu_bitmap[0]' changed
    offset changed by 256

type 'struct pglist_data' changed
  byte size changed from 5760 to 6976
  member 'unsigned long flags' changed
    offset changed by 8512
  member 'struct lru_gen_mm_walk mm_walk' was added
  3 members ('struct cacheline_padding _pad2_' .. 'atomic_long_t vm_stat[42]') changed
    offset changed by 9728

type 'struct fsverity_info' changed
  byte size changed from 256 to 272
  member 'unsigned long* hash_block_verified' was added
  member 'spinlock_t hash_page_init_lock' was added

type 'struct reclaim_state' changed
  byte size changed from 8 to 16
  member 'struct lru_gen_mm_walk* mm_walk' was added

type 'struct mem_cgroup' changed
  byte size changed from 2112 to 2176
  member 'struct lru_gen_mm_list mm_list' was added
  member 'struct mem_cgroup_per_node* nodeinfo[0]' changed
    offset changed by 192

type 'struct fsverity_operations' changed
  member changed from 'int(* write_merkle_tree_block)(struct inode*, const void*, u64, int)' to 'int(* write_merkle_tree_block)(struct inode*, const void*, u64, unsigned int)'
    type changed from 'int(*)(struct inode*, const void*, u64, int)' to 'int(*)(struct inode*, const void*, u64, unsigned int)'
      pointed-to type changed from 'int(struct inode*, const void*, u64, int)' to 'int(struct inode*, const void*, u64, unsigned int)'
        parameter 4 type changed from 'int' to 'unsigned int'

type 'struct psi_group' changed
  member 'atomic_t poll_scheduled' was added

type 'struct lruvec' changed
  byte size changed from 144 to 1208
  member 'struct lru_gen_struct lrugen' was added
  member 'struct lru_gen_mm_state mm_state' was added
  member 'struct pglist_data* pgdat' changed
    offset changed by 8512

type 'struct merkle_tree_params' changed
  member 'unsigned int blocks_per_page' was added
  member 'u8 log_digestsize' was added
  member changed from 'unsigned int log_blocksize' to 'u8 log_blocksize'
    offset changed from 224 to 264
    type changed from 'unsigned int' to 'u8' = '__u8' = 'unsigned char'
      resolved type changed from 'unsigned int' to 'unsigned char'
  member changed from 'unsigned int log_arity' to 'u8 log_arity'
    offset changed from 256 to 272
    type changed from 'unsigned int' to 'u8' = '__u8' = 'unsigned char'
      resolved type changed from 'unsigned int' to 'unsigned char'
  member 'u8 log_blocks_per_page' was added
  member 'unsigned long tree_pages' was added
  member 'unsigned long level0_blocks' was removed
  member changed from 'u64 level_start[8]' to 'unsigned long level_start[8]'
    type changed from 'u64[8]' to 'unsigned long[8]'
      element type changed from 'u64' = '__u64' = 'unsigned long long' to 'unsigned long'
        resolved type changed from 'unsigned long long' to 'unsigned long'

type 'struct mem_cgroup_per_node' changed
  byte size changed from 1016 to 2080
  9 members ('struct lruvec_stats_percpu* lruvec_stats_percpu' .. 'struct mem_cgroup* memcg') changed
    offset changed by 8512

Bug: 273322767
Change-Id: Ie07b906b23433e2f7690885bf588b1d27a0848f8
Signed-off-by: Todd Kjos <tkjos@google.com>
2023-03-15 18:37:24 +00:00
Kalesh Singh
d64f37b5f5 ANDROID: GKI: Enable MGLRU by default
MGLRU has been tested and edge cases addressed on Android workloads;
after which the MGLRU showed good results across various performance
metrics. Enable the MGLRU as default memory reclaim in algorithm.

Bug: 261619133
Change-Id: I7ed7fbfd6ef9ce10053347528125dd98c39e50bf
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-03-15 16:41:52 +00:00
Greg Kroah-Hartman
9154eb052f Revert "Revert "sched/psi: Stop relying on timer_pending() for poll_work rescheduling""
This reverts commit 02bdd918e6.  It was
perserving the ABI, but that is not needed anymore at this point in
time.

Change-Id: I486cebed8ec0f91985d117eed3e1069d6160e267
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-15 16:41:08 +00:00
Jaegeuk Kim
a0bdc392de Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-6.1.y' into android14-6.1
* aosp/upstream-f2fs-stable-linux-6.1.y:
  fscrypt: support decrypting data from large folios
  fsverity: support verifying data from large folios
  fsverity.rst: update git repo URL for fsverity-utils
  ext4: allow verity with fs block size < PAGE_SIZE
  fs/buffer.c: support fsverity in block_read_full_folio()
  f2fs: simplify f2fs_readpage_limit()
  ext4: simplify ext4_readpage_limit()
  fsverity: support enabling with tree block size < PAGE_SIZE
  fsverity: support verification with tree block size < PAGE_SIZE
  fsverity: replace fsverity_hash_page() with fsverity_hash_block()
  fsverity: use EFBIG for file too large to enable verity
  fsverity: store log2(digest_size) precomputed
  fsverity: simplify Merkle tree readahead size calculation
  fsverity: use unsigned long for level_start
  fsverity: remove debug messages and CONFIG_FS_VERITY_DEBUG
  fsverity: pass pos and size to ->write_merkle_tree_block
  fsverity: optimize fsverity_cleanup_inode() on non-verity files
  fsverity: optimize fsverity_prepare_setattr() on non-verity files
  fsverity: optimize fsverity_file_open() on non-verity files
  fscrypt: clean up fscrypt_add_test_dummy_key()
  fs/super.c: stop calling fscrypt_destroy_keyring() from __put_super()
  f2fs: stop calling fscrypt_add_test_dummy_key()
  ext4: stop calling fscrypt_add_test_dummy_key()
  fscrypt: add the test dummy encryption key on-demand
  f2fs: drop unnecessary arg for f2fs_ioc_*()
  f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"
  f2fs: synchronize atomic write aborts
  f2fs: fix wrong segment count
  f2fs: replace si->sbi w/ sbi in stat_show()
  f2fs: export ipu policy in debugfs
  f2fs: make kobj_type structures constant
  f2fs: fix to do sanity check on extent cache correctly
  f2fs: add missing description for ipu_policy node
  f2fs: fix to set ipu policy
  f2fs: fix typos in comments
  f2fs: fix kernel crash due to null io->bio
  f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx()
  f2fs: add sysfs nodes to set last_age_weight
  f2fs: fix f2fs_show_options to show nogc_merge mount option
  f2fs: fix cgroup writeback accounting with fs-layer encryption
  f2fs: fix wrong calculation of block age
  f2fs: fix to update age extent in f2fs_do_zero_range()
  f2fs: fix to update age extent correctly during truncation
  f2fs: fix to avoid potential memory corruption in __update_iostat_latency()
  f2fs: retry to update the inode page given data corruption
  f2fs: fix to handle F2FS_IOC_START_ATOMIC_REPLACE in f2fs_compat_ioctl()
  f2fs: clean up i_compress_flag and i_compress_level usage
  f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info
  f2fs: factor the read/write tracing logic into a helper
  f2fs: remove __has_curseg_space
  f2fs: refactor next blk selection
  f2fs: remove __allocate_new_section
  f2fs: refactor __allocate_new_segment
  f2fs: add a f2fs_curseg_valid_blocks helper
  f2fs: simplify do_checkpoint
  f2fs: remove __add_sum_entry
  f2fs: fix to abort atomic write only during do_exist()
  f2fs: allow set compression option of files without blocks
  f2fs: fix information leak in f2fs_move_inline_dirents()
  fs: f2fs: initialize fsdata in pagecache_write()
  f2fs: fix to check warm_data_age_threshold
  f2fs: return true if all cmd were issued or no cmd need to be issued for f2fs_issue_discard_timeout()
  f2fs: clarify compress level bit offset
  f2fs: fix to show discard_unit mount opt
  f2fs: fix to do sanity check on extent cache correctly
  f2fs: remove unneeded f2fs_cp_error() in f2fs_create_whiteout()
  f2fs: clear atomic_write_task in f2fs_abort_atomic_write()
  f2fs: introduce trace_f2fs_replace_atomic_write_block
  f2fs: introduce discard_io_aware_gran sysfs node
  f2fs: drop useless initializer and unneeded local variable
  f2fs: add iostat support for flush
  f2fs: support accounting iostat count and avg_bytes
  f2fs: convert discard_wake and gc_wake to bool type
  f2fs: convert to use MIN_DISCARD_GRANULARITY macro
  f2fs: merge f2fs_show_injection_info() into time_to_inject()
  f2fs: add a f2fs_ prefix to punch_hole() and expand_inode_data()
  f2fs: remove unnecessary blank lines
  f2fs: mark f2fs_init_compress_mempool w/ __init
  f2fs: judge whether discard_unit is section only when have CONFIG_BLK_DEV_ZONED
  f2fs: start freeing cluster pages from the unused number
  MAINTAINERS: Add f2fs's patchwork
  f2fs: deliver the accumulated 'issued' to __issue_discard_cmd_orderly()
  f2fs: avoid to check PG_error flag
  f2fs: add missing doc for fault injection sysfs
  f2fs: fix to avoid potential deadlock
  f2fs: introduce IS_F2FS_IPU_* macro
  f2fs: refactor the hole reporting and allocation logic in f2fs_map_blocks
  f2fs: factor out a f2fs_map_no_dnode
  f2fs: factor a f2fs_map_blocks_cached helper
  f2fs: remove the create argument to f2fs_map_blocks
  f2fs: remove f2fs_get_block
  docs: f2fs: fix html doc error
  f2fs: simplify __allocate_data_block
  f2fs: reflow prepare_write_begin
  f2fs: f2fs_do_map_lock
  f2fs: add a f2fs_get_block_locked helper
  f2fs: add a f2fs_lookup_extent_cache_block helper
  f2fs: split __submit_bio
  f2fs: rename F2FS_MAP_UNWRITTEN to F2FS_MAP_DELALLOC
  f2fs: decouple F2FS_MAP_ from buffer head flags
  f2fs: don't rely on F2FS_MAP_* in f2fs_iomap_begin
  f2fs: fix to call clear_page_private_reference in .{release,invalid}_folio
  f2fs: remove unused PAGE_PRIVATE_ATOMIC_WRITE
  f2fs: fix to support .migrate_folio for compressed inode
  f2fs: file: drop useless initializer in expand_inode_data()

Bug: 264705711
Bug: 269384820
Bug: 269593531
Change-Id: Ib84dc3389b6a06068a10d427c03f6dbc034831a6
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-03-15 09:35:23 -07:00
Todd Kjos
9733980ba7 ANDROID: update db845c symbol list
Update for recent changes to scsi/ufshcd

11 function symbol(s) added
  'int insert_resource(struct resource*, struct resource*)'
  'struct msi_desc* msi_first_desc(struct device*, enum msi_desc_filter)'
  'struct msi_desc* msi_next_desc(struct device*, enum msi_desc_filter)'
  'int remove_resource(struct resource*)'
  'void ufshcd_mcq_config_esi(struct ufs_hba*, struct msi_msg*)'
  'void ufshcd_mcq_enable_esi(struct ufs_hba*)'
  'unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba*, struct ufs_hw_queue*)'
  'void ufshcd_mcq_write_cqis(struct ufs_hba*, u32, int)'
  'int ufshcd_system_freeze(struct device*)'
  'int ufshcd_system_restore(struct device*)'
  'int ufshcd_system_thaw(struct device*)'

function symbol 'struct scsi_device* __scsi_iterate_devices(struct Scsi_Host*, struct scsi_device*)' changed
  CRC changed from 0x103ea7e3 to 0x9039be7e

function symbol 'int scsi_autopm_get_device(struct scsi_device*)' changed
  CRC changed from 0xad35aadc to 0x88e729b3

function symbol 'void scsi_autopm_put_device(struct scsi_device*)' changed
  CRC changed from 0x12c1bce to 0x54fe744f

... 36 omitted; 39 symbols have only CRC changes

type 'struct ufs_hba' changed
  byte size changed from 4488 to 4800
  member 'u32 mcq_capabilities' was added
  3 members ('int nutmrs' .. 'u32 ufs_version') changed
    offset changed by 32
  member 'bool logical_unit_scan_finished' was added
  5 members ('u32 eh_flags' .. 'u16 ee_usr_mask') changed
    offset changed by 32
  3 members ('ktime_t last_dme_cmd_tstamp' .. 'struct ufs_dev_info dev_info') changed
    offset changed by 64
  11 members ('bool auto_bkops_enabled' .. 'struct ufs_clk_scaling clk_scaling') changed
    offset changed by 128
  member 'bool system_suspending' was added
  member 'bool is_sys_suspended' changed
    offset changed by 136
  4 members ('enum bkops_status urgent_bkops_lvl' .. 'struct rw_semaphore clk_scaling_lock') changed
    offset changed by 128
  member 'unsigned char desc_size[10]' was removed
  member 'atomic_t scsi_block_reqs_cnt' changed
    offset changed by 32
  12 members ('struct device bsg_dev' .. 'u32 luns_avail') changed
    offset changed by 64
  member 'unsigned int nr_hw_queues' was added
  member 'unsigned int nr_queues[3]' was added
  member 'bool complete_put' changed
    offset changed by 192
  member 'bool ext_iid_sup' was added
  member 'bool scsi_host_added' was added
  member 'bool mcq_sup' was added
  member 'bool mcq_enabled' was added
  member 'struct ufshcd_res_info res[7]' was added
  member 'void* mcq_base' was added
  member 'struct ufs_hw_queue* uhq' was added
  member 'struct ufs_hw_queue* dev_cmd_queue' was added
  member 'struct ufshcd_mcq_opr_info_t mcq_opr[4]' was added

type 'struct ufs_hba_variant_ops' changed
  byte size changed from 176 to 224
  member 'void(* reinit_notify)(struct ufs_hba*)' was added
  member 'int(* mcq_config_resource)(struct ufs_hba*)' was added
  member 'int(* get_hba_mac)(struct ufs_hba*)' was added
  member 'int(* op_runtime_config)(struct ufs_hba*)' was added
  member 'int(* get_outstanding_cqs)(struct ufs_hba*, unsigned long*)' was added
  member 'int(* config_esi)(struct ufs_hba*)' was added

type 'enum attr_idn' changed
  enumerator 'QUERY_ATTR_IDN_EXT_IID_EN' (42) was added

type 'struct scsi_host_template' changed
  member changed from 'enum blk_eh_timer_return(* eh_timed_out)(struct scsi_cmnd*)' to 'enum scsi_timeout_action(* eh_timed_out)(struct scsi_cmnd*)'
    type changed from 'enum blk_eh_timer_return(*)(struct scsi_cmnd*)' to 'enum scsi_timeout_action(*)(struct scsi_cmnd*)'
      pointed-to type changed from 'enum blk_eh_timer_return(struct scsi_cmnd*)' to 'enum scsi_timeout_action(struct scsi_cmnd*)'
        return type changed from 'enum blk_eh_timer_return' to 'enum scsi_timeout_action'

type 'struct ufs_dev_cmd' changed
  byte size changed from 104 to 112
  member 'struct cq_entry* cqe' was added

type 'struct ufs_dev_info' changed
  byte size changed from 32 to 40
  member 'u8 bqueuedepth' was added
  7 members ('bool hpb_enabled' .. 'u8 b_presrv_uspc_en') changed
    offset changed by 8
  member 'bool b_advanced_rpmb_en' was added
  member 'bool b_ext_iid_en' was added

type 'enum dev_cmd_type' changed
  enumerator 'DEV_CMD_TYPE_RPMB' (2) was added

Bug: 273322767
Change-Id: Id42d69756c884faa120f1206f2d70a8de5db6271
Signed-off-by: Todd Kjos <tkjos@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
e6efdc8f71 UPSTREAM: scsi: ufs: core: Simplify ufshcd_execute_start_stop()
Use scsi_execute_cmd() instead of open-coding it.

Link: https://lore.kernel.org/r/20230210193258.4004923-4-bvanassche@acm.org
Cc: Mike Christie <michael.christie@oracle.com>
Cc: John Garry <john.g.garry@oracle.com>
Change-Id: Idc2ba8563c6e922eed1111e8de08b09f150809fe
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 2702812ae3)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
ac666c99ee UPSTREAM: scsi: ufs: core: Rely on the block layer for setting RQF_PM
Do not set RQF_PM explicitly since scsi_alloc_request() sets it indirectly
if BLK_MQ_REQ_PM is set. The call chain for the code that sets RQF_PM is as
follows:

    scsi_alloc_request()
      blk_mq_alloc_request()
        __blk_mq_alloc_requests()
          blk_mq_rq_ctx_init()
            if (data->flags & BLK_MQ_REQ_PM)
              data->rq_flags |= RQF_PM;

Link: https://lore.kernel.org/r/20230210193258.4004923-3-bvanassche@acm.org
Cc: Mike Christie <michael.christie@oracle.com>
Cc: John Garry <john.g.garry@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Change-Id: Ia22b419fab491b2cd328e95ff3ff89050b98d360
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 93bc4a5d00)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Asutosh Das
b7b12c4376 UPSTREAM: scsi: ufs: mcq: Fix incorrectly set queue depth
ufshcd_config_mcq() may change the can_queue value. The current code
invokes scsi_add_host() before ufshcd_config_mcq() so the tags are
limited to the original can_queue value.

Fix this by invoking scsi_add_host() after ufshcd_config_mcq().

Link: https://lore.kernel.org/r/8840cea4a57b46dabce18acc39afc50ab826330f.1676567593.git.quic_asutoshd@quicinc.com
Fixes: 2468da61ea ("scsi: ufs: core: mcq: Configure operation and runtime interface")
Change-Id: Icf2e55c32d821124a0364f8121ba481188e8fefc
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 2076f57f2c)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Yangtao Li
6b1ddf700e UPSTREAM: scsi: ufs: ufs-mediatek: Guard power management functions with CONFIG_PM
Fix the following compilation error when CONFIG_PM is set to 'n':

drivers/ufs/host/ufs-mediatek.c: In function `ufs_mtk_runtime_suspend`:
drivers/ufs/host/ufs-mediatek.c:1623:8: error: implicit declaration of
	function `ufshcd_runtime_suspend`; did you mean `ufs_mtk_runtime_suspend`?
	[-Werror=implicit-function-declaration]
 1623 |  ret = ufshcd_runtime_suspend(dev);
      |        ^~~~~~~~~~~~~~~~~~~~~~
      |        ufs_mtk_runtime_suspend
drivers/ufs/host/ufs-mediatek.c: In function `ufs_mtk_runtime_resume`:
drivers/ufs/host/ufs-mediatek.c:1638:9: error: implicit declaration of function
	`ufshcd_runtime_resume`; did you mean `ufs_mtk_runtime_resume`?
	[-Werror=implicit-function-declaration]
 1638 |  return ufshcd_runtime_resume(dev);
      |         ^~~~~~~~~~~~~~~~~~~~~
      |         ufs_mtk_runtime_resume
At top level:
drivers/ufs/host/ufs-mediatek.c:1632:12: error: `ufs_mtk_runtime_resume`
	defined but not used [-Werror=unused-function]
 1632 | static int ufs_mtk_runtime_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~
drivers/ufs/host/ufs-mediatek.c:1618:12: error: `ufs_mtk_runtime_suspend`
	defined but not used [-Werror=unused-function]
 1618 | static int ufs_mtk_runtime_suspend(struct device *dev)

Link: https://lore.kernel.org/r/20230220142431.54589-1-frank.li@vivo.com
Reported-by: k2ci <kernel-bot@kylinos.cn>
Reported-by: Shida Zhang <zhangshida@kylinos.cn>
Change-Id: I422a92737f5dd14e07c018375afb66438385a0b1
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 19873b03f1)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Adrien Thierry
cb42f459a6 UPSTREAM: scsi: ufs: core: Initialize devfreq synchronously
During UFS initialization, devfreq initialization is asynchronous:
ufshcd_async_scan() calls ufshcd_add_lus(), which in turn initializes
devfreq for UFS. The simple ondemand governor is then loaded. If it is
built as a module, request_module() is called and throws a warning:

  WARNING: CPU: 7 PID: 167 at kernel/kmod.c:136 __request_module+0x1e0/0x460
  Modules linked in: crct10dif_ce llcc_qcom phy_qcom_qmp_usb ufs_qcom phy_qcom_snps_femto_v2 ufshcd_pltfrm phy_qcom_qmp_combo ufshcd_core phy_qcom_qmp_ufs qcom_wdt socinfo fuse ipv6
  CPU: 7 PID: 167 Comm: kworker/u16:3 Not tainted 6.2.0-rc6-00009-g58706f7fb045 #1
  Hardware name: Qualcomm SA8540P Ride (DT)
  Workqueue: events_unbound async_run_entry_fn
  pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : __request_module+0x1e0/0x460
  lr : __request_module+0x1d8/0x460
  sp : ffff800009323b90
  x29: ffff800009323b90 x28: 0000000000000000 x27: 0000000000000000
  x26: ffff800009323d50 x25: ffff7b9045f57810 x24: ffff7b9045f57830
  x23: ffffdc5a83e426e8 x22: ffffdc5ae80a9818 x21: 0000000000000001
  x20: ffffdc5ae7502f98 x19: ffff7b9045f57800 x18: ffffffffffffffff
  x17: 312f716572667665 x16: 642f7366752e3030 x15: 0000000000000000
  x14: 000000000000021c x13: 0000000000005400 x12: ffff7b9042ed7614
  x11: ffff7b9042ed7600 x10: 00000000636c0890 x9 : 0000000000000038
  x8 : ffff7b9045f2c880 x7 : ffff7b9045f57c68 x6 : 0000000000000080
  x5 : 0000000000000000 x4 : 8000000000000000 x3 : 0000000000000000
  x2 : 0000000000000000 x1 : ffffdc5ae5d382f0 x0 : 0000000000000001
  Call trace:
   __request_module+0x1e0/0x460
   try_then_request_governor+0x7c/0x100
   devfreq_add_device+0x4b0/0x5fc
   ufshcd_async_scan+0x1d4/0x310 [ufshcd_core]
   async_run_entry_fn+0x34/0xe0
   process_one_work+0x1d0/0x320
   worker_thread+0x14c/0x444
   kthread+0x10c/0x110
   ret_from_fork+0x10/0x20

This occurs because synchronous module loading from async is not
allowed. According to __request_module():

  /*
   * We don't allow synchronous module loading from async.  Module
   * init may invoke async_synchronize_full() which will end up
   * waiting for this task which already is waiting for the module
   * loading to complete, leading to a deadlock.
   */

Such a deadlock was experienced on the Qualcomm QDrive3/sa8540p-ride. With
DEVFREQ_GOV_SIMPLE_ONDEMAND=m, the boot hangs after the warning.

Fix both the warning and the deadlock by moving devfreq initialization out
of the async routine.

Tested on the sa8540p-ride by using fio to put the UFS under load, and
printing the trace generated by
/sys/kernel/tracing/events/ufs/ufshcd_clk_scaling events. The trace looks
similar with and without the change.

Link: https://lore.kernel.org/r/20230217194423.42553-1-athierry@redhat.com
Change-Id: I7fd8960cc6321c8572dba7a74d84d07f310d0573
Signed-off-by: Adrien Thierry <athierry@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 7dafc3e007)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
d33adeb677 UPSTREAM: scsi: ufs: Make the TC G210 driver dependent on CONFIG_OF
The TC G210 driver only supports devices declared in the device tree.
Hence make this driver dependent on CONFIG_OF. This patch fixes the
following compiler error:

drivers/ufs/host/tc-dwc-g210-pltfrm.c:36:34: error: ‘tc_dwc_g210_pltfm_match’ defined but not used [-Werror=unused-const-variable=]
   36 | static const struct of_device_id tc_dwc_g210_pltfm_match[] = {
      |

Link: https://lore.kernel.org/r/20230209184914.2762172-1-bvanassche@acm.org
Cc: Joao Pinto <jpinto@synopsys.com>
Change-Id: I6d353d0d32fe53f400e81422943145635f14e2cb
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 473025a6b6)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Christophe JAILLET
300409ad8d UPSTREAM: scsi: ufs: core: Fix an error handling path in ufshcd_read_desc_param()
If an error occurs, some memory may need to be freed, as in the other error
handling paths.

Before the commit in the Fixes tag, this test was done before the memory
allocation, so there was no issue.

Fixes: 16ed9d312b ("scsi: ufs: core: Remove ufshcd_map_desc_id_to_length()")
Link: https://lore.kernel.org/r/2c6e42205e5ec22e5e8c7c85c6deb8fde31c74da.1673781835.git.christophe.jaillet@wanadoo.fr
Change-Id: Ic2c3b46ffaa34c43bb0440cccb57092cf7012566
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 833f7d4819)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
f98465ca0d UPSTREAM: scsi: ufs: core: Fix kernel-doc syntax
Fix the following kernel-doc warnings:

drivers/ufs/core/ufs-mcq.c:87: warning: Function parameter or member 'hba' not described in 'ufshcd_mcq_config_mac'
drivers/ufs/core/ufs-mcq.c:87: warning: Function parameter or member 'max_active_cmds' not described in 'ufshcd_mcq_config_mac'
drivers/ufs/core/ufs-mcq.c:107: warning: Function parameter or member 'hba' not described in 'ufshcd_mcq_req_to_hwq'
drivers/ufs/core/ufs-mcq.c:107: warning: Function parameter or member 'req' not described in 'ufshcd_mcq_req_to_hwq'
drivers/ufs/core/ufs-mcq.c:128: warning: Function parameter or member 'hba' not described in 'ufshcd_mcq_decide_queue_depth'

Link: https://lore.kernel.org/r/20230202220155.561115-1-bvanassche@acm.org
Fixes: 854f84e7fe ("scsi: ufs: core: mcq: Find hardware queue to queue request")
Fixes: 2468da61ea ("scsi: ufs: core: mcq: Configure operation and runtime interface")
Fixes: 7224c80687 ("scsi: ufs: core: mcq: Calculate queue depth")
Cc: Asutosh Das <quic_asutoshd@quicinc.com>
Change-Id: I3e93fb0a240940f3e0247859fa6e0ac2f3dba3c7
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit b62c8292d2)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Anjana Hari
34c3757473 UPSTREAM: scsi: ufs: core: Add hibernation callbacks
Add freeze, thaw, and restore callbacks for hibernate and restore
functionality.

Link: https://lore.kernel.org/r/20230202161045.3956-2-quic_ahari@quicinc.com
Change-Id: I20d0733c56b1e5e4fe60e435ced2213e66ffff9c
Signed-off-by: Anjana Hari <quic_ahari@quicinc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 88441a8d35)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bjorn Andersson
c09f6d36f9 UPSTREAM: scsi: ufs: core: Limit DMA alignment check
The three DMA memory regions allocated for the host memory space are
documented to require alignment of 128, 1024, and 1024 respectively, but
the returned address is checked for PAGE_SIZE alignment.

In the case where these allocations are serviced by e.g. the Arm SMMU, the
size and alignment will be determined by its supported page sizes. In most
cases SZ_4K and a few larger sizes are available.

In the typical configuration this does not cause problems, but in the event
that the system PAGE_SIZE is increased beyond 4k, it's no longer reasonable
to expect that the allocation will be PAGE_SIZE aligned.

Limit the DMA alignment check to the actual alignment requirements written
in the comments in the code, to avoid the UFS core refusing to initialize
with such configuration.

Link: https://lore.kernel.org/r/20230201034917.1902330-1-quic_bjorande@quicinc.com
Change-Id: I680d6d993b235ea2bc772265c8849aaea648d32b
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 339aa12218)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Abel Vesa
23c802800c UPSTREAM: scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5
On SM8550, depending on the Qunipro, we can run with G5 or G4.  For now,
when the major version is 5 or above, we go with G5.  Therefore, we need to
specifically tell UFS HC that.

Change-Id: I65ef6ac8de60f5c78e097e09cc5f1e4eab72a6bd
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 9c02aa24bf)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00