Received: by 10.223.185.116 with SMTP id b49csp2341430wrg; Mon, 5 Mar 2018 00:48:38 -0800 (PST) X-Google-Smtp-Source: AG47ELvXfPSN+evaZMpFFUoDgdU6U0XL+9KVSCKhpuD6kiqy2h+BqYo1HSaJdErM283CCRmMuffy X-Received: by 2002:a17:902:9306:: with SMTP id bc6-v6mr2301382plb.133.1520239717924; Mon, 05 Mar 2018 00:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520239717; cv=none; d=google.com; s=arc-20160816; b=i5X7KT7gq/ZC3YaVvTE2T7aL+TE2DQKj40PFditg65xdC08DmgSc9WiyPsUUXwnpX4 yIBgoBSBSM2pc2vGmf0J4tf+Twyvk0PNyHZdGj86BUvCoXUMBtWE0T8oi5OKTw/ZrUDx 0sNWIlUKN+R7NDPIDevftpXzCXoLUtdoZvJIzi0n1cR9ow+NvM9UqI7YS9hr8xSY1ezl pl8DWeuxmxc9pc2t8kh6ZofkgecLxmBMKZxBHVDqvZdfNPlVX+75/x70VivvgKz/t0qp eqDzY4Og2VX0fHN5nPK/QJQnBGohBAcS47ZOu9jzUbqvia7df8GlMZgOkITQFsUjwEnz Qy3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=NS/YAGbBk+J1MzrjflWnNau3W4nPoaQeN7ZoN4q03N4=; b=xQSDFP8AMAv+E8S1Uh7I5DYZ9LleS5U3PfRTBHsR6NBnsyqarXlfla2O6ryUiNxpds wT3x7eRa+4C5H8QqHZ+9IjYL0PA0xsi/tUwdzyAmw34Xe17QPFXVJO9MZnqpO9AL5lFE 16ULkbbwyggcCK18kKICZt1LiHobn1JDXz6uXbht06wRzJlf6MblyeNUBPNj7z09XBBp eXd+SlEsEyL5f4C4+BGgmb7ckegj3/BLphYJcPogm+zfmksBilQ+UojL03sWtkPbFtgf MjYOFtSWinJgADlhy30dV3ayHy6vDo7gp5/7DhddXEVGAgR8+UxR2G4kA9kfSTqh8rhB wUXw== 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 v22si8085917pgc.724.2018.03.05.00.48.23; Mon, 05 Mar 2018 00:48:37 -0800 (PST) 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 S933509AbeCEIbS (ORCPT + 99 others); Mon, 5 Mar 2018 03:31:18 -0500 Received: from mail.bootlin.com ([62.4.15.54]:48067 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932600AbeCEIbR (ORCPT ); Mon, 5 Mar 2018 03:31:17 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 24A22207EF; Mon, 5 Mar 2018 09:31:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id C8A15207D4; Mon, 5 Mar 2018 09:31:13 +0100 (CET) Date: Mon, 5 Mar 2018 09:31:14 +0100 From: Maxime Ripard To: =?utf-8?Q?Myl=C3=A8ne?= Josserand Cc: Chen-Yu Tsai , Russell King , Rob Herring , Mark Rutland , devicetree , linux-arm-kernel , linux-kernel , LABBE Corentin , Thomas Petazzoni , quentin.schulz@bootlin.com Subject: Re: [PATCH v4 10/10] ARM: sunxi: smp: Add initialization of CNTVOFF Message-ID: <20180305083114.dwqfdqlziwptfnxq@flea.lan> References: <20180223133742.26044-1-mylene.josserand@bootlin.com> <20180223133742.26044-11-mylene.josserand@bootlin.com> <20180226101252.ozdsxjvawgkemz2c@flea.lan> <20180305085148.1de2a99c@dell-desktop.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="grzg6bvngnjss7hr" Content-Disposition: inline In-Reply-To: <20180305085148.1de2a99c@dell-desktop.home> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --grzg6bvngnjss7hr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 05, 2018 at 08:51:48AM +0100, Myl=E8ne Josserand wrote: > > >> > diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sun= xi.c > > >> > index 5e9602ce1573..4bb041492b54 100644 > > >> > --- a/arch/arm/mach-sunxi/sunxi.c > > >> > +++ b/arch/arm/mach-sunxi/sunxi.c > > >> > @@ -37,8 +37,12 @@ static const char * const sun6i_board_dt_compat= [] =3D { > > >> > }; > > >> > > > >> > extern void __init sun6i_reset_init(void); > > >> > +extern void sunxi_init_cntvoff(void); > > >> > + > > >> > static void __init sun6i_timer_init(void) > > >> > { > > >> > + sunxi_init_cntvoff(); =20 > > >> > > >> You should check the enable-method to see if PSCI is set or not, > > >> as an indicator whether the kernel is booted secure or non-secure. = =20 > > > > > > It's an indicator, but it's not really a perfect one. You could very > > > well have your kernel booted in non-secure, without PSCI. Or even with > > > PSCI, but without the SMP ops. > > > > > > We have a quite big number of these cases already, where, depending on > > > the configuration, we might not have access to the device we write to, > > > the number of hacks to just enable that device for non-secure is a > > > good example of that. =20 > >=20 > > I wouldn't consider them hacks though. The hardware gives the option > > to have control of many devices delegated solely to secure-only, or > > secure/non-secure. Our present model is to support everything we can > > in Linux directly, instead of through some firmware interface to a > > non-existent firmware. >=20 > I am not sure to understand what is the conclusion about it. > Should I use "psci"/enable-method or should I use another mechanism to > detect we are in secure/non-secure (if it exists)? >=20 > Otherwise, for the moment, I can use machine-compatible on sun8i-a83t > and we will see later how we can handle it in a better way. Can't we have another approach here? If we use an enable-method (and we should), instead of having it tied to the machine compatible, the SMP setup code will run only if our enable-method is the one we set up. If PSCI is in use, the enable-method is not going to be the one defined here, and the code will not run. So why not just move that call to the SMP ops setup function, just like renesas does? Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --grzg6bvngnjss7hr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlqdAFEACgkQ0rTAlCFN r3RdQA/9HU5Ba4g4v3e6RNYQp8EwnNGgQGQ0kGSYKJA41r5llcY7d7Cr3dvU9B59 YV0DDswSVkpBFefkmO+KIYMmbphnue+vtPGOt5wU+zu3iDQFEc4O/4Bwb7Hs9SQz qHtGCV4ytDrBqrIZDAL3op6F5mOGbDr445NP4bnjZ9TWOIxpL0l37n9cYy1BW25/ ofFTHCUFeRC9m+dwp2zemt+Fe1XS0FX+YRNkPnfPsuZBlpwPrtz+oqgSk2d7qL70 g8T5xTHWJPj83dD63Hvz5hUsNvnPe7fcy5iFVKhj5b/QNNOLVsIyz6cBih09ZdyK oOFPW4ym257f3bVFrd6XVRhtVKo78I4tJiuonep/sPqqtcJAKWcsFi6woQWMqve0 edoEiOtCgbpL+SNKTuszw/KTvddw1/BGX6yW/ieCjkeldO/O7t/M4A1g0KaGeeVs OFweH3t76Hm6eCqxm1NsI7EyzLhUOvnA3m1h2azc1ndSnlR8vXvIWF3nA3tGKSbb DaDmJXpvBdgJLggQazA3eLYr3kSYdU+Lt4Ire328rXmz5OrIgkQgCXEqY0w6KB1s YoKPFLlZe2AfQisqOefJGgkhXChCef+NuGpfg/6bYMm1it7kgeHo55Z7fTcliFNB GAwZMTjO4JpYDUBVd4G2jNAzDYNNpNB/2ViOcbgICu8WhL9zR20= =ssrt -----END PGP SIGNATURE----- --grzg6bvngnjss7hr--