From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A2F3C433DB for ; Wed, 24 Feb 2021 08:17:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 327C964EDD for ; Wed, 24 Feb 2021 08:17:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 327C964EDD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Nt/lpZQWuLW1q6t0NrJUagysKbS/AwPColsT5GmGfYY=; b=IpX6j+1rT9cnWFoZPuutok3Zl uKfOFOqGavGHj3hRWXBm7+1aSljwNcaC9Fumqlip9N4dMwv+GhvYgxPLl7pzOZqeuX/NydWDKKjTe s5g5K8wWqaSEtvX8lQBxfamOKcF41iUlfA5dj9T3KoXrmp6Ee0mQlOazuFVA52y2g7ABB7acOAKol cbwGuodnnVF54m8qqcpGhN329O/FpEc15XS3BpgvcpsXUoJoZEOz+ovpGjLDU27ZbsbEnQRjGqIsB zoS3nNmiJz1yFTBjxaeFqa0WSQlae4gZbn+vYZhP6ZxQsXvRMxx9JhjfNe7WxNze/ddFYJRJK2sPG XKX5KGvQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEpKy-0003kC-3x; Wed, 24 Feb 2021 08:16:00 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEpKw-0003jZ-0z for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2021 08:15:58 +0000 Received: by mail-lf1-x132.google.com with SMTP id v30so1721658lfq.6 for ; Wed, 24 Feb 2021 00:15:57 -0800 (PST) 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=zgACkb1Gl2wYqG0IX7Bk5ltVRdUXsQvJfegYjpg1tZE=; b=u2YysyXZkhrGm+nkbp3dNTPKlj2GGxT9cW+rv/Buicw/cO1h6RLXqSOfZQdk8ReIy/ i0v9BFCu5O8v/MQvq6V0DKaLPa3lt7rWT3yBlnpvXUw797B3oiK7yt88SrG8fRSkIHXj 9SqHGaFl3reLD3jznmhj86LLdkmGpZxmVoVuJIuJiRi9KHVrSQaC/NWckup0MiQ7jriK G0KYBU1xHnczdcN0rJ6t2RJf3OAiCohpVp49ZWdzOEhZ05A5JesIKPPi0CBHokQscnCo W19xIYp4DIWx6eLTctD3RsfPU4bYgU/7yIfCaYyEeD/Apj+Ul3Oxtj6NEGuC29wmVDfl QrFw== 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=zgACkb1Gl2wYqG0IX7Bk5ltVRdUXsQvJfegYjpg1tZE=; b=eF3yTh7R0P1UjvZuL84NYGUYXj//QVcS/WJQ9e5qx9pDO71TM3qyc+I8Ckp556AYAD Kd5YFJF3ZuBKUajJOMLk7tOozoL1E0kRCLvFyjGVQ7JCmv1HjCC0EKBPRCkRgB39saEv yu22zQFNouWZ1PUsWoUvDQzQNbk8C25GYMrchssOdmEGLgA6Nu2v0ftCSWIDFC9oN5FN 8dXLCNPE51JEeuwamAce17AbgDcM52TFNNb0SVxISjasVHc3t/MLTbU+pRYOzar+rF9I Qpn7rEbCAQPB2l4r7m/NCROtvObOoEgBRcC1NI9PSDJML6Yw3fW041B/Vqf9o3GBRnNR 7L4Q== X-Gm-Message-State: AOAM530fnmiv2sPcS7cVU95CSPRiCnzuvd9KEaYuAnHVvh7NVjQN75JI j6YYGORPnI8a5syLulcbhD2jMQ== X-Google-Smtp-Source: ABdhPJy5IykOHiQfPHqwX4rQuxdhmVigyjK7qplhy3RE7lzn+5/voNL1wvbcmQezshUAMlH2iYqAQg== X-Received: by 2002:a05:6512:96e:: with SMTP id v14mr18111051lft.513.1614154555890; Wed, 24 Feb 2021 00:15:55 -0800 (PST) Received: from jade (h-249-223.A175.priv.bahnhof.se. [98.128.249.223]) by smtp.gmail.com with ESMTPSA id a4sm290291ljk.50.2021.02.24.00.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 00:15:55 -0800 (PST) Date: Wed, 24 Feb 2021 09:15:53 +0100 From: Jens Wiklander To: Allen Pais Subject: Re: [PATCH 1/2] optee: fix tee out of memory failure seen during kexec reboot Message-ID: <20210224081553.GB2653493@jade> References: <20210217092714.121297-2-allen.lkml@gmail.com> <20210217092714.121297-2-allen.lkml@gmail.com> <8d87655f-27c6-6a66-6eb0-9244279fbf2c@linux.microsoft.com> <20210223081948.GA1836717@jade> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210224_031558_139497_7CA1EA51 X-CRM114-Status: GOOD ( 22.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zajec5@gmail.com, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, op-tee@lists.trustedfirmware.org, bcm-kernel-feedback-list@broadcom.com, Dhananjay Phadke , allen.lkml@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 23, 2021 at 09:56:13PM +0530, Allen Pais wrote: > > > > > > > - /* > > > > > - * Ask OP-TEE to free all cached shared memory objects to decrease > > > > > - * reference counters and also avoid wild pointers in secure world > > > > > - * into the old shared memory range. > > > > > - */ > > > > > - optee_disable_shm_cache(optee); > > > > > + if (shutdown) { > > > > > + optee_disable_shm_cache(optee); > > > > > + } else { > > > > > + /* > > > > > + * Ask OP-TEE to free all cached shared memory > > > > > + * objects to decrease reference counters and > > > > > + * also avoid wild pointers in secure world > > > > > + * into the old shared memory range. > > > > > + */ > > > > > + optee_disable_shm_cache(optee); > > > > Calling optee_disable_shm_cache() in both if and else. It could be > > > > put in front of if(). > > > > > > > > > > Ideally, I could just use optee_remove for shutdown() too. > > > But it would not look good. Hence this approach. > > > > What is the problem with using optee_remove() for shutdown()? > > > > There is no problem, I just thought it would be more cleaner/readable > with this approach. If you'd like to keep it simple by just calling > optee_remove() for shutdown() too, I could quickly send out V2. In the patch you posted it looks like you'd like to call only optee_disable_shm_cache() in the case of shutdown. Like: static void optee_shutdown(struct platform_device *pdev) { optee_disable_shm_cache(platform_get_drvdata(pdev)); } and optee_remove() kept as it was before this patch. Cheers, Jens _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel