Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp125911pxa; Fri, 21 Aug 2020 03:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFXpgek474wQDNfVqry6/C3EasXN0TwIzlZunHNQlV0x4xXt/cZUBOguIu3FI2i8ZRbhGC X-Received: by 2002:aa7:d58b:: with SMTP id r11mr1952710edq.302.1598004350394; Fri, 21 Aug 2020 03:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598004350; cv=none; d=google.com; s=arc-20160816; b=XNapAXJLahYV9ZayyhGP1vAJvsFv6PHc+1T48f1KSDhv6jzvFn1qtAMHmrUvbBrxWV lxzWy3YAq87YS4AuPHEBZELOD50E83sHVyWpzmRDlL0QjiFhFWqiEFANywWzCeSr6tMq 74WEDC0Ox5IEcEVQbyaYy7G6RRSYVGEidLmiZoRJ3btSW8IPCRn0xJWTeCWAh1qYM16k 5H11eelVmJ5w1p/iFoVQhtq9Yc+Jlv5CUmtCP2RwUrQWj4pOlD8roMBtlbWPd867cOa/ J36ckuiDSz2YOnPdAEyXeNdLJGw+c7YyxB1rpbyGJZrt3ijJl1Gk3qzNb2rYc17MiU08 7gWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PzOnOH+BwzHErNBhtFUOMqnorNGKoQrz50xMPPMcSsw=; b=H7pLyfpa7sKqpyEZiqoCsiRjc38L1h5Hwxb7rqFw5vk22OZ/osRI69lrPue6Fum5np q5jfJsqHnkq+ruMsQU4nTvjJ99AVIQaXtfF+T+Fss06Z1u6aKrVPK0QuN0RbaXgI8hzF N3+b8Z5AeNF0wHDDH9RTIbqnNKWWsO8qXek9xg2u9MZfUeJs8pbEOHQ8YP1tV0vIQweI dzDMG8hv68cSWqp0Zsjg6zLmkO4xSrvAcF51AeQLrbZKSzaKLizS6HxkuSpBh9cx+IeR BdMBG8madgsMF37jigDVSGi66ltaB8kNDBH7vnyEkz6NzMw+avhbPhljVaPwp6u02n1F h3Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ck0zWUoa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h23si940080ejx.550.2020.08.21.03.05.26; Fri, 21 Aug 2020 03:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ck0zWUoa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728411AbgHUKEg (ORCPT + 99 others); Fri, 21 Aug 2020 06:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbgHUKEe (ORCPT ); Fri, 21 Aug 2020 06:04:34 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F4DC061385 for ; Fri, 21 Aug 2020 03:04:33 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id u24so1066262oic.7 for ; Fri, 21 Aug 2020 03:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PzOnOH+BwzHErNBhtFUOMqnorNGKoQrz50xMPPMcSsw=; b=ck0zWUoaOlJkW8mZ2Nq4AFoSPwnGvCphFy8dxOWofUw+Pt7wV5qATxkMEP0DcAFOE2 k/oUm/4pSgN5N6cQwX9FgA4H4gkLUB5bxXyCzZBYV9039vZfTWpItmp3dfP889zd5Xsn sA8rqjj89NCllixwZLkeEsYc/NVSuNzGpGgPf2+lB+AET0XsojtX9ZMUHFFG2VN3N6Mz GqNxYVzQoFOMEmDKOpB/C5Y4+rlCn+R83ftJ5J1rgYETqx82p/3H9DYK1Ndn4yGLsTWN SWzEVHYRxPjguJmL1XOGyhJRTT2CS7zkREqRnOllqxjDDR4WFaFoWph1hOY7SdnIB4Y7 wCFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PzOnOH+BwzHErNBhtFUOMqnorNGKoQrz50xMPPMcSsw=; b=fjlCOZvscF72lActb4Q0LXmLaNqKQFAH844ei2msSH3XIHr1rmxF+LoHUWtu2d4TVf Q8zvAQK42ImdchE5nYFtIyV+FEz8VxMxt615znIt2PwN6M8/oxpil/Im5Yyxd0vbp5JG nU5VJfVLvcYQpvvC1l9iKaD3ICv4CIVtF8aw2XG5OzO2Dv7I5TuHVvmLuPjKOGrcU8KM Gd8nvuwXqKV44z9AKCJ2M+9MENLBzU5CaK3eiL1xMWoqJnKfv/O4mFTGTTfRGuVlIv1F 1Kj1z81n3AAj23YNJQkJRzpbL63jRuVN16LtKDFUBaoVUGNOZsmkR/pIXUbUK4a6WVA3 w9Mg== X-Gm-Message-State: AOAM531vRK19m45mYibUZTLndWmNl+0Fq/oU1KKDkr43l2g1f/KfRdbD TgZ1Qbfp1jIYYpd94EJbpPPW5wHuFKoXgw8fKtgxxMXt5GE= X-Received: by 2002:aca:d8c5:: with SMTP id p188mr1166001oig.47.1598004273133; Fri, 21 Aug 2020 03:04:33 -0700 (PDT) MIME-Version: 1.0 References: <20200814111221.5813-1-jorge@foundries.io> <20200821062121.GA1020247@jade> <20200821063657.GA20356@trex> In-Reply-To: <20200821063657.GA20356@trex> From: Jens Wiklander Date: Fri, 21 Aug 2020 12:04:22 +0200 Message-ID: Subject: Re: [PATCHv9] drivers: optee: allow op-tee to access devices on the i2c bus To: "Jorge Ramirez-Ortiz, Foundries" Cc: Sumit Garg , ricardo@foundries.io, Michael Scott , "tee-dev @ lists . linaro . org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 8:37 AM Jorge Ramirez-Ortiz, Foundries wrote: > > On 21/08/20, Jens Wiklander wrote: > > On Fri, Aug 14, 2020 at 01:12:21PM +0200, Jorge Ramirez-Ortiz wrote: > > > Some secure elements like NXP's SE050 sit on I2C buses. For OP-TEE to > > > control this type of cryptographic devices it needs coordinated access > > > to the bus, so collisions and RUNTIME_PM dont get in the way. > > > > > > This trampoline driver allow OP-TEE to access them. > > > > > > Signed-off-by: Jorge Ramirez-Ortiz > > > --- > > > v9: params return value must be written before optee_msg_to_param is called > > > v8: review fixes: > > > fix types and add TEEC_ERROR_NOT_SUPPORTED to GP errors > > > v7: add support for ten bit i2c slave addressing > > > v6: compile out if CONFIG_I2C not enabled > > > v5: alphabetic order of includes > > > v4: remove unnecessary extra line in optee_msg.h > > > v3: use from/to msg param to support all types of memory > > > modify OPTEE_MSG_RPC_CMD_I2C_TRANSFER message id > > > > > > drivers/tee/optee/optee_msg.h | 21 +++++++ > > > drivers/tee/optee/optee_private.h | 1 + > > > drivers/tee/optee/rpc.c | 95 +++++++++++++++++++++++++++++++ > > > 3 files changed, 117 insertions(+) > > > > Looks good. Did you test this with the recently merged > > https://github.com/OP-TEE/optee_os/pull/4033 ? > > > > yes, I did retest and it is good. Good. I'm picking this up. Thanks, Jens