diff options
author | Will McVicker <willmcvicker@google.com> | 2022-05-20 15:50:47 -0700 |
---|---|---|
committer | Will McVicker <willmcvicker@google.com> | 2022-05-23 10:01:57 -0700 |
commit | 62f7c878b0842070bda13935aff2541463357357 (patch) | |
tree | 001469d5cbc49159016d46475e7438546407ab44 | |
parent | 01b5a39f1969dc52a6d7045290167f015b4ffd90 (diff) | |
download | edgetpu-62f7c878b0842070bda13935aff2541463357357.tar.gz |
Update the Kbuild file to fix header includes
To include the soc/gs headers we are using EXTRA_CFLAGS in the Makefile.
One caveat with this is that ccflags-y is checked first before
EXTRA_CFLAGS. For this project, we have some header stubs under
include/linux which are added in Kbuild using ccflags-y. This means that
the stubs are actually getting used instead of the real headers from
private/google-modules/soc/gs/include. So fix the Kbuild to remove the
local includes for all but the trace header in order to properly include
the real kernel headers.
This fixes PM stability and firmware loading issues on this branch. Here
are the logs observed:
I edgetpu_platform 1ce00000.abrolhos: Initial power state: 2
E edgetpu_platform 1ce00000.abrolhos: pm_runtime_get_sync returned 1
I edgetpu abrolhos: Powering up
E edgetpu abrolhos: edgetpu_ioctl_finalize_group: pm_get failed (1)
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I7984d61f38932ac27f9ce2a8bb31481f3c27e3a8
-rw-r--r-- | drivers/edgetpu/Kbuild | 18 | ||||
-rw-r--r-- | drivers/edgetpu/include/linux/acpm_dvfs.h | 9 | ||||
-rw-r--r-- | drivers/edgetpu/include/linux/gsa/gsa_tpu.h | 9 |
3 files changed, 22 insertions, 14 deletions
diff --git a/drivers/edgetpu/Kbuild b/drivers/edgetpu/Kbuild index a51dcd4..93a6442 100644 --- a/drivers/edgetpu/Kbuild +++ b/drivers/edgetpu/Kbuild @@ -1,8 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_ABROLHOS) += abrolhos.o -ccflags-y += -DCONFIG_EDGETPU_TELEMETRY_TRACE=1 -ccflags-y += -I$(srctree)/$(src)/include +ccflags-y += -DCONFIG_EDGETPU_TELEMETRY_TRACE=1 -DCONFIG_ABROLHOS=1 GIT_PATH=$(srctree)/$(src) ifeq ($(shell git -C $(GIT_PATH) rev-parse --is-inside-work-tree),true) @@ -24,15 +23,6 @@ abrolhos-objs := abrolhos-core.o abrolhos-debug-dump.o \ abrolhos-usage-stats.o abrolhos-wakelock.o \ $(edgetpu-objs) -CFLAGS_abrolhos-fs.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-core.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-device.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-device-group.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-firmware.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-iommu.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-platform.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-pm.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-thermal.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-debug-dump.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-usage-stats.o := -DCONFIG_ABROLHOS=1 -CFLAGS_abrolhos-wakelock.o := -DCONFIG_ABROLHOS=1 +# This -I is for the trace file include. It was removed from ccflags-y to avoid +# including the header stubs. +CFLAGS_abrolhos-fs.o := -I$(srctree)/$(src)/include diff --git a/drivers/edgetpu/include/linux/acpm_dvfs.h b/drivers/edgetpu/include/linux/acpm_dvfs.h index 6872abe..b8552e6 100644 --- a/drivers/edgetpu/include/linux/acpm_dvfs.h +++ b/drivers/edgetpu/include/linux/acpm_dvfs.h @@ -8,6 +8,15 @@ #ifndef __ACPM_DVFS_H__ #define __ACPM_DVFS_H__ +/* This header file is a stub and shouldn't be used when compiling the driver + * in the Pixel tree. Instead, we need to be using the header in the kernel + * tree or SoC modules project, e.g. private/google-modules/soc/gs. To avoid + * instroducing conflicts when merging updates to this driver or re-introducing + * this header from a merge, I'm insttead adding this build time error to make + * sure we catch any changes that get this header included again. + */ +#error "We should not be using this header file!" + static inline int exynos_acpm_set_init_freq(unsigned int dfs_id, unsigned long freq) { return 0; diff --git a/drivers/edgetpu/include/linux/gsa/gsa_tpu.h b/drivers/edgetpu/include/linux/gsa/gsa_tpu.h index 2dc8a79..24277f0 100644 --- a/drivers/edgetpu/include/linux/gsa/gsa_tpu.h +++ b/drivers/edgetpu/include/linux/gsa/gsa_tpu.h @@ -8,6 +8,15 @@ #ifndef __LINUX_GSA_TPU_H #define __LINUX_GSA_TPU_H +/* This header file is a stub and shouldn't be used when compiling the driver + * in the Pixel tree. Instead, we need to be using the header in the kernel + * tree or SoC modules project, e.g. private/google-modules/soc/gs. To avoid + * instroducing conflicts when merging updates to this driver or re-introducing + * this header from a merge, I'm insttead adding this build time error to make + * sure we catch any changes that get this header included again. + */ +#error "We should not be using this header file!" + #include <linux/device.h> #include <linux/types.h> |