Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6073217yba; Thu, 11 Apr 2019 11:28:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDvS5N44S43nd1MDXUNm/YBBsOezeIReuG4SrZmFi3kjJWSxAtlHLZda3lX1zx69Xqf+oZ X-Received: by 2002:a17:902:2c01:: with SMTP id m1mr42020148plb.186.1555007339058; Thu, 11 Apr 2019 11:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555007339; cv=none; d=google.com; s=arc-20160816; b=Zqpxjwh0IbejvoxR0QGANPAFpVe0QrsKWKtAbjB1IN0lO2lPfatK/XN+GT1Wwt2u9L bF6EwYMT/r4fvaFkBRoGBT/iQYwwS7YWGO5i3K+pEIILiIgyBABhMDV5HmmXmVUrHjG5 8FXwYnDW5+JI0/dW4OR3t37xUNaGH4xCgJuurBMLGpGSeesyiqn/LV1c19DuTmSN3P2m 6gxpIcQ3dK9lDlLHgYUKKrpU/4QdB62hvFXHoNLzr4IdlK0MtoMSuhj8jaZsGU0nTNQ9 djNtJTw9ohshbxbVB9WcwZ4YiHXMle85JZljIa6dBkVbB1oJUU47HXVEPEgRTJA3IRa8 3AHQ== 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; bh=Z8CBb03xWfXRRhEzYydKW2qvo6QySeiEHJZzTeVpG34=; b=whvR8d0WpG0cXdcogj5qOrVxjqZsdavER6BGu1HEd9zYy5oOf4/pt1HxUri4UG0oDU zxR9M+8u0zrng+cGDa5JA6q1iLTZJxnVpfpHkkgwre5EHV5TqoYs9nrSU64x4sTvWviQ qnCmBKnQ4L9jYw3s8MDnKnHYin6bnxzK2cCbroyWtwX5zcgCoQoKVhG5JxQts3TWvZx3 T7UBv+UvcmaqRPaE2lCsnZ+cEUBcY0Yy16qGfnM787pVb5RJJOowwWI3R/8R1DF9tvcQ +8dR/6vFy0jNNJTpI/KEloB3bHskn3SoLEj+aoV6S5WKdvT1NZAln122+oUhfuYTczxp g7Fg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si33276252pgp.161.2019.04.11.11.28.41; Thu, 11 Apr 2019 11:28:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbfDKS0l (ORCPT + 99 others); Thu, 11 Apr 2019 14:26:41 -0400 Received: from emh01.mail.saunalahti.fi ([62.142.5.107]:42124 "EHLO emh01.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbfDKS0k (ORCPT ); Thu, 11 Apr 2019 14:26:40 -0400 Received: from darkstar.musicnaut.iki.fi (85-76-0-112-nat.elisa-mobile.fi [85.76.0.112]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id BA88B20049; Thu, 11 Apr 2019 21:26:37 +0300 (EEST) Date: Thu, 11 Apr 2019 21:26:37 +0300 From: Aaro Koskinen To: Sudeep Holla Cc: "Koskinen, Aaro (Nokia - FI/Espoo)" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Florian Fainelli , Michal Simek , Mark Rutland , Lorenzo Pieralisi Subject: Re: [RESEND][PATCH v2] firmware/psci: add support for SYSTEM_RESET2 Message-ID: <20190411182637.GC16745@darkstar.musicnaut.iki.fi> References: <20190411103346.22462-1-sudeep.holla@arm.com> <20190411164936.GB5327@e107155-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190411164936.GB5327@e107155-lin> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Apr 11, 2019 at 05:49:36PM +0100, Sudeep Holla wrote: > On Thu, Apr 11, 2019 at 11:42:28AM +0000, Koskinen, Aaro (Nokia - FI/Espoo) wrote: > > From: Sudeep Holla [sudeep.holla@arm.com]: > > > static void psci_sys_reset(enum reboot_mode reboot_mode, const char *cmd) > > > { > > > + if ((reboot_mode == REBOOT_WARM || reboot_mode == REBOOT_SOFT) && > > > > I would omit the REBOOT_SOFT here. > > I included REBOOT_SOFT for 2 reasons: > 1. drivers/firmware/efi/reboot.c - efi_reboot treats WARM and SOFT reboots same > 2. If the vendors specific reboots are added and handled in EFI, I assume it > will be categorised under REBOOT_SOFT. > > If that's wrong I can drop REBOOT_SOFT. Not a big issue, but it's just unclear what SOFT means. WARM at least maps nicely to the PSCI spec. > > > + psci_system_reset2_supported) > > > + /* > > > + * reset_type[31] = 0 (architectural) > > > + * reset_type[30:0] = 0 (SYSTEM_WARM_RESET) > > > + * cookie = 0 (ignored by the implementation) > > > + */ > > > + invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), 0, 0, 0); > > > + > > > invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); > > > > Use else here, so that we fall back to system halt if SYSTEM_RESET2 fails. > > Will that not change current behaviour ? IOW, is that expected behaviour ? > I am not sure if halt can be prefer over cold reboot in absence of warm/soft > reboot when the system is request to reboot. From PSCI perspective, since > SYSTEM_RESET is mandatory I prefer that unless Linux has any restriction > on this behaviour. Hmm, so does it mean that even if firmware tells that SYSTEM_RESET2 is implemented it does not imply that SYSTEM_WARM_RESET is available? I.e. the firmware could choose to implement only some vendor-specific resets but not architectural ones. In that case, could we fall back to cold reset only if NOT_SUPPORTED is returned? My point is that if the warm reset fails unexpectedly, we should halt the system like we do if the cold reset fails. A.