Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5200842ybi; Tue, 28 May 2019 09:06:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpdTKosjbWIXpQRWLzrvX6b0JseXAKOLpjvF1TLIknsExPC5csxc5Zc3bcm5uzOOVaQmNv X-Received: by 2002:a63:fb02:: with SMTP id o2mr132644362pgh.357.1559059615188; Tue, 28 May 2019 09:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559059615; cv=none; d=google.com; s=arc-20160816; b=VES4lVk7qVEvBbXuGUFZAkHck6gtyCxAPyGUFidpDA2I7qG5gos4SxvKTQ2Yd8Ypn6 c2fXsuUwLqQFo1JawK5OIzvLrdQDlWSwjv2urUN46MlSjeKa4qDD8UnrUnR8PWOqXPPz lTMzgu4HhijW8DDNE6fcNprbRLUnGcMty34XQsUnVroAR+UjkCzFTf8bZr0E0Plcb4RK WPXKt/7kzHMHeQhDa3Udq20AVlOdEwjq27Jg+7uTCFgv7wpbc3IVKxTYFDpWiEhhp8pE 2uIUiCqoFkJWjpqWNmYMcQXPSRkNbRsQFkay/20pwuRwjLBOlzEd1AuTtHmpupTKHrZ6 bhTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organisation:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ko+hmJRrYx0MQTXgZuE++FWIGxs11fv5Dw2uYr8hTtA=; b=pDthcU0VklWLnZ8YkPx8dHjOVBxdU3VqfP+sx1+vck/yO+wJ/LtvmAH0b2xUHYWTzt MgNGCoeBNRLOCcjk2+TD/j8ALX7dsTmylDfuhj20swOwmgf39vIyRRj/kxXF2JbRf26d WNXu4cJHBUEjEsglDj76oWGbk4qsB5n8xIxln3nPFXGH3AaGQ+JLpe23FdYJvq8LgQ0Y J/1bZTtEa0qZx7Whw6ycmbvJW3XKuq90u4mgcrlqYCTFzUUfS7KKSCDpMHfKXnKcLeTM wZDYOOrGct4o570JCcEFF62xtGNrcYeubMsKD5Vg17L8dA1xtO9C7eom2KKSAWCmVxTp wing== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si21481212pgb.262.2019.05.28.09.06.37; Tue, 28 May 2019 09:06:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbfE1QFN (ORCPT + 99 others); Tue, 28 May 2019 12:05:13 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:58882 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbfE1QFN (ORCPT ); Tue, 28 May 2019 12:05:13 -0400 Received: from penelope.horms.nl (ip4dab7138.direct-adsl.nl [77.171.113.56]) by kirsty.vergenet.net (Postfix) with ESMTPA id 6F41B25AD7D; Wed, 29 May 2019 02:05:11 +1000 (AEST) Received: by penelope.horms.nl (Postfix, from userid 7100) id 51FA5E212E7; Tue, 28 May 2019 18:05:09 +0200 (CEST) Date: Tue, 28 May 2019 18:05:09 +0200 From: Simon Horman To: Geert Uytterhoeven Cc: Oleksandr Tyshchenko , Linux-Renesas , Linux Kernel Mailing List , Julien Grall , Magnus Damm , Russell King , Oleksandr Tyshchenko Subject: Re: [PATCH V5] ARM: mach-shmobile: Don't init CNTVOFF/counter if PSCI is available Message-ID: <20190528160509.5vunuxxxcjduobpb@verge.net.au> References: <1558087093-22113-1-git-send-email-olekstysh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions BV User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 28, 2019 at 10:27:56AM +0200, Geert Uytterhoeven wrote: > Hi Oleksandr, > > On Fri, May 17, 2019 at 11:58 AM Oleksandr Tyshchenko > wrote: > > From: Oleksandr Tyshchenko > > > > If PSCI is available then most likely we are running on PSCI-enabled > > U-Boot which, we assume, has already taken care of resetting CNTVOFF > > and updating counter module before switching to non-secure mode > > and we don't need to. > > > > As the psci_smp_available() helper always returns false if CONFIG_SMP > > is disabled, it can't be used safely as an indicator of PSCI usage. > > For that reason, we check for the mandatory PSCI operation to be > > available. > > > > Please note, an extra check to prevent secure_cntvoff_init() from > > being called for secondary CPUs in headsmp-apmu.S is not needed, > > as SMP code for APMU based system is not executed if PSCI is in use. > > > > Signed-off-by: Oleksandr Tyshchenko > > > Changes in v5: > > - Check for psci_ops.cpu_on if CONFIG_ARM_PSCI_FW is defined > > Thanks for the update! > > Reviewed-by: Geert Uytterhoeven > > Two cosmetic comments below. I'll leave it to Simon to ignore them for > applying ;-) Oleksandr, could I trouble you to respin with the changes suggested by Geert? > > > @@ -62,6 +63,21 @@ void __init rcar_gen2_timer_init(void) > > { > > void __iomem *base; > > u32 freq; > > + bool need_update = true; > > Some people like reverse Xmas tree declaration order... > > > + > > + /* > > + * If PSCI is available then most likely we are running on PSCI-enabled > > + * U-Boot which, we assume, has already taken care of resetting CNTVOFF > > + * and updating counter module before switching to non-secure mode > > + * and we don't need to. > > + */ > > +#if defined(CONFIG_ARM_PSCI_FW) > > #ifdef CONFIG_ARM_PSCI_FW ? > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds >