Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp23126pxa; Thu, 20 Aug 2020 23:25:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNfbStgQfy+Ku4dE2fr4n6E5suxv2VZQbMQ5D/ienFe1A0V7jNs3tGqQ8oYsK77obebq2B X-Received: by 2002:aa7:cdd2:: with SMTP id h18mr1250764edw.387.1597991101849; Thu, 20 Aug 2020 23:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597991101; cv=none; d=google.com; s=arc-20160816; b=bbXz22hw7rC/qKDRkSCqlOgvfz8e89jglLXCGpIQGAASgDJA3/uT0vh2QK/f2eafZV PcjFh8gGFHqbLYFRQOH2FWDh5daX1CTIlFzIZX0gZuYMgJFNjvb7ILbLXUXqImcrfsOS Zct7dGxfIC5Hj2UTaoJ/bqCM5h20Qo7dv8VZTTQKNxJrqxuQt0oRtHPhBWZWe7ef2rSN oOE3ygR437qNtW2mploTs9X0ERsqgVdAwuiDMkaTUPGDtgmh+DmMADIOSon3yGOYzJ7t XemcXXzgJuCgGdw5fvJRCpF1KKkMuLZrYayIfVlkH1y8TThZ5Wux/tYwUSUJIveu/wnN jkvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L2GL4FMgc/dSMOohNfUAefXXfnpWIv3+pJWm+SgM0hU=; b=HFe9krBgRPRpbuBd+BZGD89v/hUyCtFCYCQDr1vMd62r0wAhKF9xWHItZPES5tEJLa cebM2UFZR6XM5mFv+arKvxuRWVqODuuEE29CPwe7wjqq7Xkg7DiTgumpqzhiACK2KfCl 3k7flxKTP1vcJVVJEl1Nuu039NSyMPygwLVcLNZp71EW5h3+s5avLaqYWjRX7HdDEjXr mfxuiW593Oq7p5fJBriFLY4pkv9t+q72uA6D0GBySfYul70lKnV7/mqoY8+sF/D7jlCz 8nsNMgJJDB38GG4I9SY4bdNEhC47UVnH7IR5k+WVKhL74I0IM6os6oL/amvWXh53Cqwy VJrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fMEkVuVN; 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 e12si545949ejd.148.2020.08.20.23.24.38; Thu, 20 Aug 2020 23:25:01 -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=fMEkVuVN; 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 S1726906AbgHUGV1 (ORCPT + 99 others); Fri, 21 Aug 2020 02:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgHUGVZ (ORCPT ); Fri, 21 Aug 2020 02:21:25 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E405C061385 for ; Thu, 20 Aug 2020 23:21:25 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id y2so653951ljc.1 for ; Thu, 20 Aug 2020 23:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=L2GL4FMgc/dSMOohNfUAefXXfnpWIv3+pJWm+SgM0hU=; b=fMEkVuVNPXsUdpLu94DxjsRcpHErma5pTjbfM2Oz93C7Pz1/rCR9Rc42NEGRQyGVA0 e5qt5B4wH2s62jAY1HDYneEuD3KzU2ZHOAH45kgG38hDDdQffHA/YkEJjHD5buGh8Ap5 TRuC6uKrwdPxOCyPy7fcvk04tcpWl2AH6lbYmS2qgRstct7jVHszm38L5YVTN+UvSj4Z VjY9UyQneg3fieaCszPy1wBx8QvdCYpySDQak5V2KNZDQDS/k657feOilzstvqvxWz9/ 86feiSl3+ky9mkMnNiki5ccwfdrHjsJ2/ZTq8wR3Y0Tu7Njmv30F7p7hKUwkVtPSMk9D eh3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=L2GL4FMgc/dSMOohNfUAefXXfnpWIv3+pJWm+SgM0hU=; b=KFca7MktPxJ5C3Y1ewtAEba3adA12I+PJxrNaUQvjXPzp1X05RvbMDfnA8HiyiAYCC +SKGe94NcjCvAJ0aaCXJgEieLFByqxuPo3RmPgrtJSsvnROmRNgfQhGZ4LE7PZxUCO8s O8xGVkArwqmyFlx6U6UjUu90iHo5pmHJbc5gn5RU24kab2qJitHqAzHkTgNAC6mDOla1 YJ6Kr2xHpGgs2HonetF+tT6jzJW2ECBApo5FDPeIwkYnC81v379FxluCU/HSb7zykvv4 bIyIy4whpc3k9/YTgBkG6YgV0OX/6QUrgAnSJWUJXvOAyMCTyHEtrjzYR4DHzq6rbiig hSMw== X-Gm-Message-State: AOAM5319ABMZjAbokqwEtbdegykyXlSPuMO06mrfkIDO7d8QFcGKEnL4 C1MVAv9t/cBSlqwka5uRivufVg== X-Received: by 2002:a2e:8157:: with SMTP id t23mr778218ljg.417.1597990883459; Thu, 20 Aug 2020 23:21:23 -0700 (PDT) Received: from jade (h-249-223.A175.priv.bahnhof.se. [98.128.249.223]) by smtp.gmail.com with ESMTPSA id a23sm175171ljp.121.2020.08.20.23.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 23:21:22 -0700 (PDT) Date: Fri, 21 Aug 2020 08:21:21 +0200 From: Jens Wiklander To: Jorge Ramirez-Ortiz Cc: sumit.garg@linaro.org, ricardo@foundries.io, mike@foundries.io, tee-dev@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv9] drivers: optee: allow op-tee to access devices on the i2c bus Message-ID: <20200821062121.GA1020247@jade> References: <20200814111221.5813-1-jorge@foundries.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200814111221.5813-1-jorge@foundries.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? Cheers, Jens