Message ID | 20231030155901.80673-1-sumit.garg@linaro.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2318936vqb; Mon, 30 Oct 2023 08:59:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/F86xkAXiqt74RUqol7Py4E6VhiA2HZ3Qnok+scFmN/axadH137z0Ty5NeTYHGX+stPH1 X-Received: by 2002:a05:6a20:914a:b0:13f:9cee:ff42 with SMTP id x10-20020a056a20914a00b0013f9ceeff42mr12946855pzc.41.1698681595929; Mon, 30 Oct 2023 08:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698681595; cv=none; d=google.com; s=arc-20160816; b=0JqyaxGX60uMyUs+EWAM1tg/LpElVrLcqviqPE485K+tGeXgey+eA6vpD6oWLLK7tK EnM40WtNc8ZbSoSICjF/6zDH+lRKRCfOLmidid5g1RlY0UtYm2M4LqWOvX2jV2ljG4Mx BcKjTKi84tPB3fItffCDFqlNIA+LzHzOBfjTbL38dQUaGmav64DEEKXIBfDtGZTH4Thj 5ovR7v0So9GG+KiI+n+FTsOGZqQAe1u/qlvdFu6503wrS+xlatCyk4u0gjeRCj5gIk3g lg07hWmU1j2cv5/szk/tzF1PbMGqcbKlcWYotriXA9GQdFCMl3/o/3tE7UArgGXhCxBy +DNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wX1AJg/7WQTyp4dl4Ewe3drkgowrgy6jLa6X6sDxKqU=; fh=kek5XU/v1RmPJHz1V6icIjoJC+ErwsKZ1swtKUy8acg=; b=fmFIDElv5exM1NNVOqlQ1XHHPEbTzS5w5iKef70OsfelAHJLOoQzk/vn3+D2+Uaa/j XyM10ipjcV++GHlWXPwb2TTgIrM2cD0uKbzzgGauwxwwlXuh9yn1oio8yDWjbMVzS/Ni BwRWiVc3Wua9ea9CS7Ujxi0DgagYeGk/4mCeAc6P8+Lmb9xTzBqDZqBVwra9iN9PGOJC Ub333HhdhdcvWbJdSSUI1KM/wMRX7CeSAYMMv/JvXa+oPUmiODE1fWFe7dn/QqlJH1eD 3FPoVc/Ras6bCWMz6AcVo2EyWS9u0p8H1KjgukDHcFISd5pHd3rIrX9vAn2ElGw7tOtb WTCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h9s18Suj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z6-20020a637e06000000b005acb92781fbsi3254874pgc.415.2023.10.30.08.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:59:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h9s18Suj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F37E680AD13F; Mon, 30 Oct 2023 08:59:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233775AbjJ3P7Y (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 32 others); Mon, 30 Oct 2023 11:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233770AbjJ3P7U (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Oct 2023 11:59:20 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E908DA for <linux-kernel@vger.kernel.org>; Mon, 30 Oct 2023 08:59:18 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6c115026985so1095054b3a.1 for <linux-kernel@vger.kernel.org>; Mon, 30 Oct 2023 08:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698681557; x=1699286357; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wX1AJg/7WQTyp4dl4Ewe3drkgowrgy6jLa6X6sDxKqU=; b=h9s18Suj46VVSHdpoOJqzi/5MIckvn43zLcCGl6kATBemuwaKOmFLLNFrxAiprsAqW fSPRKx9xLuhaoHIcwvGsYE8Ypx5I1RtszsjgW2BdDo4gAKB08nOS+XQLeXWFhtu0Gkp0 06rlp9+7sFV1gpfBBIjduOiRe5s9Fcnojxp9OIu9vvrSyLVSKBSFukHj0QAG3693HTxx PRHFGdzan20mTQautqo7tsvVu+qioSBU4PLB7q6HpA26UUEMT2pvWr552Ib4G+DrGhcd vRCxuvoHcs2BvZMCxFxUEas7VSNDaXApEmUEGPVIfdEr+sVpDhTUxCUl/RBo72UdDwSb PAQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698681557; x=1699286357; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wX1AJg/7WQTyp4dl4Ewe3drkgowrgy6jLa6X6sDxKqU=; b=ELPUsKUATuwdc42iSIHjUoK0jsKeHaZHdcXDQDfF+Vhe+kqlDnJKp7efdjr4DNp3XF 6qEiTPADuDbBTW/ch5f1FbjFb739vZcUcHjeIStGcVLQALr6jcfVOeKhWSBzwE/c6VgL eUDRROCO8oTN5olCedAabpoovojKNut+wGvS+VrBlINSL+3g6ecQ/QVKmqzWPajXBH6Z Nhl0+zxJNbxCixX5QLphkIzKY8PofB9RvwiE8oBmMHApms13Fv+3MotJrjhpEa51RUI/ /VmYQjWgfAa83BCl19pfdv/3PWRDruqh100pcW6o1ynHBb1K1JAz4cNXL3SFAicwaQ1R cxbA== X-Gm-Message-State: AOJu0YzQq5ONmy9Ewn1NUFqYH7pr6Xu5/pD/rM2/t/uAzKsv43CiYRTE e7zh0pIy8cHJ3Pg29AmHhbTgVw== X-Received: by 2002:a05:6a00:814:b0:6bb:aaf:d7db with SMTP id m20-20020a056a00081400b006bb0aafd7dbmr13941747pfk.29.1698681557500; Mon, 30 Oct 2023 08:59:17 -0700 (PDT) Received: from sumit-X1.. ([223.178.210.245]) by smtp.gmail.com with ESMTPSA id z8-20020a056a00240800b006c148c6767bsm176632pfh.218.2023.10.30.08.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:59:17 -0700 (PDT) From: Sumit Garg <sumit.garg@linaro.org> To: jens.wiklander@linaro.org, op-tee@lists.trustedfirmware.org Cc: jan.kiszka@siemens.com, arnd@linaro.org, ardb@kernel.org, jerome.forissier@linaro.org, ilias.apalodimas@linaro.org, masahisa.kojima@linaro.org, maxim.uvarov@linaro.org, jarkko.sakkinen@linux.intel.com, linux-kernel@vger.kernel.org, diogo.ivo@siemens.com, Sumit Garg <sumit.garg@linaro.org> Subject: [PATCH v3 0/2] tee: optee: Fixes for supplicant dependent enumeration Date: Mon, 30 Oct 2023 21:28:59 +0530 Message-Id: <20231030155901.80673-1-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 30 Oct 2023 08:59:54 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781196753332302969 X-GMAIL-MSGID: 1781196753332302969 |
Series |
tee: optee: Fixes for supplicant dependent enumeration
|
|
Message
Sumit Garg
Oct. 30, 2023, 3:58 p.m. UTC
Currently supplicant dependent optee device enumeration only registers devices whenever tee-supplicant is invoked for the first time. But it forgets to remove devices when tee-supplicant daemon stops running and closes its context gracefully. This leads to following error for fTPM driver during reboot/shutdown: [ 73.466791] tpm tpm0: ftpm_tee_tpm_op_send: SUBMIT_COMMAND invoke error: 0xffff3024 Fix this by separating supplicant dependent devices so that the user-space service can detach supplicant devices before closing the supplicant. While at it use the global system workqueue for OP-TEE bus scanning work rather than our own custom one. Changes in v3: - Split patch into 2 separate ones, one for supplicant fix and other for the workqueue. Changes in v2: - Use device names to separate out tee-supplicant dependent devices via this patch. - Since user-space service is aware about tee-supplicant lifespan, so allow the user-space service to unbind tee-supplicant dependent devices before killing the supplicant. Following command has to be added to the tee-supplicant service file. $ for dev in /sys/bus/tee/devices/*; do if [[ "$dev" == *"optee-ta-supp-"* ]]; \ then echo $(basename "$dev") > $dev/driver/unbind; fi done Sumit Garg (2): tee: optee: Fix supplicant based device enumeration tee: optee: Remove redundant custom workqueue drivers/tee/optee/core.c | 13 ++----------- drivers/tee/optee/device.c | 13 ++++++++++--- drivers/tee/optee/optee_private.h | 2 -- 3 files changed, 12 insertions(+), 16 deletions(-)