Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp135141pxb; Wed, 14 Apr 2021 11:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7MpB7pxfJn1l98l7HIyVxYdxfo82TUofAFH5+AZ5IvoCUrdHWBejGFanr5ezQhPQFeMfX X-Received: by 2002:a17:902:c411:b029:e9:3d37:afc with SMTP id k17-20020a170902c411b02900e93d370afcmr40231466plk.17.1618423909204; Wed, 14 Apr 2021 11:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618423909; cv=none; d=google.com; s=arc-20160816; b=rSmV48YAmN3ij5aBdncrxs3XPXNNcMhcu7SySCwtTjTBvY27Kx6NNRlHDAfWssQgtz 4hx3wlSKrI+WbfHPGWY0903Qze4o6ix7f3hcK+7i7Bl/40TqCnpr4bdd2bwYq62W52Yh CrfGZfQHWwC3YzQtkBNf1v8fsapOSIFyQiFu5qwoX9suKXWeSVorrwU0NDjfwhXPjt4P J+s7UEwnXCd/cwgh5MmBeU3tX9MTj5C2qEewaQfQ3wTCQGJ6h3PiKamJ3iPRaP0lO/TL spcbNZ44+/129PXVTkK9r/oJnqgK61yMhAQFj0qo+UHYFg0yb/hW6DF/tRO4QAg1jH2Y eN3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5QyqH9wgwqkw+Tim/5reZH7esCeUL17nNuqOsrcEi/8=; b=mvarYnkXff1fy1vzuO8bAfqKeRtz1XXxLirJZngAIrDoAjmmB/sPZxPPmCmaiAuX5r LNYk8QhE6nF47fEFSjXwtCBf/JReMh+P+HROJQEW5LBkEKHjMRaEydS4iFwj8AUbE1N3 F+Chky4lIiKl9CUi03xDq5v3vlA4DUsLrkjR3ojL5rPXnrDPVlI2KwP+R6VJtpSGBvJO 1AKHPQb9NwUaJ6n+bYEmLCTPRzp/+3zCQl4r8yqM0mVZPPwpjiPO4jfc7kZNgZ6UZKK9 gHY5jW9+19dwA8FvfgMb3iBihU0Dn40b9OYISmDxXVqVZjJovSBdoL+B7yswMTDvFvsK O5sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lGOxeERQ; 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 l2si331370plt.291.2021.04.14.11.11.30; Wed, 14 Apr 2021 11:11:49 -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=lGOxeERQ; 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 S1352823AbhDNQrl (ORCPT + 99 others); Wed, 14 Apr 2021 12:47:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352817AbhDNQrc (ORCPT ); Wed, 14 Apr 2021 12:47:32 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97BDBC06175F for ; Wed, 14 Apr 2021 09:46:57 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id h19-20020a9d64130000b02902875a567768so8931882otl.0 for ; Wed, 14 Apr 2021 09:46:57 -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=5QyqH9wgwqkw+Tim/5reZH7esCeUL17nNuqOsrcEi/8=; b=lGOxeERQw55ADBZgd0OCtT8SNdwtjcdWCKEUxYbZaKzkP4Mr+URPnctooW80uujOnV Wqs0E9H/Ez6M87Y2+B0oHoElSHuu6R3yaGtrNBqmcQjuS3S0z404d8hMNDWyWGMb+YaF Jtx64JCJ/ns+b3d70x+UVo72Y8+qxvM0ZH/hzgzt81xAl/OzYJX5IfMDxBXDzjeH+zBc YQEfkj1fRvTKzJ4SGb2Hys+df3j2N/sJ+/OUaPhkxFbUp1AA1rQI/HyhNBF/Qx0sD8Wf gdJ8sGdUD6tXOst71T0YyaTCPrapDVyQY/V9mIk+KoYDldSW3YZSWyrUCREKbJGvGNuh NojQ== 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=5QyqH9wgwqkw+Tim/5reZH7esCeUL17nNuqOsrcEi/8=; b=lrvWkasuExdMWhW+yifTxX1Kul4i4Ym2sMBe6mbSMSKwJyH5xn31neTf31DXSUmRYJ LkEBprqS+vTaPVszTXbS/oQtPVkdPmpU7wnZBK0mHG1TUN22QbWEEniYPnERKdfi6PJ5 86k+gUwG10uo+P+GEkbqyvvvNlj8aP5/IXHep3mhHDJbfUSLiLBsN8/i4oiaiJi+lImD KIyNDDULYoThKtU1pQKC07cwvlOO6LeKjwpop+tewaT0uWTAT+x0KQoNDev7/EFWinrl MgGnQsRiOxG9bFZ884X95i96rqwPa/0m3uszjLFUK5ks1X22q6vScOXEzmFaQz8yyj01 XXWg== X-Gm-Message-State: AOAM530mcA4JW+gNLMZtim4ZlDhlsFsLBhRGt2VAt01YYO+PAdGU3ght FeS1Ro9kMvEr13oNM3sMDs8igOeDN4++ZyBrlQ9WQA== X-Received: by 2002:a9d:e87:: with SMTP id 7mr26932570otj.324.1618418816911; Wed, 14 Apr 2021 09:46:56 -0700 (PDT) MIME-Version: 1.0 References: <3150feb19421ca6b15202c853215f8b40fe35567.1617615067.git.Rijo-john.Thomas@amd.com> <1318f015-40cb-2bdd-17fb-2a3843ed45bc@amd.com> In-Reply-To: <1318f015-40cb-2bdd-17fb-2a3843ed45bc@amd.com> From: Jens Wiklander Date: Wed, 14 Apr 2021 18:46:46 +0200 Message-ID: Subject: Re: [PATCH v2] tee: amdtee: unload TA only when its refcount becomes 0 To: Rijo Thomas Cc: Dan Carpenter , Devaraj Rangasamy , Mythri Pandeshwara krishna , OP-TEE TrustedFirmware , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiro, On Mon, Apr 12, 2021 at 12:20 PM Rijo Thomas wrote: > > > > On 12/04/21 1:06 pm, Jens Wiklander wrote: > > On Mon, Apr 5, 2021 at 11:43 AM Rijo Thomas wrote: > >> > >> Same Trusted Application (TA) can be loaded in multiple TEE contexts. > >> > >> If it is a single instance TA, the TA should not get unloaded from AMD > >> Secure Processor, while it is still in use in another TEE context. > >> > >> Therefore reference count TA and unload it when the count becomes zero. > >> > >> Fixes: 757cc3e9ff1d ("tee: add AMD-TEE driver") > >> Reviewed-by: Devaraj Rangasamy > >> Signed-off-by: Rijo Thomas > >> --- > >> v2: > >> * Unload TA if get_ta_refcount() fails > >> > >> drivers/tee/amdtee/amdtee_private.h | 13 ++++ > >> drivers/tee/amdtee/call.c | 94 ++++++++++++++++++++++++++--- > >> drivers/tee/amdtee/core.c | 15 +++-- > >> 3 files changed, 106 insertions(+), 16 deletions(-) > > > > Looks good to me. Please address Dan's comment. > > > > Hi Jens, > > I have replied to Dan's comment. > > If you are okay with the current patch, request you to pull this. By addressing the comment I meant fixing it not just replying that you're going to ignore it. :-) I can't see any reason why the preferred style shouldn't be used. Cheers, Jens