Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp493289lqt; Fri, 19 Apr 2024 01:54:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcq/jky9o8U/pxGx/wC1B0WmFEXrhMt+LBlIMVkSRYI/LuFT1RY60cD8qpiwV0kOpsn1Ua0H9OZoMZwMVaDGFes2jvHPv8EXsqgPnjUQ== X-Google-Smtp-Source: AGHT+IGpFPP9ryfsI9MHtBfyyZ/i/Rn2KJyHpPG0/9v5HJnBdETOf4S9zjUHxRF4IMcDsgRia58v X-Received: by 2002:a17:906:7f0c:b0:a52:1e58:4e0f with SMTP id d12-20020a1709067f0c00b00a521e584e0fmr882624ejr.55.1713516844405; Fri, 19 Apr 2024 01:54:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713516844; cv=pass; d=google.com; s=arc-20160816; b=fx+vQ5CVdf9GNUZgLlhpykVJjn2G0lRhrZgrV5aSVvTobyo0pWQXeHoUxctnJWxD0N IEku16u+7KRMJbNVtv9mkbYwScW+GNDxeg6r4FYuP59z8tHQWL1VprgQ/0Ps9Cbs4Q3w yjIQfLOlHQNCup137HpEGOG8qJXEqXZ26483yrYKuPn7BUtdzrNh+yHbpyhMdGYZh6Vp TwtK+LKaZBozD00tNOTOQns0A9eXTkj1Lp5Oolnq9Dcw5k+SfIxwCuk8eTNzb5avgA9D OZ626qk5DzcxS6I4XLrk6vHLur7xAuQwbDbZ8GejTYbqHcQY8r4iDOsfFz3Uys6qGNO0 /WTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=VOxDffeIACStAxNNRfNxvKlF07yDCfPqMJAKBNloqeQ=; fh=25Y0o8WI5LZ/5SACqZzE1twcZEDOaJBC0XjiUUkuY5o=; b=HpNtTd+nsXOC8aBcTnxCYU/hJUBdwngxsoEgr298xP2buFMYzRvtgr6wKFzQ74Hd6e PFuUa/vV0Yi0/cYS3xB3fECaoNH/hqBUtKkZJv7tOaRUr/hQKL0lVvkAkFiY2pFaMsTr g49mUUkrMHwHgyksscIUY8LP4wRewg2JoLeR0Vu5g4A+XQxcCeu6JP89fRe+MqEaUlme 16F3hqNM3yCloTOuYtrY2UZUirvNADEtjBxla7j1U6srwzahDbNVQO1co+9UxyIaRrIV dZNCD10zwBbnu0zAiXNHJOD+zAhA2cki3mqmSkZwB3PmeZTvuAMRSqjy5OqcO6mxXOdW DP4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-151193-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151193-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v12-20020a1709063bcc00b00a51b4613347si1859022ejf.104.2024.04.19.01.54.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 01:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151193-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-151193-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151193-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 260ED1F21F18 for ; Fri, 19 Apr 2024 08:54:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E86A745D6; Fri, 19 Apr 2024 08:53:54 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C00AFF9CD; Fri, 19 Apr 2024 08:53:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713516834; cv=none; b=oQfzDhx1zdC34i6Q73AbvMaiU0J0E+n82hAI9/DRWe8/zqwiDkfQpVKAyOqoTB5jU2K8Fr5s5tk/OkOr6DXpF6zhvvakWF24kYARs+4PAiQ+bKgprgdWLZ43lHSPmzjRG6h86bg0FXoCaSoMZSlJIjd9Ks1bKBBRfBDUXx5T2X8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713516834; c=relaxed/simple; bh=mZaqwvICdeQc4Uk1/mG9rpCXgLLl45RMWhDGIpJ27DU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YRIkL5xv59i2SOpty6Qle+dx6GdAnJAZ93rIE9oY3EZlbWn3GQGpF3vUXq/DSy+1AejJgILOg3+obowcyfomY6ChsICpwV90uRIbCvqI/u8uXtth6LWGMZz/z1Us6XhSxXPPivzi36T2wnKh0AcaPxMJ8T09arF0+9GIeO7J7zM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 198A42F; Fri, 19 Apr 2024 01:54:19 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D14E23F792; Fri, 19 Apr 2024 01:53:47 -0700 (PDT) Date: Fri, 19 Apr 2024 09:53:45 +0100 From: Sudeep Holla To: Elliot Berman Cc: Bjorn Andersson , Konrad Dybcio , Sudeep Holla , Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Andy Yan , Lorenzo Pieralisi , Mark Rutland , Bartosz Golaszewski , Satya Durga Srinivasu Prabhala , Melody Olvera , Shivendra Pratap , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Fainelli , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 0/4] Implement vendor resets for PSCI SYSTEM_RESET2 Message-ID: <20240419085345.4ovebbbmcabo3f73@bogus> References: <20240414-arm-psci-system_reset2-vendor-reboots-v2-0-da9a055a648f@quicinc.com> <20240417140957985-0700.eberman@hu-eberman-lv.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240417140957985-0700.eberman@hu-eberman-lv.qualcomm.com> On Wed, Apr 17, 2024 at 02:54:41PM -0700, Elliot Berman wrote: > On Tue, Apr 16, 2024 at 10:35:22AM +0100, Sudeep Holla wrote: > > On Sun, Apr 14, 2024 at 12:30:23PM -0700, Elliot Berman wrote: > > > The PSCI SYSTEM_RESET2 call allows vendor firmware to define additional > > > reset types which could be mapped to the reboot argument. > > > > > > Setting up reboot on Qualcomm devices can be inconsistent from chipset > > > to chipset. > > > > That doesn't sound good. Do you mean PSCI SYSTEM_RESET doesn't work as > > expected ? Does it mean it is not conformant to the specification ? > > > > I was motivating the reason for using SYSTEM_RESET2. How to set the PMIC > register and IMEM cookie can change between chipsets. Using > SYSTEM_RESET2 alows us to abstract how to perform the reset. Fair enough. But I assume you are not providing the details of PMIC register or IMEM cookie via DT. Anyways you did confirm if PSCI SYSTEM_RESET works as expected or not. That is default and must work. > > > Generally, there is a PMIC register that gets written to > > > decide the reboot type. There is also sometimes a cookie that can be > > > written to indicate that the bootloader should behave differently than a > > > regular boot. These knobs evolve over product generations and require > > > more drivers. Qualcomm firmwares are beginning to expose vendor > > > SYSTEM_RESET2 types to simplify driver requirements from Linux. > > > > > > > Why can't this be fully userspace driven ? What is the need to keep the > > cookie in the DT ? > > As Dmitry pointed out, this information isn't discoverable. I suppose > we could technically use bootconfig or kernel command-line to convey the > map although I think devicetree is the right spot for this mapping. > Yes and as usual DT has become dumping ground for firmware that don't make things discoverable. Make crap that Qcom puts in the DT are firmware related and can be make discoverable. Anyways it is sad that no efforts to make it so are done as DT is always there to provide shortcuts. > - Other vendor-specific bits for PSCI are described in the devicetree. > One example is the suspend param (e.g. the StateID) for cpu idle > states. You are right, but that is the only example I can see and it was done in very early days of PSCI. It shouldn't be example if there are better ways. > - Describing firmware bits in the DT isn't unprecedented, and putting > this information outside the DT means that other OSes (besides Linux) > need their own way to convey this information. Correct but it can be Qcom specific firmware interface. There are so many already. This splitting information between firmware and DT works well for vertically integrated things which probably is the case with most of Qcom SoCs but it is prone to issues if DT and firmware mismatch. Firmware discovery eliminates such issues. > - PSCI would be the odd one out that reboot mode map is not described in > DT. Other reboot-mode drivers specify the mapping in the DT. Userspace > that runs with firmware that support vendor reset2 need to make sure > they can configure the mapping early enough. > Well I am not saying not to this yet, just exploring and getting more info so that whatever is done here can be reused on all PSCI based systems. -- Regards, Sudeep