Commit Graph

1157793 Commits

Author SHA1 Message Date
Peter Wang
db23405211 UPSTREAM: scsi: ufs: core: Remove dev cmd clock scaling busy
If a dev command times out, clk_scaling.active_reqs is not decreased which
causes abnormal clock scaling.

It is complicated to handle different dev command timeout cases in both
legacy mode and MCQ mode. Besides, dev cmds are rarely used and the busy
time is short.

Remove clock scaling busy window for dev cmds like we do for UIC or TM cmds
which don't update busy window either.

Change-Id: I2f25dc5032126778ac99b6a79bd78f9578dd730c
(cherry picked from commit e66413faa5b55800ad42a570aad674aed634c5e6)
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20231004062454.29165-1-peter.wang@mediatek.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-02-26 17:25:00 +00:00
Dylan Chang
c622e98ddc ANDROID: ABI: Update symbol list for Nothing
Update symbol list for Nothing

 39 function symbol(s) added
  'int __bh_read(struct buffer_head*, blk_opf_t, bool)'
  'int __fs_parse(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'ssize_t __generic_file_write_iter(struct kiocb*, struct iov_iter*)'
  'int bh_uptodate_or_lock(struct buffer_head*)'
  'int block_truncate_page(struct address_space*, loff_t, get_block_t*)'
  'int block_write_begin(struct address_space*, loff_t, unsigned int, struct page**, get_block_t*)'
  'int block_write_end(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page*, void*)'
  'int block_write_full_page(struct page*, get_block_t*, struct writeback_control*)'
  'void clear_nlink(struct inode*)'
  'struct dentry* d_find_alias(struct inode*)'
  'void discard_new_inode(struct inode*)'
  'int fs_param_is_string(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'int fs_param_is_u32(struct p_log*, const struct fs_parameter_spec*, struct fs_parameter*, struct fs_parse_result*)'
  'sector_t generic_block_bmap(struct address_space*, sector_t, get_block_t*)'
  'struct dentry* generic_fh_to_dentry(struct super_block*, struct fid*, int, int, struct inode*(*)(struct super_block*, u64, u32))'
  'struct dentry* generic_fh_to_parent(struct super_block*, struct fid*, int, int, struct inode*(*)(struct super_block*, u64, u32))'
  'int generic_file_fsync(struct file*, loff_t, loff_t, int)'
  'int generic_permission(struct user_namespace*, struct inode*, int)'
  'int generic_write_end(struct file*, struct address_space*, loff_t, unsigned int, unsigned int, struct page*, void*)'
  'int generic_writepages(struct address_space*, struct writeback_control*)'
  'int get_tree_bdev(struct fs_context*, int(*)(struct super_block*, struct fs_context*))'
  'void iget_failed(struct inode*)'
  'struct inode* ilookup(struct super_block*, unsigned long)'
  'loff_t inode_get_bytes(struct inode*)'
  'int inode_needs_sync(struct inode*)'
  'void inode_nohighmem(struct inode*)'
  'void inode_set_bytes(struct inode*, loff_t)'
  'struct backing_dev_info* inode_to_bdi(struct inode*)'
  'int insert_inode_locked(struct inode*)'
  'void invalidate_inode_buffers(struct inode*)'
  'size_t iov_iter_zero(size_t, struct iov_iter*)'
  'void kfree_link(void*)'
  'int mpage_writepages(struct address_space*, struct writeback_control*, get_block_t*)'
  'int posix_acl_chmod(struct user_namespace*, struct inode*, umode_t)'
  'void set_bh_page(struct buffer_head*, struct page*, unsigned long)'
  'void setattr_copy(struct user_namespace*, struct inode*, const struct iattr*)'
  'int sync_blockdev_nowait(struct block_device*)'
  'int sync_mapping_buffers(struct address_space*)'
  'int utf8_to_utf32(const u8*, int, unicode_t*)'

1 variable symbol(s) added
  'int overflowgid'

Bug: 326180449
Change-Id: Ibb533a3f1691080251d9fd61cf27d569b28b0e7c
Signed-off-by: Dylan Chang <dylan.chang@nothing.tech>
2024-02-26 10:13:28 +00:00
Chris Goldsworthy
8c0f917473 ANDROID: abi_gki_aarch64_qcom: Export trace_android_vh_try_fixup_sea
Add the underlying symbols for trace_android_vh_try_fixup_sea.

Bug: 320358381
Change-Id: I0fa34513d1cd503159abfef0eb6fe50284f21316
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2024-02-23 09:40:54 +00:00
Chris Goldsworthy
9be763fb64 ANDROID: arm64: Call fixup_exception() within do_sea()
path_lookupat() is capable of safely reading unampped VAs. If an
unmapped VA is read whilst the function is being called, the resulting
page fault will get re-directed to __do_page_fault(), which will call
fixup_exception() to handle the aforementioned unmapped VA read.

Now, for an OS running in a VM, let's say that memory was still mapped
at S1 but lent to another VM (i.e. unmapped at S2 for the given VM).
The reading of an unmapped VA in path_lookupat() still needs to be
handled. For hypervisors that inject an abort leading to a do_sea()
call, call fixup_exception() from do_sea() if
trace_android_vh_try_fixup_sea() indicates that we can do so.

Bug: 320358381
Change-Id: I0aedcd954f08e3011b27524f9a7b038debbb246d
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2024-02-23 09:40:54 +00:00
Sajid Dalvi
d6b58cc171 ANDROID: PCI: dwc: Wait for the link only if it has been started
In dw_pcie_host_init() regardless of whether the link has been
started or not, the code waits for the link to come up. Even in
cases where start_link() is not defined the code ends up spinning
in a loop for 1 second. Since in some systems dw_pcie_host_init()
gets called during probe, this one second loop for each pcie
interface instance ends up extending the boot time.

Wait for the link up in only if the start_link() is defined.

The patch submitted to the upstream kernel (see link below) was not
accepted due to no upstream user.

The change here is a simplified version of that patch, which will wait
for a link only if start_link ops has been defined.

Bug: 315052790
Link: https://lore.kernel.org/all/20240112093006.2832105-1-ajayagarwal@google.com/
Change-Id: I4e8d00f6195062728417e41ddd51072880676920
Signed-off-by: Sajid Dalvi <sdalvi@google.com>
2024-02-22 22:46:51 +00:00
Will McVicker
a7f647f49d ANDROID: Update the Pixel symbol list and GKI ABI
1 function symbol(s) added
  'int __traceiter_android_rvh_ufs_complete_init(void*, struct ufs_hba*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_ufs_complete_init'

Bug: 269652215
Change-Id: I2ed5dbcded52eab567e89aa4dec8750662074c76
Signed-off-by: Will McVicker <willmcvicker@google.com>
2024-02-20 16:52:15 -08:00
Konstantin Vyshetsky
eef88095dc ANDROID: scsi: ufs: add complete init vendor hook
Currently the core UFS driver does not have a vops to notify when the
device is operational. This commit introduces a hook, which serves to
notify device completing initialization and is ready to accept I/O.

This is required by the FIPS140-2 [1] self integrity test of inline
encryption engine, which must run whenever the host controller is reset.
The code requires sleeping while waiting for I/O to complete and allocating
some memory dynamically, which requires the vendor hook to be restricted.

[1] https://csrc.nist.gov/publications/detail/fips/140/2/final

Bug: 185809932
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
(cherry picked from commit e774e4eca6)
(cherry picked from https://android-review.googlesource.com/q/commit:c0f24579002c3fb0e404f223f8574c7f4fdac200)
Merged-In: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
Change-Id: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
2024-02-20 16:46:28 -08:00
Taylor Nelms
81d55bc3b9 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - drm_mode_sort
  - of_get_drm_panel_display_mode

1 function symbol(s) added
  'int of_get_drm_panel_display_mode(struct device_node*, struct drm_display_mode*, u32*)'

Bug: 197774385
Change-Id: I146bca3e0474e44aaecd5711027c5387ccb00f1e
Signed-off-by: Taylor Nelms <tknelms@google.com>
2024-02-20 21:06:25 +00:00
Will Song
92432f07d6 ANDROID: GKI: Update the ABI symbol list
Adding the following symbols:
- devfreq_remove_governor

Test: Build
Bug: 325161541
Change-Id: I76dd0eed62685b71fd95f758fd9b401da87e4df2
Signed-off-by: Will Song <jinpengsong@google.com>
2024-02-14 21:39:25 +00:00
David Stevens
b86713e341 UPSTREAM: virtio: Add support for no-reset virtio PCI PM
If a virtio_pci_device supports native PCI power management and has the
No_Soft_Reset bit set, then skip resetting and reinitializing the device
when suspending and restoring the device. This allows system-wide low
power states like s2idle to be used in systems with stateful virtio
devices that can't simply be re-initialized (e.g. virtio-fs).

Signed-off-by: David Stevens <stevensd@chromium.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Bug: 318540621
Change-Id: Ifc60f72a6a6bd256fa14e291e615c7514dcb4d7d
(cherry picked from commit dff4fa0e57856045359440d05af9e9b7f7048f52)
Signed-off-by: Philip Chen <philipchen@google.com>
(cherry picked from commit a7dcf250aeb8e2a572774a0e51fc0432875b6661)
2024-02-14 00:31:36 +00:00
Pablo Neira Ayuso
7dc3b2e49e UPSTREAM: netfilter: nf_tables: check if catch-all set element is active in next generation
commit b1db244ffd041a49ecc9618e8feb6b5c1afcdaa7 upstream.

When deactivating the catch-all set element, check the state in the next
generation that represents this transaction.

This bug uncovered after the recent removal of the element busy mark
a2dd0233cb ("netfilter: nf_tables: remove busy mark and gc batch API").

Bug: 323034444
Fixes: aaa31047a6 ("netfilter: nftables: add catch-all set element support")
Cc: stable@vger.kernel.org
Reported-by: lonial con <kongln9170@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a372f1d01b)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I40ac92a33db48a2709079d27d7d529946ba297c7
2024-02-13 21:31:22 +00:00
John Fastabend
8d4d76a2bd UPSTREAM: net: tls, update curr on splice as well
commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.

The curr pointer must also be updated on the splice similar to how
we do this for other copy types.

Bug: 322282717
Fixes: d829e9c411 ("tls: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Reported-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20231206232706.374377-2-john.fastabend@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ba5efd8544)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: If942207e6338993096c9fbc8ce4c23a6bbecaf2e
2024-02-13 21:30:01 +00:00
Mike McTernan
9e2b775333 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - kthread_set_per_cpu

1 function symbol(s) added
  'void kthread_set_per_cpu(struct task_struct*, int)'

Bug: 274202992
Change-Id: I5802ade7fe64e3c4e3132a322a70b809cd9d007a
Signed-off-by: Mike McTernan <mikemcternan@google.com>
2024-02-13 20:15:25 +00:00
Philip Chen
5a1f8b6b46 ANDROID: Add pci_read_config_word to virtual device symbol list
Commit a7dcf250aeb8 ("UPSTREAM: virtio: Add support for no-reset virtio
PCI PM") requires pci_read_config_word.

Bug: 318540621
Change-Id: I8fbf7a49dc395b6ed2946fa6834625c63b4223af
Signed-off-by: Philip Chen <philipchen@google.com>
2024-02-13 19:56:45 +00:00
Arve Hjønnevåg
e356cae969 ANDROID: Export kthread_set_per_cpu
kthread_create_on_cpu no longer marks the created thread as a per cpu
thread, so the affinity might get lost on suspend or other hotplug
events.

Export kthread_set_per_cpu so a module that needs a kthread to stay on a
specific cpu can accomplish that.

Bug: 274202992
Change-Id: Iaafc12f93f341f9e0586cb051b7f1c941f140866
Signed-off-by: Arve Hjønnevåg <arve@android.com>
(cherry picked from commit 4fdc7e4658)
2024-02-13 18:56:33 +00:00
Carlos Llamas
81c922621d ANDROID: GKI: fix ABI breakage in struct ipv6_devconf
The following list of commits, which are in the 6.1.57 release, add a
new field in struct ipv6_devconf and this breaks the abi. Fix this by
using one of the reserved slots for upstream changes and update the stg
file to preserve the build.

  b691264274 ("net: release reference to inet6_dev pointer")
  bad004c384 ("net: change accept_ra_min_rtr_lft to affect all RA lifetimes")
  ec4162bb70 ("net: add sysctl accept_ra_min_rtr_lft")

type 'struct ipv6_devconf' changed
  member 'union { struct { __s32 accept_ra_min_lft; u32 padding; }; struct { u64 android_kabi_reserved1; }; union { }; }' was added
  member 'u64 android_kabi_reserved1' was removed

Bug: 320243175
Change-Id: Icddcad574f3c29f6d3e63b10f8c7e51bdf46fe7f
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:51:29 +00:00
Carlos Llamas
20131b787f Reapply "net: release reference to inet6_dev pointer"
This reverts commit d9fef973fe.

Bug: 320243175
Change-Id: I4627e1097dddbb697597cbb51e4ba9f4f1af61da
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:24:27 +00:00
Carlos Llamas
c2c0273029 Reapply "net: change accept_ra_min_rtr_lft to affect all RA lifetimes"
This reverts commit ee96408e49.

Bug: 320243175
Change-Id: If51722d74fe9b326d69c96c0cdfca43db6e33b93
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:24:14 +00:00
Carlos Llamas
a8053aadca Reapply "net: add sysctl accept_ra_min_rtr_lft"
This reverts commit c8da9c614c.

Bug: 320243175
Change-Id: Ia31692230f2f5cbd2ac349edcb2be320497c52f3
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:23:48 +00:00
Carlos Llamas
fc6c1b3acb ANDROID: GKI: explicit include of stringify.h
The android_kabi.h header file uses the __stringify() macro without
explicitly including its definition via linux/stringify.h. This can
result in build breaking when using the ANDROID_KABI_USE macro:

  common/include/linux/ipv6.h:83:2: error: expected ')'
  ANDROID_KABI_USE(1, struct { __s32 accept_ra_min_lft; u32 padding; });
  ^
  [...]
  common/include/linux/android_kabi.h:44:24: note: expanded from macro '__ANDROID_KABI_CHECK_SIZE_ALIGN'
      __FILE__ ":" __stringify(__LINE__) ": "          \
                   ^

To fix this let android_kabi.h include stringify.h explicitly instead of
relying on includes of previous unrelated header files.

Bug: 324437514
Change-Id: I16cced44e723871b2e1a92b312e60f38e41fea70
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-02-13 01:22:19 +00:00
Gao Xiang
8481b97df5 BACKPORT: erofs: fix infinite loop due to a race of filling compressed_bvecs
I encountered a race issue after lengthy (~594647 sec) stress tests on
a 64k-page arm64 VM with several 4k-block EROFS images.  The timing
is like below:

z_erofs_try_inplace_io                  z_erofs_fill_bio_vec
  cmpxchg(&compressed_bvecs[].page,
          NULL, ..)
                                        [access bufvec]
  compressed_bvecs[] = *bvec;

Previously, z_erofs_submit_queue() just accessed bufvec->page only, so
other fields in bufvec didn't matter.  After the subpage block support
is landed, .offset and .end can be used too, but filling bufvec isn't
an atomic operation which can cause inconsistency.

Let's use a spinlock to keep the atomicity of each bufvec.

Fixes: 192351616a9d ("erofs: support I/O submission for sub-page compressed blocks")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Link: https://lore.kernel.org/r/20240125120039.3228103-1-hsiangkao@linux.alibaba.com

Bug: 324640522
(cherry picked from commit cc4b2dd95f0d1eba8c691b36e8f4d1795582f1ff
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ master)

[dhavale: introduced spinlock in struct erofs_workgroup, upstream has a
change where atomic is replaced by lockref but pulling that and related
changes will cause unnecessary churn. Adding spinlock keeps the spirit
of the change in-tact by fixing the race. Also updated commit message
as we are not using lockref.]

Change-Id: Id20a0a433277ab71d46bce48c81824564d1b391d
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
2024-02-12 20:56:13 +00:00
Prakruthi Deepak Heragu
886c9d1fc2 ANDROID: arm64: virt: Invalidate tlb once the balloon before reporting/inflating
Instead of invalidating the tlb of the guest every page it relinquishes,
invalidate once before the host is informed about the free pages.

Bug: 315173520
Change-Id: I8450fd552a27dfc791efa15e884982aeedaa3234
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
2024-02-12 17:25:48 +00:00
Prakruthi Deepak Heragu
4aedc102c3 ANDROID: arm64: virt: Make the page_relinquish call generic
Move out the kvm specific page_relinquish call and introduce a generic
hypervisor_ops structure. Based on the hypervisor running underneath the
guest, populate the operations to make specific hypercalls.

Bug: 315173520
Change-Id: I93d5a92553a04d56811b0666dec6eacc1ca168e7
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
2024-02-12 17:25:48 +00:00
Konrad Dybcio
d3f73f0452 UPSTREAM: drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks
[ Upstream commit 3d07a411b4faaf2b498760ccf12888f8de529de0 ]

This helper has been introduced to avoid programmer errors (missing
_put calls leading to dangling refcnt) when using pm_runtime_get, use it.

While at it, start checking the return value.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 5c82902844 ("drm/msm/dsi: Split PHY drivers to separate files")
Patchwork: https://patchwork.freedesktop.org/patch/543350/
Link: https://lore.kernel.org/r/20230620-topic-dsiphy_rpm-v2-1-a11a751f34f0@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Bug: 146449535
Change-Id: I13c0463e50475f3a432818108bc48dd6482c3c7c
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2024-02-08 18:38:26 +00:00
Konrad Dybcio
df2fe1add7 UPSTREAM: drm/msm/dsi: Enable runtime PM
commit 6ab502bc1cf3147ea1d8540d04b83a7a4cb6d1f1 upstream.

Some devices power the DSI PHY/PLL through a power rail that we model
as a GENPD. Enable runtime PM to make it suspendable.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/543352/
Link: https://lore.kernel.org/r/20230620-topic-dsiphy_rpm-v2-2-a11a751f34f0@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 146449535
Change-Id: I7cde481b64be594e5b4aa7fe7d9378d25f2e39b3
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2024-02-08 18:18:06 +00:00
Ard Biesheuvel
6053d8ffd4 UPSTREAM: arm64: scs: Disable LTO for SCS patching code
Full LTO takes the '-mbranch-protection=none' passed to the compiler
when generating the dynamic shadow call stack patching code as a hint to
stop emitting PAC instructions altogether. (Thin LTO appears unaffected
by this)

Work around this by disabling LTO for the compilation unit, which
appears to convince the linker that it should still use PAC in the rest
of the kernel..

Fixes: 3b619e22c4 ("arm64: implement dynamic shadow call stack for Clang")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20240123133052.1417449-6-ardb+git@google.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit d104a6fef3fec137d8d44961224ab76edbd6cbc7)
Bug: 317883735
Change-Id: Ic4bdb0a6e527f8cb2745282b81945aa7b7231502
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2024-02-07 10:37:36 +00:00
Bo Ye
696293ef72 ANDROID: GKI: Update symbol list for mtk
Add following symbols

 1 function symbol(s) added
   'bool usb_check_bulk_endpoints(const struct usb_interface*, const u8*)'

Bug: 323718720
Change-Id: I0835786fb503e6e65f21116fa2b5d7e8fb83978d
Signed-off-by: Bo Ye <bo.ye@mediatek.com>
2024-02-07 00:59:58 +00:00
Daniel Rosenberg
6338e41509 BACKPORT: f2fs: Restrict max filesize for 16K f2fs
Blocks are tracked by u32, so the max permitted filesize is
(U32_MAX + 1) * BLOCK_SIZE. Additionally, in order to support crypto
data unit sizes of 4K with a 16K block with IV_INO_LBLK_{32,64}, we must
further restrict max filesize to (U32_MAX + 1) * 4096. This does not
affect 4K blocksize f2fs as the natural limit for files are well below
that.

Fixes: cf46c5872022 ("BACKPORT: Support Block Size == Page Size")
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Change-Id: I8697e37841e1882a3f613e9aab1857ad7e4c3f2f
Bug: 248132568
(cherry picked from commit a6a010f5def544af3efcfe21683905a712b60536)
2024-02-07 00:14:26 +00:00
Daniel Rosenberg
8c8bcbdf0b BACKPORT: f2fs: Support Block Size == Page Size
This allows f2fs to support cases where the block size = page size for
both 4K and 16K block sizes. Other sizes should work as well, should the
need arise. This does not currently support 4K Block size filesystems if
the page size is 16K.

Change-Id: Ifab03cddeec1389a6a3fb64174063ffccbb93072
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Bug: 248132568
(cherry picked from commit 8b8e202be3264fc33464f8dc319e0c1563ac89d8)
(fixed minor conflict in fs/f2fs/inode.c)
2024-02-07 00:14:26 +00:00
Andre Ding
eb20497d6d ANDROID: abi_gki_aarch64_qcom: Update symbol list
The Marvell phy AQR113c requires below symbols to enhance debugging.
  genphy_c45_an_config_aneg
  genphy_c45_check_and_restart_aneg
  genphy_c45_pma_setup_forced
  genphy_c45_read_status
  phy_modify_mmd_changed
  phy_resolve_aneg_linkmode
  phy_set_max_speed

Bug: 324005886
Change-Id: Ie20cbecbc01c885eab701416ee499f0f1dc2dd66
Signed-off-by: Andre Ding <quic_shuangxi@quicinc.com>
2024-02-06 22:49:47 +00:00
Dmitry Baryshkov
1e6c1ca9a2 UPSTREAM: usb: typec: tcpm: fix the PD disabled case
If the PD is disabled for the port, port->pds will be left as NULL,
which causes the following crash during caps intilisation. Fix the
crash.

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
Call trace:
 tcpm_register_port+0xaec/0xc44
 qcom_pmic_typec_probe+0x1a4/0x254
 platform_probe+0x68/0xc0
 really_probe+0x148/0x2ac
 __driver_probe_device+0x78/0x12c
 driver_probe_device+0xd8/0x160
Bluetooth: hci0: QCA Product ID   :0x0000000a
 __device_attach_driver+0xb8/0x138
 bus_for_each_drv+0x80/0xdc
Bluetooth: hci0: QCA SOC Version  :0x40020150
 __device_attach+0x9c/0x188
 device_initial_probe+0x14/0x20
 bus_probe_device+0xac/0xb0
 deferred_probe_work_func+0x8c/0xc8
 process_one_work+0x1ec/0x51c
 worker_thread+0x1ec/0x3e4
 kthread+0x120/0x124
 ret_from_fork+0x10/0x20

Fixes: cd099cde4ed2 ("usb: typec: tcpm: Support multiple capabilities")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240113-pmi632-typec-v2-5-182d9aa0a5b3@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

BUG: 206108037
(cherry picked from commit f2e5d3de7e1fbf24483e7f996e519b3ebc3935a1)
Change-Id: If3e81f4bc7c22830d8b0e8400b6e2fc8719a7f6b
Signed-off-by: Kyle Tso <kyletso@google.com>
2024-02-06 02:20:19 +00:00
Florian Westphal
ba97ad7b91 UPSTREAM: netfilter: nf_tables: reject QUEUE/DROP verdict parameters
commit f342de4e2f33e0e39165d8639387aa6c19dff660 upstream.

This reverts commit e0abdadcc6.

core.c:nf_hook_slow assumes that the upper 16 bits of NF_DROP
verdicts contain a valid errno, i.e. -EPERM, -EHOSTUNREACH or similar,
or 0.

Due to the reverted commit, its possible to provide a positive
value, e.g. NF_ACCEPT (1), which results in use-after-free.

Its not clear to me why this commit was made.

NF_QUEUE is not used by nftables; "queue" rules in nftables
will result in use of "nft_queue" expression.

If we later need to allow specifiying errno values from userspace
(do not know why), this has to call NF_DROP_GETERR and check that
"err <= 0" holds true.

Bug: 323034288
Fixes: e0abdadcc6 ("netfilter: nf_tables: accept QUEUE/DROP verdict parameters")
Cc: stable@vger.kernel.org
Reported-by: Notselwyn <notselwyn@pwning.tech>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8e34430e33)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ie6c699cea6f92cd4a7642f196d5f5cbffe268a6d
2024-02-05 13:05:13 +00:00
chenweitao
76f0396b57 ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'int __traceiter_android_vh_binder_detect_low_async_space_locked(void*, int, size_t*, int, bool*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_binder_detect_low_async_space_locked'

Bug: 322915513
Change-Id: I99867fc9a643b50ba607d948a228c02bc30df424
Signed-off-by: chenweitao <chenweitao@oppo.com>
2024-02-02 19:36:14 +00:00
chenyuwen
016b640235 ANDROID: fuse: Fix the issue of fuse_dentry_canonical_path
The d_canonical_path is added for Android. The another fuse daemon
such as ntfs.3g do not implement it. The fsnotify can not work when
using those fuse daemon.

Fixes: aca265111a ("ANDROID: fuse: Add support for d_canonical_path")
Change-Id: I4244431fa1520b5bc33e07da456b3062b635dc5c
Signed-off-by: chenyuwen <chenyuwen1@meizu.com>
2024-02-02 10:03:33 +00:00
Qais Yousef
5eb1cbb384 ANDROID: Update the ABI symbol list
Adding the following symbols:
  - cpufreq_driver_test_flags

Bug: 322549912
Change-Id: If11bb96309537e0ee20aaf609dc2cf4ae6324078
Signed-off-by: Qais Yousef <qyousef@google.com>
2024-02-01 23:58:58 +00:00
Qais Yousef
b53c3cb351 ANDROID: Export cpufreq_driver_test_flags()
The function is required by out of tree cpufreq governors.

Bug: 322549912
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: Ib62bb957d72878a56cbbd955447b372cdad3b92c
2024-02-01 23:58:58 +00:00
Bart Van Assche
9b476ebe99 ANDROID: Build null_blk and scsi_debug as kernel modules
Both kernel modules are important for testing block layer and SCSI core
performance and functionality. Hence enable these in the kernel
configuration.

Bug: 323406846
Change-Id: I23cee78cd7d4e5f891395624a6bed01cffee4aa8
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-02-01 23:53:56 +00:00
Will McVicker
01472f3af1 ANDROID: GKI: Update the pixel symbol list
2 function symbol(s) added
  'int __traceiter_android_rvh_ufs_reprogram_all_keys(void*, struct ufs_hba*, int*)'
  'int __traceiter_dwc3_readl(void*, void*, u32, u32)'

2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_ufs_reprogram_all_keys'
  'struct tracepoint __tracepoint_dwc3_readl'

Bug: 269652215
Change-Id: Id48d7d9770551c84f226f43de751eea48ae3eb7d
Signed-off-by: Will McVicker <willmcvicker@google.com>
2024-02-01 23:52:29 +00:00
Ray Chi
fbcd29ac45 ANDROID: usb: dwc3: export tracepoint for dwc3 read/write
There are two tracepoints in dwc3_readl() and dwc3_writel().
This patch will export the tracepoints so that vendor modules
can use them.

Bug: 184920962
Signed-off-by: Ray Chi <raychi@google.com>
Change-Id: I1170d853be1fa1c47afbba133567b1996418d8e8
2024-02-01 23:52:29 +00:00
Eric Biggers
0123832f68 ANDROID: scsi: ufs: add vendor hook to override key reprogramming
Some hardware has a way to restore all keyslots at once that is
significantly faster than restoring each keyslot individually, as is
done by blk_ksm_reprogram_all_keys().  Add a hook
"android_rvh_ufs_reprogram_all_keys" that allows overriding the
restoration of all keyslots after UFS reset.  This may sleep, so this
must be a "restricted" Android vendor hook rather than a regular one.

Note that currently this functionality can't be upstreamed, as support
for the hardware that needs it would need to be upstreamed first.

(cherry picked from commit e2e063f507)

Bug: 162257402
Bug: 181905172
Bug: 241106918
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Kenny Root <kroot@google.com>
Change-Id: I0b25393a5131941f085892560e08a64e63cd1369
2024-02-01 23:52:29 +00:00
chenweitao
7ce117301e ANDROID: vendor_hooks: Add hook for binder_detect_low_async_space_locked
Add hook for binder_detect_low_async_space_locked, which gives the vendor a choice whether or not this alloc new buf should go on or not

Bug: 322915513
Change-Id: Ie7f1567dae6dee0fb22b014cd1eacc3308ccb205
Signed-off-by: chenweitao <chenweitao@oppo.com>
2024-02-01 18:31:21 +00:00
Rick Yiu
7b6a6228df ANDROID: Update the ABI symbol list
Adding the following symbols:
  - d_path
  - find_vpid
  - get_task_mm
  - mas_find
  - mmput
  - __traceiter_android_rvh_sched_setaffinity
  - __tracepoint_android_rvh_sched_setaffinity

Bug: 297987838
Change-Id: Idac889c1b9f2c397036bd83bc1ac5cba19eeab6f
Signed-off-by: Rick Yiu <rickyiu@google.com>
2024-02-01 17:44:33 +00:00
Kyle Tso
db94de2a17 ANDROID: Update the ABI representation
type 'struct tcpm_port' changed
  byte size changed from 12536 to 12552
  member 'struct usb_power_delivery** pds' was added
  member 'struct pd_data** pd_list' was added
  member 'struct usb_power_delivery* pd' was removed
  5 members ('struct usb_power_delivery_capabilities* port_source_caps' .. 'struct usb_power_delivery_capabilities* partner_sink_caps') changed
    offset changed by 64
  member 'struct usb_power_delivery* selected_pd' was added
  5 members ('u32 sink_request' .. 'unsigned int nr_sink_caps') changed
    offset changed by 128
  member 'unsigned int pd_count' was added
  14 members ('u32 src_pdo[7]' .. 'u32 supply_voltage') changed
    offset changed by 160
  32 members ('struct power_supply* psy' .. 'u8* logbuffer[1024]') changed
    offset changed by 128

Bug: 206108037
Change-Id: I533d197558e12eefeb4984dbbd58c8f5b4d9e9ac
Signed-off-by: Kyle Tso <kyletso@google.com>
2024-02-01 17:37:13 +00:00
Kyle Tso
e08371bcf5 UPSTREAM: usb: typec: tcpm: Support multiple capabilities
Refactor tcpm_fw_get_caps to support the multiple pd capabilities got
from fwnode. For backward compatibility, the original single capability
is still applicable. The fetched data is stored in the newly defined
structure "pd_data" and there is an array "pd_list" to store the
pointers to them. A dedicated array "pds" is used to store the handles
of the registered usb_power_delivery instances.

Also implement the .pd_get and .pd_set ops which are introduced in
commit a7cff92f06 ("usb: typec: USB Power Delivery helpers for ports
and partners"). Once the .pd_set is called, the current capability will
be updated and state machine will re-negotiate the power contract if
possible.

Signed-off-by: Kyle Tso <kyletso@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231216104630.2720818-3-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 206108037
(cherry picked from commit cd099cde4ed264403b434d8344994f97ac2a4349)
Signed-off-by: Kyle Tso <kyletso@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:eab651bc575f23415e8aa8cb39b45a92fcf8eeee)
Merged-In: I58ee6e321f304b758507287ced314cc7a07466eb
Change-Id: I58ee6e321f304b758507287ced314cc7a07466eb
2024-02-01 17:37:13 +00:00
Dmitry Baryshkov
4025820c61 UPSTREAM: usb: typec: tcpm: Parse Accessory Mode information
Some of the boards supported by the TCPM drivers can support USB-C
Accessory Modes (Analog Audio, Debug). Parse information about supported
modes from the device tree.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20231215173005.313422-3-dmitry.baryshkov@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 206108037
(cherry picked from commit e9158c7e55339737847cebbfa397c668713f1a15)
Signed-off-by: Kyle Tso <kyletso@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:33854a1fee6cc57f82c14ea0d584d1f425a5d95e)
Merged-In: Iece498046926d631d4a572152fbe41957b8354e4
Change-Id: Iece498046926d631d4a572152fbe41957b8354e4
2024-02-01 17:37:13 +00:00
Hyunwoo Kim
3578913b2e UPSTREAM: net/rose: Fix Use-After-Free in rose_ioctl
[ Upstream commit 810c38a369a0a0ce625b5c12169abce1dd9ccd53 ]

Because rose_ioctl() accesses sk->sk_receive_queue
without holding a sk->sk_receive_queue.lock, it can
cause a race with rose_accept().
A use-after-free for skb occurs with the following flow.
```
rose_ioctl() -> skb_peek()
rose_accept() -> skb_dequeue() -> kfree_skb()
```
Add sk->sk_receive_queue.lock to rose_ioctl() to fix this issue.

Bug: 321175740
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Hyunwoo Kim <v4bel@theori.io>
Link: https://lore.kernel.org/r/20231209100538.GA407321@v4bel-B760M-AORUS-ELITE-AX
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 3f1f6a94d8)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I94d2aae6221fb95cb285e1a6d0c6fe39a70e35d2
2024-02-01 10:19:55 +00:00
Matthew Wilcox (Oracle)
8fbed1ea00 UPSTREAM: ida: Fix crash in ida_free when the bitmap is empty
[ Upstream commit af73483f4e8b6f5c68c9aa63257bdd929a9c194a ]

The IDA usually detects double-frees, but that detection failed to
consider the case when there are no nearby IDs allocated and so we have a
NULL bitmap rather than simply having a clear bit.  Add some tests to the
test-suite to be sure we don't inadvertently reintroduce this problem.
Unfortunately they're quite noisy so include a message to disregard
the warnings.

Bug: 321878978
Reported-by: Zhenghan Wang <wzhmmmmm@gmail.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 5dbcdaf4db)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I4919e5c64af12f86fe1a91e1e9224a58eedbf345
2024-02-01 10:19:53 +00:00
Seiya Wang
6ce5bb744e ANDROID: GKI: Update symbol list for mtk
Add following symbols

12 function symbol(s) added
  'void clkdev_add(struct clk_lookup*)'
  'void clkdev_drop(struct clk_lookup*)'
  'void devm_devfreq_unregister_opp_notifier(struct device*, struct devfreq*)'
  'struct phy_device* fixed_phy_register(unsigned int, struct fixed_phy_status*, struct device_node*)'
  'void fixed_phy_unregister(struct phy_device*)'
  'int generic_handle_irq_safe(unsigned int)'
  'struct irq_domain* irq_domain_create_simple(struct fwnode_handle*, unsigned int, unsigned int, const struct irq_domain_ops*, void*)'
  'void phy_ethtool_ksettings_get(struct phy_device*, struct ethtool_link_ksettings*)'
  'int phy_ethtool_ksettings_set(struct phy_device*, const struct ethtool_link_ksettings*)'
  'int phy_register_fixup_for_uid(u32, u32, int(*)(struct phy_device*))'
  'int phy_save_page(struct phy_device*)'
  'int phy_unregister_fixup_for_uid(u32, u32)'

Bug: 323111136
Signed-off-by: Seiya Wang <seiya.wang@mediatek.com>
Change-Id: I2b9659b4cd24363631913f3c1548198127fb293e
2024-01-31 14:58:22 +00:00
Greg Kroah-Hartman
7cbad58851 Reapply "perf: Disallow mis-matched inherited group reads"
This reverts commit 63eafbb6b3.

Keeps the ABI stable by taking advantage of a hole in the structure!

Bug: 307236803
Change-Id: Ic5f7ebeb3a9b13afdb3bfff7e54c4a93b863dab6
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2024-01-31 13:16:05 +00:00
Subrahmanyam Guthena
067a03c44e ANDROID: GKI: Add Pasa symbol list
Add iio_trigger_generic_data_rdy_poll & input_device_enabled
symbols used by inv-mpu-iio.ko (IAM20680 Sensor Module) &
atmel_mxt_ts.ko(Ateml Touch) driver.

Functions changes summary: 0 Removed, 0 Changed, 2 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:
  [A] 'function irqreturn_t iio_trigger_generic_data_rdy_poll(int irq,
void *private)'
  [A] 'function bool input_device_enabled(struct input_dev *dev)'

Bug: 286165300

Change-Id: Icb0b6f6e97c2ec92e1aa68b88a72d2f7b5bad319
Signed-off-by: Subrahmanyam Guthena <subrahmanyam.guthena@ext.us.panasonic.com>
2024-01-31 00:03:03 +00:00