* [PATCH] drivers: optee: fix i2c build issue
@ 2020-08-31 15:23 Jorge Ramirez-Ortiz
2020-08-31 15:49 ` Randy Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Jorge Ramirez-Ortiz @ 2020-08-31 15:23 UTC (permalink / raw)
To: jorge, jens.wiklander; +Cc: sumit.garg, tee-dev, linux-kernel, ricardo
When the optee driver is compiled into the kernel while the i2c core
is configured as a module, the i2c symbols are not available.
This commit addresses the situation by disabling the i2c support for
this use case while allowing it in all other scenarios:
i2c=y, optee=y
i2c=m, optee=m
i2c=y, optee=m
i2c=m, optee=y (not supported)
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
---
This patch applies on top of
https://git.linaro.org/people/jens.wiklander/linux-tee.git/tag/?h=optee-i2c-for-v5.10
drivers/tee/optee/rpc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c
index 64a206c56264..96e91d5f0a86 100644
--- a/drivers/tee/optee/rpc.c
+++ b/drivers/tee/optee/rpc.c
@@ -51,6 +51,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)
}
#if IS_ENABLED(CONFIG_I2C)
+#if !defined(CONFIG_I2C_MODULE) || defined(CONFIG_OPTEE_MODULE)
static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
struct optee_msg_arg *arg)
{
@@ -140,6 +141,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
arg->ret = TEEC_ERROR_NOT_SUPPORTED;
}
#endif
+#endif
static struct wq_entry *wq_entry_get(struct optee_wait_queue *wq, u32 key)
{
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: optee: fix i2c build issue
2020-08-31 15:23 [PATCH] drivers: optee: fix i2c build issue Jorge Ramirez-Ortiz
@ 2020-08-31 15:49 ` Randy Dunlap
2020-08-31 16:04 ` Jorge Ramirez-Ortiz, Foundries
0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2020-08-31 15:49 UTC (permalink / raw)
To: Jorge Ramirez-Ortiz, jens.wiklander
Cc: sumit.garg, tee-dev, linux-kernel, ricardo
On 8/31/20 8:23 AM, Jorge Ramirez-Ortiz wrote:
> When the optee driver is compiled into the kernel while the i2c core
> is configured as a module, the i2c symbols are not available.
>
> This commit addresses the situation by disabling the i2c support for
> this use case while allowing it in all other scenarios:
>
> i2c=y, optee=y
> i2c=m, optee=m
> i2c=y, optee=m
> i2c=m, optee=y (not supported)
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
> ---
>
> This patch applies on top of
> https://git.linaro.org/people/jens.wiklander/linux-tee.git/tag/?h=optee-i2c-for-v5.10
>
> drivers/tee/optee/rpc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c
> index 64a206c56264..96e91d5f0a86 100644
> --- a/drivers/tee/optee/rpc.c
> +++ b/drivers/tee/optee/rpc.c
> @@ -51,6 +51,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)
> }
>
> #if IS_ENABLED(CONFIG_I2C)
> +#if !defined(CONFIG_I2C_MODULE) || defined(CONFIG_OPTEE_MODULE)
Looks like
#if IS_REACHABLE(CONFIG_I2C)
should work here.
> static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
> struct optee_msg_arg *arg)
> {
> @@ -140,6 +141,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
> arg->ret = TEEC_ERROR_NOT_SUPPORTED;
> }
> #endif
> +#endif
>
> static struct wq_entry *wq_entry_get(struct optee_wait_queue *wq, u32 key)
> {
>
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: optee: fix i2c build issue
2020-08-31 15:49 ` Randy Dunlap
@ 2020-08-31 16:04 ` Jorge Ramirez-Ortiz, Foundries
0 siblings, 0 replies; 3+ messages in thread
From: Jorge Ramirez-Ortiz, Foundries @ 2020-08-31 16:04 UTC (permalink / raw)
To: Randy Dunlap
Cc: Jorge Ramirez-Ortiz, jens.wiklander, sumit.garg, tee-dev,
linux-kernel, ricardo
On 31/08/20, Randy Dunlap wrote:
> On 8/31/20 8:23 AM, Jorge Ramirez-Ortiz wrote:
> > When the optee driver is compiled into the kernel while the i2c core
> > is configured as a module, the i2c symbols are not available.
> >
> > This commit addresses the situation by disabling the i2c support for
> > this use case while allowing it in all other scenarios:
> >
> > i2c=y, optee=y
> > i2c=m, optee=m
> > i2c=y, optee=m
> > i2c=m, optee=y (not supported)
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
> > ---
> >
> > This patch applies on top of
> > https://git.linaro.org/people/jens.wiklander/linux-tee.git/tag/?h=optee-i2c-for-v5.10
> >
> > drivers/tee/optee/rpc.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c
> > index 64a206c56264..96e91d5f0a86 100644
> > --- a/drivers/tee/optee/rpc.c
> > +++ b/drivers/tee/optee/rpc.c
> > @@ -51,6 +51,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)
> > }
> >
> > #if IS_ENABLED(CONFIG_I2C)
> > +#if !defined(CONFIG_I2C_MODULE) || defined(CONFIG_OPTEE_MODULE)
>
> Looks like
> #if IS_REACHABLE(CONFIG_I2C)
>
> should work here.
yep, much nicer. will do that instead.
>
> > static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
> > struct optee_msg_arg *arg)
> > {
> > @@ -140,6 +141,7 @@ static void handle_rpc_func_cmd_i2c_transfer(struct tee_context *ctx,
> > arg->ret = TEEC_ERROR_NOT_SUPPORTED;
> > }
> > #endif
> > +#endif
> >
> > static struct wq_entry *wq_entry_get(struct optee_wait_queue *wq, u32 key)
> > {
> >
>
>
> --
> ~Randy
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-31 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-31 15:23 [PATCH] drivers: optee: fix i2c build issue Jorge Ramirez-Ortiz
2020-08-31 15:49 ` Randy Dunlap
2020-08-31 16:04 ` Jorge Ramirez-Ortiz, Foundries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox