Merge remote-tracking branch 'sm8350/lineage-20' into lineage-23.2

* sm8350/lineage-20:
  drivers: staging: qca-wifi-host-cmn: Fix implicit-enum-enum-cast errors
  techpack: display: msm: sde: Fix uninitialized errors
  drivers: hwtracing: coresight: Fix sometimes-uninitialized errors
  kbuild: Remove support for Clang's ThinLTO caching
  kbuild: lto: force rebuilds when switching CONFIG_LTO
  Makefile: use -z pack-relative-relocs
  Revert "kbuild: disable clang's default use of -fmerge-all-constants"
  BACKPORT: dma-buf: return success for cmo of dummy clients
  Revert "msm: kgsl: Call dma_buf_unmap_attachment() early"

Change-Id: I879af747cfc89b2e70d80b06c53ed67cc3195266
This commit is contained in:
Michael Bestas 2026-07-01 10:16:13 +03:00
commit c229ae0da6
No known key found for this signature in database
7 changed files with 24 additions and 25 deletions

View file

@ -947,7 +947,6 @@ endif
ifdef CONFIG_LTO_CLANG
ifdef CONFIG_THINLTO
CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit)
KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache
else
CC_FLAGS_LTO_CLANG := -flto
endif
@ -964,7 +963,8 @@ endif
ifdef CONFIG_LTO
CC_FLAGS_LTO := $(CC_FLAGS_LTO_CLANG)
KBUILD_CFLAGS += $(CC_FLAGS_LTO)
KBUILD_CFLAGS += -fno-lto $(CC_FLAGS_LTO)
KBUILD_AFLAGS += -fno-lto
export CC_FLAGS_LTO
endif
@ -1017,15 +1017,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
# clang sets -fmerge-all-constants by default as optimization, but this
# is non-conforming behavior for C and in fact breaks the kernel, so we
# need to disable it here generally.
KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
# for gcc -fno-merge-all-constants disables everything, but it is fine
# to have actual conforming behavior enabled.
KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
@ -1067,7 +1058,8 @@ LDFLAGS_vmlinux += $(call ld-option, -X,)
endif
ifeq ($(CONFIG_RELR),y)
LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags
# ld.lld before 15 did not support -z pack-relative-relocs.
LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z pack-relative-relocs)
endif
# userspace programs are linked via the compiler, use the correct linker

View file

@ -349,6 +349,7 @@ static void kgsl_destroy_ion(struct kgsl_memdesc *memdesc)
if (meta != NULL) {
remove_dmabuf_list(meta);
dma_buf_unmap_attachment(meta->attach, memdesc->sgt, DMA_BIDIRECTIONAL);
dma_buf_detach(meta->dmabuf, meta->attach);
dma_buf_put(meta->dmabuf);
kfree(meta);
@ -2996,7 +2997,7 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
{
int ret = 0;
struct scatterlist *s;
struct sg_table *sg_table;
struct sg_table *sg_table = NULL;
struct dma_buf_attachment *attach = NULL;
struct kgsl_dma_buf_meta *meta;
@ -3038,8 +3039,6 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
goto out;
}
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
meta->table = sg_table;
entry->priv_data = meta;
entry->memdesc.sgt = sg_table;
@ -3094,6 +3093,9 @@ skip_access_check:
out:
if (ret) {
if (!IS_ERR_OR_NULL(sg_table))
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
if (!IS_ERR_OR_NULL(attach))
dma_buf_detach(dmabuf, attach);

View file

@ -80,7 +80,7 @@ static ssize_t tmc_etr_byte_cntr_read(struct file *fp, char __user *data,
size_t len, loff_t *ppos)
{
struct byte_cntr *byte_cntr_data = fp->private_data;
char *bufp;
char *bufp = NULL;
int ret = 0;
if (!data)
return -EINVAL;

View file

@ -500,11 +500,12 @@ static int ion_sgl_sync_range(struct device *dev, struct scatterlist *sgl,
break;
if (i > 0) {
if (get_dma_ops(dev)) {
pr_warn_ratelimited("Partial cmo only supported with 1 segment\n"
"is dma_set_max_seg_size being set on dev:%s\n",
dev_name(dev));
}
if (!get_dma_ops(dev))
return 0;
pr_warn_ratelimited("Partial cmo only supported with 1 segment\n"
"is dma_set_max_seg_size being set on dev:%s\n",
dev_name(dev));
return -EINVAL;
}
}

View file

@ -2227,7 +2227,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx,
if (qdf_unlikely(!ce_hdl)) {
hif_err("CE handle is null");
return A_ERROR;
return QDF_STATUS_E_FAILURE;
}
QDF_NBUF_UPDATE_TX_PKT_COUNT(nbuf, QDF_NBUF_TX_PKT_HIF);

View file

@ -7,8 +7,12 @@ trap "rm -f $tmp_file.o $tmp_file $tmp_file.bin" EXIT
cat << "END" | $CC -c -x c - -o $tmp_file.o >/dev/null 2>&1
void *p = &p;
END
$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr \
--use-android-relr-tags -o $tmp_file
# ld.lld before 15 did not support -z pack-relative-relocs.
if ! $LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file 2>/dev/null; then
$LD $tmp_file.o -shared -Bsymbolic -z pack-relative-relocs -o $tmp_file 2>&1 |
grep -q pack-relative-relocs && exit 1
fi
# Despite printing an error message, GNU nm still exits with exit code 0 if it
# sees a relr section. So we need to check that nothing is printed to stderr.

View file

@ -987,7 +987,7 @@ static bool _sde_rm_check_lm_and_get_connected_blks(
u32 conn_lm_mask)
{
const struct sde_lm_cfg *lm_cfg = to_sde_hw_mixer(lm->hw)->cap;
const struct sde_pingpong_cfg *pp_cfg;
const struct sde_pingpong_cfg *pp_cfg = NULL;
bool ret, is_conn_primary, is_conn_secondary;
u32 lm_primary_pref, lm_secondary_pref, cwb_pref;