Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3029057pxb; Sun, 31 Jan 2021 01:53:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzo7YxoyKLagRPjjmmH5f40H/AfnGX3fR/k+KUD/P5eC1deHv+0KyRPgw03qiIjKbf4Xv9J X-Received: by 2002:a05:6402:2d2:: with SMTP id b18mr13599376edx.228.1612086792675; Sun, 31 Jan 2021 01:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612086792; cv=none; d=google.com; s=arc-20160816; b=tjuvZfKHTbqHDWt7aAi2naQ2v7iSWGxxg2WChcBQF82SIMregpMxK4gPNNe+TxGaYj X473TdEDEqRNtC8pmamvRxS8FBFysONWlMAGgVkvL2ALnNqcD3vJO7ITdbNye7ziVF9i kTbT8U9DZ2fO5tEF/Ss9aDbGS3XFwqlWad7fK6LV9VwdDadAyRQHX1BES2+FzCubKz4H PTSJ43WgU6qEaBB+dWtew9cQEHkAkpIdX3754V6q5jmGuKR61muG7s1c7clpYHLOPKh9 t89X4D4XI0UwJUUugZaByUjALVEhlTjAvkz4wHOQ+fYdf4xCxhQjU91L2kWcLHFUpsIA WF0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QBQqKprrtd9qTQlLqAHM+x4yLobSbXoG+7Z/o1vyCGs=; b=m+L6k2dFym18dMRe1041GayPEFxljVL75zci5BbP2jT0igUtCHDJvLlQZx1kDy74mR 5JanrwWJBV0hJOzSBr5kZSrcwo73gN6wb9tibCCwWOePFA758tMNzkVbaC4zrOl+g6Oq OanTqnyTzRDUen2ovjuStTI49U9nPjTO6etYgFcxUIwjdwdaxGKkrMJ9mkvCfS+zhyTR 5FpIEiwSOq/nHB0ckHO9oRoTqgddC1A8a1ZXaj7/EpUuaZdl+4I3pgSQ4RQKAS42xTjP zb4J4ByL7EGmWAo8/F6m3ERPw9KxPAK1WlZI6UkwBKxK4KK9CSnAPtTWFQf2ECdmMAOo yg1g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si1312658eje.252.2021.01.31.01.52.06; Sun, 31 Jan 2021 01:53:12 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbhAaISN (ORCPT + 99 others); Sun, 31 Jan 2021 03:18:13 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:43443 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhAaIRO (ORCPT ); Sun, 31 Jan 2021 03:17:14 -0500 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1l67rh-0005up-Mh; Sun, 31 Jan 2021 09:13:49 +0100 Subject: Re: [PATCH] tee: optee: remove need_resched() before cond_resched() To: Jens Wiklander , Sumit Garg Cc: Arnd Bergmann , op-tee@lists.trustedfirmware.org, Linux Kernel Mailing List References: <20210125095445.1524477-1-jens.wiklander@linaro.org> <0100017738faac80-87e5cf40-6a5a-4727-9c36-382fb909c8ff-000000@email.amazonses.com> From: Rouven Czerwinski Message-ID: <42ff3eaa-d561-93ae-b5c4-28b675bdea4f@pengutronix.de> Date: Sun, 31 Jan 2021 09:13:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: r.czerwinski@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jens, On 29.01.21 14:29, Jens Wiklander wrote: > Hi Rouven and Sumit, > > On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE > wrote: >> >> Hi Rouven and Sumit, >> >> On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander >> wrote: >>> >>> Testing need_resched() before cond_resched() is not needed as an >>> equivalent test is done internally in cond_resched(). So drop the >>> need_resched() test. >>> >>> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched") >>> Signed-off-by: Jens Wiklander >>> --- >>> drivers/tee/optee/call.c | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> Can you please test to see that this works in your setups too? > > Does this work for you? I'd like to get this patch ready for v5.12. Yes it does. I also looked at it right after Arnds mail, so for future reference: cond_resched() _cond_resched() (ifndef CONFIG_PREEMPTION) should_resched(0) tif_need_resched() (+ preempt_count == 0 for current thread) while: need_resched() tif_need_resched() You can add my Reviewed-by: Rouven Czerwinski I also retested on the STM32-DK2 and the problem remains fixed: Tested-by: Rouven Czerwinski Regrads and thanks for the patch, Rouven